Skip to content

Commit

Permalink
Allow constants to start with non-ascii uppercase and titlecase (#15148)
Browse files Browse the repository at this point in the history
  • Loading branch information
nanobowers authored Dec 10, 2024
1 parent d1201b3 commit 5d6757c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions spec/compiler/lexer/lexer_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ describe "Lexer" do
it_lexes "&+@foo", :OP_AMP_PLUS
it_lexes "&-@foo", :OP_AMP_MINUS
it_lexes_const "Foo"
it_lexes_const "ÁrvíztűrőTükörfúrógép"
it_lexes_const "DžLjNjDzᾈᾉᾊ"
it_lexes_instance_var "@foo"
it_lexes_class_var "@@foo"
it_lexes_globals ["$foo", "$FOO", "$_foo", "$foo123"]
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/syntax/lexer.cr
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ module Crystal

scan_ident(start)
else
if current_char.ascii_uppercase?
if current_char.uppercase? || current_char.titlecase?
while ident_part?(next_char)
# Nothing to do
end
Expand Down

0 comments on commit 5d6757c

Please sign in to comment.