@@ -63,15 +63,17 @@ defmodule Code.Normalizer do
63
63
end
64
64
65
65
# Bit containers
66
- defp do_normalize ( { :<<>> , _ , _ } = quoted , state ) do
66
+ defp do_normalize ( { :<<>> , _ , args } = quoted , state ) when is_list ( args ) do
67
67
normalize_bitstring ( quoted , state )
68
68
end
69
69
70
70
# Atoms with interpolations
71
71
defp do_normalize (
72
- { { :. , dot_meta , [ :erlang , :binary_to_atom ] } , call_meta , [ { :<<>> , _ , _ } = string , :utf8 ] } ,
72
+ { { :. , dot_meta , [ :erlang , :binary_to_atom ] } , call_meta ,
73
+ [ { :<<>> , _ , args } = string , :utf8 ] } ,
73
74
state
74
- ) do
75
+ )
76
+ when is_list ( args ) do
75
77
dot_meta = patch_meta_line ( dot_meta , state . parent_meta )
76
78
call_meta = patch_meta_line ( call_meta , dot_meta )
77
79
@@ -166,8 +168,8 @@ defmodule Code.Normalizer do
166
168
end
167
169
168
170
# Sigils
169
- defp do_normalize ( { sigil , meta , [ { :<<>> , _ , _ } = string , modifiers ] } = quoted , state )
170
- when is_atom ( sigil ) do
171
+ defp do_normalize ( { sigil , meta , [ { :<<>> , _ , args } = string , modifiers ] } = quoted , state )
172
+ when is_list ( args ) and is_atom ( sigil ) do
171
173
case Atom . to_string ( sigil ) do
172
174
<< "sigil_" , _name >> ->
173
175
meta =
@@ -183,7 +185,7 @@ defmodule Code.Normalizer do
183
185
end
184
186
185
187
# Tuples
186
- defp do_normalize ( { :{} , meta , args } = quoted , state ) do
188
+ defp do_normalize ( { :{} , meta , args } = quoted , state ) when is_list ( args ) do
187
189
{ last_arg , args } = List . pop_at ( args , - 1 )
188
190
189
191
if args != [ ] and match? ( [ _ | _ ] , last_arg ) and keyword? ( last_arg ) do
0 commit comments