diff options
author | Björn-Egil Dahlberg <[email protected]> | 2013-10-01 22:42:18 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2014-01-28 15:56:27 +0100 |
commit | 758702e24f0780130c6b3058426062a3761b7a6e (patch) | |
tree | 65617b8efd72341a39a55571c731ca626e04468c /lib/stdlib/src/erl_lint.erl | |
parent | a0133aa75da3756918a5b9fd427ae75a75ae1dce (diff) | |
download | otp-758702e24f0780130c6b3058426062a3761b7a6e.tar.gz otp-758702e24f0780130c6b3058426062a3761b7a6e.tar.bz2 otp-758702e24f0780130c6b3058426062a3761b7a6e.zip |
Update erl_lint, erl_expand_records, sys_pre_expand for Maps
Update erlang lint and syntax expand for #{ K := V }
Diffstat (limited to 'lib/stdlib/src/erl_lint.erl')
-rw-r--r-- | lib/stdlib/src/erl_lint.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl index b74a3ed924..86ebe82acc 100644 --- a/lib/stdlib/src/erl_lint.erl +++ b/lib/stdlib/src/erl_lint.erl @@ -1368,7 +1368,9 @@ pattern({tuple,_Line,Ps}, Vt, Old, Bvt, St) -> pattern_list(Ps, Vt, Old, Bvt, St); pattern({map,_Line,Ps}, Vt, Old, Bvt, St) -> pattern_list(Ps, Vt, Old, Bvt, St); -pattern({map_field,_Line,_,P}, Vt, Old, Bvt0, St0) -> +pattern({map_field_assoc,_Line,_,_}=Pat, _, _, _, St) -> + {[],[],add_error(element(2, Pat), illegal_pattern, St)}; +pattern({map_field_exact,_Line,_,P}, Vt, Old, Bvt0, St0) -> {Pvt,Bvt,St1} = pattern(P, Vt, Old, Bvt0, St0), {Pvt,Bvt,St1}; %%pattern({struct,_Line,_Tag,Ps}, Vt, Old, Bvt, St) -> @@ -1762,7 +1764,9 @@ gexpr({map,_Line,Es}, Vt, St) -> gexpr_list(Es, Vt, St); gexpr({map,_Line,Src,Es}, Vt, St) -> gexpr_list([Src|Es], Vt, St); -gexpr({map_field,_Line,K,V}, Vt, St) -> +gexpr({map_field_assoc,_Line,K,V}, Vt, St) -> + gexpr_list([K,V], Vt, St); +gexpr({map_field_exact,_Line,K,V}, Vt, St) -> gexpr_list([K,V], Vt, St); gexpr({record_index,Line,Name,Field}, _Vt, St) -> check_record(Line, Name, St, @@ -1985,7 +1989,9 @@ expr({map,_Line,Es}, Vt, St) -> expr_list(Es, Vt, St); expr({map,_Line,Src,Es}, Vt, St) -> expr_list([Src|Es], Vt, St); -expr({map_field,_Line,K,V}, Vt, St) -> +expr({map_field_assoc,_Line,K,V}, Vt, St) -> + expr_list([K,V], Vt, St); +expr({map_field_exact,_Line,K,V}, Vt, St) -> expr_list([K,V], Vt, St); expr({record_index,Line,Name,Field}, _Vt, St) -> check_record(Line, Name, St, |