Skip to content

Commit

Permalink
Fix trans macro (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack authored and bicycle1885 committed Dec 20, 2016
1 parent 0f1495a commit 0209f70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/state.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ macro trans(obj, ts)
ts = :($(ts),)
end
@assert ts.head == :tuple
foldr(:(error("invalid state: ", $(obj).state)), ts.args) do t, elblk
foldr(:(error("invalid state: ", $(esc(obj)).state)), ts.args) do t, elblk
@assert t.head == :(=>)
from, to = t.args
quote
if $(obj).state == $(from)
$(obj).state = $(to)
if $(esc(obj)).state == $(esc(from))
$(esc(obj)).state = $(esc(to))
else
$(elblk)
end
Expand Down

0 comments on commit 0209f70

Please sign in to comment.