Supports maps:get and maps:put from the standard library as well. The rest of the standard library (e.g. maps:from_list, maps:to_list) is not straightforward to support and will be added in a separate PR.
This PR makes cuter recognize and correctly handle map values and patterns. It does not add any logic regarding symbolic map values and how they can be handled, this will be done separately.
For all examples, --disable-pmatch is required, since map values are not handled.
Summary
References #183. Support expressions and pattern matching for Erlang maps.
This PR can be reviewed and merged separately from #184, but any future work on maps greatly depends on these two PRs getting merged.
Changes
map
andmap_pair
nodes. This is required for pattern matching to work properly.{c_map, ...}
(maps) and{c_map_pair, ...}
(key-value pairs) nodes ineval_expr/6
.{c_map, ...}
(maps) and{c_map_pair, ...}
(key-value pairs) nodes inpattern_match/9
maps
standard library (maps:get
,maps:put
andis_map
).Testing
Notes
maps:get
andmaps:put
from the standard library as well. The rest of the standard library (e.g.maps:from_list
,maps:to_list
) is not straightforward to support and will be added in a separate PR.--disable-pmatch
is required, since map values are not handled.