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
2 changes: 2 additions & 0 deletions spec/compiler/parser/parser_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2806,8 +2806,10 @@ module Crystal

then_node_location = then_node.expressions[1].location.should_not be_nil
then_node_location.line_number.should eq 2
then_node_location.column_number.should eq 5
then_node_location = then_node.expressions[1].end_location.should_not be_nil
then_node_location.line_number.should eq 2
then_node_location.column_number.should eq 13

else_node = node.else.should be_a Expressions
else_node_location = else_node.location.should_not be_nil
Expand Down
4 changes: 3 additions & 1 deletion src/compiler/crystal/syntax/parser.cr
Original file line number Diff line number Diff line change
Expand Up @@ -3228,9 +3228,11 @@ 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
exp = MacroExpression.new(parse_macro_expression).at(location)
check_macro_expression_end
skip_whitespace = check_macro_skip_whitespace
pieces << exp.at_end(token_end_location)
when .macro_control_start?
macro_control = parse_macro_control(start_location, macro_state)
if macro_control
Expand Down