From d5a5df2d00f62ee580156bee605b0c4519f625f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 2 Feb 2015 12:45:57 +0100 Subject: cerl: Add missing is_c_map/1 function --- lib/compiler/src/cerl.erl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/compiler') 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 true if Node is an abstract +%% map constructor, otherwise false. + +-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}) -> -- cgit v1.2.3