aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-02-14 17:17:37 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-02-14 17:17:37 +0100
commit9f2753f13c2a9b840e76fc10a12752aaa09a7e96 (patch)
treefb0131d2748ef6911043b594721263e587eab030 /lib/stdlib/src
parent90f9fb016d199ef518737d1cd85c364a93891bd6 (diff)
parent53f50cb3729c47f337186c9d7201a62450505a3c (diff)
downloadotp-9f2753f13c2a9b840e76fc10a12752aaa09a7e96.tar.gz
otp-9f2753f13c2a9b840e76fc10a12752aaa09a7e96.tar.bz2
otp-9f2753f13c2a9b840e76fc10a12752aaa09a7e96.zip
Merge branch 'nox/maps-improve-erl_expand_records'
* nox/maps-improve-erl_expand_records: Fix expansion of records in maps
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/erl_expand_records.erl14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/stdlib/src/erl_expand_records.erl b/lib/stdlib/src/erl_expand_records.erl
index 4741bef6b9..f53c6e1278 100644
--- a/lib/stdlib/src/erl_expand_records.erl
+++ b/lib/stdlib/src/erl_expand_records.erl
@@ -135,9 +135,10 @@ pattern({tuple,Line,Ps}, St0) ->
pattern({map,Line,Ps}, St0) ->
{TPs,St1} = pattern_list(Ps, St0),
{{map,Line,TPs},St1};
-pattern({map_field_exact,Line,Key,V0}, St0) ->
- {V,St1} = pattern(V0, St0),
- {{map_field_exact,Line,Key,V},St1};
+pattern({map_field_exact,Line,Key0,V0}, St0) ->
+ {Key,St1} = pattern(Key0, St0),
+ {V,St2} = pattern(V0, St1),
+ {{map_field_exact,Line,Key,V},St2};
%%pattern({struct,Line,Tag,Ps}, St0) ->
%% {TPs,TPsvs,St1} = pattern_list(Ps, St0),
%% {{struct,Line,Tag,TPs},TPsvs,St1};
@@ -310,9 +311,10 @@ expr({tuple,Line,Es0}, St0) ->
expr({map,Line,Es0}, St0) ->
{Es1,St1} = expr_list(Es0, St0),
{{map,Line,Es1},St1};
-expr({map,Line,Var,Es0}, St0) ->
- {Es1,St1} = expr_list(Es0, St0),
- {{map,Line,Var,Es1},St1};
+expr({map,Line,Arg0,Es0}, St0) ->
+ {Arg1,St1} = expr(Arg0, St0),
+ {Es1,St2} = expr_list(Es0, St1),
+ {{map,Line,Arg1,Es1},St2};
expr({map_field_assoc,Line,K0,V0}, St0) ->
{K,St1} = expr(K0, St0),
{V,St2} = expr(V0, St1),