diff options
author | Björn Gustavsson <[email protected]> | 2012-05-16 10:47:58 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2014-01-28 15:56:25 +0100 |
commit | 860171895f5858314abd85f8461568f34e76c427 (patch) | |
tree | 297e820aa1c7fa72732f29c9e5d93179fe309591 /lib/stdlib/src/erl_expand_records.erl | |
parent | 703a9aa47168f7f8c11bf835502281bd59ba77f7 (diff) | |
download | otp-860171895f5858314abd85f8461568f34e76c427.tar.gz otp-860171895f5858314abd85f8461568f34e76c427.tar.bz2 otp-860171895f5858314abd85f8461568f34e76c427.zip |
Update erl_lint, erl_expand_records, sys_pre_expand for maps
Diffstat (limited to 'lib/stdlib/src/erl_expand_records.erl')
-rw-r--r-- | lib/stdlib/src/erl_expand_records.erl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/stdlib/src/erl_expand_records.erl b/lib/stdlib/src/erl_expand_records.erl index 776b433613..7fc4cc7887 100644 --- a/lib/stdlib/src/erl_expand_records.erl +++ b/lib/stdlib/src/erl_expand_records.erl @@ -132,6 +132,12 @@ pattern({cons,Line,H,T}, St0) -> pattern({tuple,Line,Ps}, St0) -> {TPs,St1} = pattern_list(Ps, St0), {{tuple,Line,TPs},St1}; +pattern({map,Line,Ps}, St0) -> + {TPs,St1} = pattern_list(Ps, St0), + {{map,Line,TPs},St1}; +pattern({map_field,Line,Key,V0}, St0) -> + {V,St1} = pattern(V0, St0), + {{map_field,Line,Key,V},St1}; %%pattern({struct,Line,Tag,Ps}, St0) -> %% {TPs,TPsvs,St1} = pattern_list(Ps, St0), %% {{struct,Line,Tag,TPs},TPsvs,St1}; @@ -301,6 +307,14 @@ expr({bc,Line,E0,Qs0}, St0) -> expr({tuple,Line,Es0}, St0) -> {Es1,St1} = expr_list(Es0, St0), {{tuple,Line,Es1},St1}; +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_field,_Line,_,_}=M, St0) -> + {M,St0}; %%expr({struct,Line,Tag,Es0}, Vs, St0) -> %% {Es1,Esvs,Esus,St1} = expr_list(Es0, Vs, St0), %% {{struct,Line,Tag,Es1},Esvs,Esus,St1}; |