Skip to content

Commit

Permalink
Fix goto/label in macros invoked from another module.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcjones committed Aug 7, 2014
1 parent 3ddbaa1 commit 78cca5b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3262,9 +3262,10 @@ So far only the second case can actually occur.
((escape) (cadr e))
((using import importall export) (map unescape e))
((macrocall)
(if (or (eq? (cadr e) '@label) (eq? (cadr e) '@goto)) e
`(macrocall ,.(map (lambda (x)
(resolve-expansion-vars- x env m inarg))
(cdr e))))
(cdr e)))))
((symboliclabel) e)
((symbolicgoto) e)
((type)
Expand Down
12 changes: 12 additions & 0 deletions test/goto.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,16 @@ end

@test goto_test7(false) == nothing

module GotoMacroTest
macro goto_test8_macro()
quote
function $(esc(:goto_test8))()
@label a
@goto a
end
end
end
end

GotoMacroTest.@goto_test8_macro

0 comments on commit 78cca5b

Please sign in to comment.