From 8ae45c1c6bb89200f881eb396e19bf44c7f067fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 6 Nov 2023 13:28:49 +0100 Subject: [PATCH] Fix case clause error on tokenizer --- lib/elixir/src/elixir_tokenizer.erl | 2 +- lib/elixir/test/elixir/kernel/parser_test.exs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/elixir/src/elixir_tokenizer.erl b/lib/elixir/src/elixir_tokenizer.erl index 72531b15bed..e9cb79f2265 100644 --- a/lib/elixir/src/elixir_tokenizer.erl +++ b/lib/elixir/src/elixir_tokenizer.erl @@ -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} -> diff --git a/lib/elixir/test/elixir/kernel/parser_test.exs b/lib/elixir/test/elixir/kernel/parser_test.exs index cc9e0531574..149498ec2e3 100644 --- a/lib/elixir/test/elixir/kernel/parser_test.exs +++ b/lib/elixir/test/elixir/kernel/parser_test.exs @@ -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