@@ -63,15 +63,17 @@ defmodule Code.Normalizer do
6363 end
6464
6565 # Bit containers
66- defp do_normalize ( { :<<>> , _ , _ } = quoted , state ) do
66+ defp do_normalize ( { :<<>> , _ , args } = quoted , state ) when is_list ( args ) do
6767 normalize_bitstring ( quoted , state )
6868 end
6969
7070 # Atoms with interpolations
7171 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 ] } ,
7374 state
74- ) do
75+ )
76+ when is_list ( args ) do
7577 dot_meta = patch_meta_line ( dot_meta , state . parent_meta )
7678 call_meta = patch_meta_line ( call_meta , dot_meta )
7779
@@ -166,8 +168,8 @@ defmodule Code.Normalizer do
166168 end
167169
168170 # 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
171173 case Atom . to_string ( sigil ) do
172174 << "sigil_" , _name >> ->
173175 meta =
@@ -183,7 +185,7 @@ defmodule Code.Normalizer do
183185 end
184186
185187 # Tuples
186- defp do_normalize ( { :{} , meta , args } = quoted , state ) do
188+ defp do_normalize ( { :{} , meta , args } = quoted , state ) when is_list ( args ) do
187189 { last_arg , args } = List . pop_at ( args , - 1 )
188190
189191 if args != [ ] and match? ( [ _ | _ ] , last_arg ) and keyword? ( last_arg ) do
0 commit comments