From b6f6b19cc114af6f88458624c1470f0f70e24d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 12 Nov 2013 19:18:22 +0100 Subject: compiler: Rename map pattern to proper name --- lib/compiler/src/v3_kernel.erl | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'lib/compiler/src') diff --git a/lib/compiler/src/v3_kernel.erl b/lib/compiler/src/v3_kernel.erl index 14e776fd3c..a5a94c1294 100644 --- a/lib/compiler/src/v3_kernel.erl +++ b/lib/compiler/src/v3_kernel.erl @@ -668,14 +668,10 @@ pattern(#c_tuple{anno=A,es=Ces}, Isub, Osub0, St0) -> pattern(#c_map{anno=A,es=Ces}, Isub, Osub0, St0) -> {Kes,Osub1,St1} = pattern_list(Ces, Isub, Osub0, St0), {#k_map{anno=A,es=Kes},Osub1,St1}; -pattern(#c_map_pair_assoc{anno=A,key=Ck,val=Cv},Isub, Osub0, St0) -> - {Kk,Osub1,St1} = pattern(Ck, Isub, Osub0, St0), - {Kv,Osub2,St2} = pattern(Cv, Isub, Osub1, St1), - {#k_map_pair_assoc{anno=A,key=Kk,val=Kv},Osub2,St2}; pattern(#c_map_pair_exact{anno=A,key=Ck,val=Cv},Isub, Osub0, St0) -> {Kk,Osub1,St1} = pattern(Ck, Isub, Osub0, St0), {Kv,Osub2,St2} = pattern(Cv, Isub, Osub1, St1), - {#k_map_pair_assoc{anno=A,key=Kk,val=Kv},Osub2,St2}; + {#k_map_pair_exact{anno=A,key=Kk,val=Kv},Osub2,St2}; pattern(#c_binary{anno=A,segments=Cv}, Isub, Osub0, St0) -> {Kv,Osub1,St1} = pattern_bin(Cv, Isub, Osub0, St0), {#k_binary{anno=A,segs=Kv},Osub1,St1}; @@ -1351,9 +1347,10 @@ get_match(#k_tuple{es=Es}, St0) -> {#k_tuple{es=Mes},Mes,St1}; get_match(#k_map{es=Es0}, St0) -> {Mes,St1} = new_vars(length(Es0), St0), - {Es,_} = mapfoldl(fun(#k_map_pair_assoc{}=Pair, [V|Vs]) -> - {Pair#k_map_pair_assoc{val=V},Vs} - end, Mes, Es0), + {Es,_} = mapfoldl(fun + (#k_map_pair_exact{}=Pair, [V|Vs]) -> + {Pair#k_map_pair_exact{val=V},Vs} + end, Mes, Es0), {#k_map{es=Es},Mes,St1}; get_match(M, St) -> {M,[],St}. @@ -1373,7 +1370,7 @@ new_clauses(Cs0, U, St) -> [N|As]; #k_map{es=Es} -> Vals = [V || - #k_map_pair_assoc{val=V} <- Es], + #k_map_pair_exact{val=V} <- Es], Vals ++ As; _Other -> As @@ -1475,7 +1472,7 @@ arg_val(Arg, C) -> end; #k_map{es=Es} -> Keys = [begin - #k_map_pair_assoc{key=#k_literal{val=Key}} = Pair, + #k_map_pair_exact{key=#k_literal{val=Key}} = Pair, Key end || Pair <- Es], %% multiple keys may have the same name @@ -1893,7 +1890,7 @@ pat_vars(#k_tuple{es=Es}) -> pat_list_vars(Es); pat_vars(#k_map{es=Es}) -> pat_list_vars(Es); -pat_vars(#k_map_pair_assoc{val=V}) -> +pat_vars(#k_map_pair_exact{val=V}) -> pat_vars(V). pat_list_vars(Ps) -> -- cgit v1.2.3