Skip to content

Commit

Permalink
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/compiler/crystal/syntax/parser.cr
Original file line number Diff line number Diff line change
@@ -2792,6 +2792,18 @@ module Crystal
end

def check_macro_expression_end
if @token.type == :","
raise <<-MSG
expecting token ',', not '}'
If you are nesting tuples or hashes you must write them like this:
{ {x, y}, {z, w} } # Note the space after the first curly brace
because {{...}} is parsed as a macro expression.
MSG
end

check :"}"

next_token

0 comments on commit e592bc8

Please sign in to comment.