From 758702e24f0780130c6b3058426062a3761b7a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 1 Oct 2013 22:42:18 +0200 Subject: Update erl_lint, erl_expand_records, sys_pre_expand for Maps Update erlang lint and syntax expand for #{ K := V } --- lib/stdlib/src/erl_expand_records.erl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lib/stdlib/src/erl_expand_records.erl') diff --git a/lib/stdlib/src/erl_expand_records.erl b/lib/stdlib/src/erl_expand_records.erl index 7fc4cc7887..4741bef6b9 100644 --- a/lib/stdlib/src/erl_expand_records.erl +++ b/lib/stdlib/src/erl_expand_records.erl @@ -135,9 +135,9 @@ pattern({tuple,Line,Ps}, St0) -> pattern({map,Line,Ps}, St0) -> {TPs,St1} = pattern_list(Ps, St0), {{map,Line,TPs},St1}; -pattern({map_field,Line,Key,V0}, St0) -> +pattern({map_field_exact,Line,Key,V0}, St0) -> {V,St1} = pattern(V0, St0), - {{map_field,Line,Key,V},St1}; + {{map_field_exact,Line,Key,V},St1}; %%pattern({struct,Line,Tag,Ps}, St0) -> %% {TPs,TPsvs,St1} = pattern_list(Ps, St0), %% {{struct,Line,Tag,TPs},TPsvs,St1}; @@ -313,8 +313,14 @@ expr({map,Line,Es0}, St0) -> expr({map,Line,Var,Es0}, St0) -> {Es1,St1} = expr_list(Es0, St0), {{map,Line,Var,Es1},St1}; -expr({map_field,_Line,_,_}=M, St0) -> - {M,St0}; +expr({map_field_assoc,Line,K0,V0}, St0) -> + {K,St1} = expr(K0, St0), + {V,St2} = expr(V0, St1), + {{map_field_assoc,Line,K,V},St2}; +expr({map_field_exact,Line,K0,V0}, St0) -> + {K,St1} = expr(K0, St0), + {V,St2} = expr(V0, St1), + {{map_field_exact,Line,K,V},St2}; %%expr({struct,Line,Tag,Es0}, Vs, St0) -> %% {Es1,Esvs,Esus,St1} = expr_list(Es0, Vs, St0), %% {{struct,Line,Tag,Es1},Esvs,Esus,St1}; -- cgit v1.2.3