Skip to content

Commit

Permalink
fix JuliaLang#9704, allow interpolating var in catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Feb 3, 2015
1 parent 42e28c8 commit bf58fa6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/julia-parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@
#f
finalb)
(let* ((var (parse-eq* s))
(var? (and (not nl) (symbol? var)))
(var? (and (not nl) (or (symbol? var) (and (length= var 2) (eq? (car var) '$)))))
(catch-block (if (eq? (require-token s) 'finally)
'(block)
(parse-block s))))
Expand Down
12 changes: 12 additions & 0 deletions test/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,15 @@ let
@test ex1.args[3] === :x && (ex1.args[3] === ex2.args[3])
end
end

# issue #9704
let a = :a
@test :(try
catch $a
end) == :(try
catch a
end)
@test :(module $a
end) == :(module a
end)
end

0 comments on commit bf58fa6

Please sign in to comment.