diff options
author | Björn Gustavsson <[email protected]> | 2015-02-02 12:45:57 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-02-12 13:14:38 +0100 |
commit | d5a5df2d00f62ee580156bee605b0c4519f625f1 (patch) | |
tree | 2a9cb4160e6779c6cda7814b7636e57ce3d3a5e4 /lib/compiler | |
parent | 49b07e561b3658f510ec6ab63cbe35fac24da97e (diff) | |
download | otp-d5a5df2d00f62ee580156bee605b0c4519f625f1.tar.gz otp-d5a5df2d00f62ee580156bee605b0c4519f625f1.tar.bz2 otp-d5a5df2d00f62ee580156bee605b0c4519f625f1.zip |
cerl: Add missing is_c_map/1 function
Diffstat (limited to 'lib/compiler')
-rw-r--r-- | lib/compiler/src/cerl.erl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/compiler/src/cerl.erl b/lib/compiler/src/cerl.erl index 1a2957ee31..5d6997da11 100644 --- a/lib/compiler/src/cerl.erl +++ b/lib/compiler/src/cerl.erl @@ -124,6 +124,7 @@ %% keep map exports here for now c_map_pattern/1, + is_c_map/1, map_es/1, map_arg/1, update_c_map/3, @@ -1579,6 +1580,20 @@ ann_make_list(_, [], Node) -> %% --------------------------------------------------------------------- %% maps +%% @spec is_c_map(Node::cerl()) -> boolean() +%% +%% @doc Returns <code>true</code> if <code>Node</code> is an abstract +%% map constructor, otherwise <code>false</code>. + +-spec is_c_map(cerl()) -> boolean(). + +is_c_map(#c_map{}) -> + true; +is_c_map(#c_literal{val = V}) when is_map(V) -> + true; +is_c_map(_) -> + false. + -spec map_es(c_map()) -> [c_map_pair()]. map_es(#c_map{es = Es}) -> |