Skip to content

Commit 2c7fa47

Browse files
committed
Remove general catch on sigil token
1 parent 71e1ddc commit 2c7fa47

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

lib/elixir/src/elixir_tokenizer.erl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ unsafe_to_atom(Binary, Line, Column, #elixir_tokenizer{existing_atoms_only=true}
10551055
try
10561056
{ok, binary_to_existing_atom(Binary, utf8)}
10571057
catch
1058-
error:badarg ->
1058+
error:badarg ->
10591059
% Check if it's a UTF-8 issue by trying to convert to list
10601060
try
10611061
List = elixir_utils:characters_to_list(Binary),
@@ -1719,14 +1719,7 @@ tokenize_sigil_contents([H | T] = Original, [S | _] = SigilName, Line, Column, S
17191719
case elixir_interpolation:extract(Line, Column + 1, Scope, ?is_downcase(S), T, sigil_terminator(H)) of
17201720
{NewLine, NewColumn, Parts, Rest, NewScope} ->
17211721
Indentation = nil,
1722-
try
1723-
add_sigil_token(SigilName, Line, Column, NewLine, NewColumn, tokens_to_binary(Parts), Rest, NewScope, Tokens, Indentation, <<H>>)
1724-
catch
1725-
error:#{'__struct__' := 'Elixir.UnicodeConversionError', message := Message} ->
1726-
Sigil = [$~, S, H],
1727-
Message = " (for sigil ~ts starting at line ~B)",
1728-
interpolation_error(Message, [$~] ++ SigilName ++ Original, Scope, Tokens, Message, [Sigil, Line], Line, Column, [H], [sigil_terminator(H)])
1729-
end;
1722+
add_sigil_token(SigilName, Line, Column, NewLine, NewColumn, tokens_to_binary(Parts), Rest, NewScope, Tokens, Indentation, <<H>>);
17301723

17311724
{error, Reason} ->
17321725
Sigil = [$~, S, H],

0 commit comments

Comments
 (0)