Skip to content

Commit

Permalink
Fix case clause error on tokenizer
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Nov 6, 2023
1 parent 298bf7e commit 8ae45c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/elixir/src/elixir_tokenizer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ handle_strings(T, Line, Column, H, Scope, Tokens) ->
Token = {kw_identifier, {Line, Column - 1, nil}, Atom},
tokenize(Rest, NewLine, NewColumn + 1, NewScope, [Token | Tokens]);
{error, Reason} ->
{error, Reason, Rest, Tokens}
error(Reason, Rest, NewScope, Tokens)
end;

{ok, Unescaped} ->
Expand Down
7 changes: 6 additions & 1 deletion lib/elixir/test/elixir/kernel/parser_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,12 @@ defmodule Kernel.ParserTest do

assert_syntax_error(
["atom length must be less than system limit: "],
~s[:"#{atom}"]
~s{:"#{atom}"}
)

assert_syntax_error(
["atom length must be less than system limit: "],
~s{["#{atom}": 123]}
)
end
end
Expand Down

0 comments on commit 8ae45c1

Please sign in to comment.