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/compiler/src | |
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/compiler/src')
-rw-r--r-- | lib/compiler/src/sys_pre_expand.erl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/compiler/src/sys_pre_expand.erl b/lib/compiler/src/sys_pre_expand.erl index 48d9c16718..969e95e8dc 100644 --- a/lib/compiler/src/sys_pre_expand.erl +++ b/lib/compiler/src/sys_pre_expand.erl @@ -228,6 +228,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), %% {{tuple,Line,[{atom,Line,Tag}|TPs]},TPsvs,St1}; @@ -321,6 +327,16 @@ expr({tuple,Line,Es0}, St0) -> %%expr({struct,Line,Tag,Es0}, Vs, St0) -> %% {Es1,Esvs,Esus,St1} = expr_list(Es0, Vs, St0), %% {{tuple,Line,[{atom,Line,Tag}|Es1]},Esvs,Esus,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,K0,V0}, St0) -> + {K,St1} = expr(K0, St0), + {V,St2} = expr(V0, St1), + {{map_field,Line,K,V},St2}; expr({bin,Line,Es0}, St0) -> {Es1,St1} = expr_bin(Es0, St0), {{bin,Line,Es1},St1}; |