Skip to content
Open
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/lexer/lexer_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -712,4 +712,6 @@ describe "Lexer" do
token.delimiter_state.kind.should eq(Token::DelimiterKind::HEREDOC)
token.raw.should eq "<<-EOS"
end

assert_syntax_error "<<-123\n456\n123", "heredoc identifier starts with invalid character"
end
2 changes: 1 addition & 1 deletion src/compiler/crystal/syntax/lexer.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2469,7 +2469,7 @@ module Crystal
next_char
end

unless ident_part?(current_char)
unless ident_start?(current_char)
raise "heredoc identifier starts with invalid character"
end

Expand Down