Skip to content

Commit

Permalink
Fix location of MacroExpression nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija authored Feb 25, 2025
1 parent 62c92a0 commit ea06b96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compiler/crystal/syntax/parser.cr
Original file line number Diff line number Diff line change
Expand Up @@ -3228,7 +3228,8 @@ module Crystal
when .macro_literal?
pieces << MacroLiteral.new(@token.value.to_s).at(@token.location).at_end(token_end_location)
when .macro_expression_start?
pieces << MacroExpression.new(parse_macro_expression).at(@token.location).at_end(token_end_location)
location = @token.location
pieces << MacroExpression.new(parse_macro_expression).at(location).at_end(token_end_location)
check_macro_expression_end
skip_whitespace = check_macro_skip_whitespace
when .macro_control_start?
Expand Down

0 comments on commit ea06b96

Please sign in to comment.