Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2316,6 +2316,9 @@ function fix_macro_name_kind!(ps::ParseState, macro_name_position, name_kind=not
elseif k == K"parens"
# @(A) x ==> (macrocall (parens @A) x)
macro_name_position = first_child_position(ps, macro_name_position)
if macro_name_position == NO_POSITION
return
end
k = peek_behind(ps, macro_name_position).kind
elseif k == K"error"
# Error already reported in parse_macro_name
Expand Down
2 changes: 2 additions & 0 deletions test/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,8 @@ parsestmt_test_specs = [
# shouldn't crash
"@(x y)" => "(macrocall (parens @x (error-t y)))"
"|(&\nfunction" => "(call | (& (function (error (error)) (block (error)) (error-t))) (error-t))"
"@(" => "(macrocall (parens (error-t)))"
"x = @(" => "(= x (macrocall (parens (error-t))))"

# The following is currently broken but at least the parser shouldn't
# crash.
Expand Down