We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f728352 commit 6219abbCopy full SHA for 6219abb
1 file changed
src/finitestatemachines/macro.jl
@@ -37,9 +37,13 @@ macro stateful(expr::Expr)
37
$((:($arg) for arg in new_expr.args)...)
38
end
39
)
40
- expr.args[1].head == Symbol("::") && func_expr.args[1] = Expr(Symbol("::"), func_expr.args[1], expr.args[1].args[2])
+ if expr.args[1].head == Symbol("::")
41
+ func_expr.args[1] = Expr(Symbol("::"), func_expr.args[1], expr.args[1].args[2])
42
+ end
43
call_expr = deepcopy(expr)
- call_expr.args[1].head == Symbol("::") && call_expr.args[1] = call_expr.args[1].args[1]
44
+ if call_expr.args[1].head == Symbol("::")
45
+ call_expr.args[1] = call_expr.args[1].args[1]
46
47
call_expr.head = Symbol("=")
48
call_expr.args[2] = :($type_name($((:($arg) for arg in args)...)))
49
esc(quote
0 commit comments