diff options
author | Björn Gustavsson <[email protected]> | 2016-12-15 09:15:08 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-01-12 12:10:11 +0100 |
commit | b4413f63e9464e05fbff2c85a18cbda414e52c77 (patch) | |
tree | 76fc7fca7d1ff8bd0c02a35e81197a8a62d779fa | |
parent | fa67ec3313a84c578e9cfcce31795a1ac66a289f (diff) | |
download | otp-b4413f63e9464e05fbff2c85a18cbda414e52c77.tar.gz otp-b4413f63e9464e05fbff2c85a18cbda414e52c77.tar.bz2 otp-b4413f63e9464e05fbff2c85a18cbda414e52c77.zip |
cerl: Add missing types and specs
-rw-r--r-- | lib/compiler/src/cerl.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/compiler/src/cerl.erl b/lib/compiler/src/cerl.erl index b1be6ffc6d..6b936a7687 100644 --- a/lib/compiler/src/cerl.erl +++ b/lib/compiler/src/cerl.erl @@ -1584,6 +1584,8 @@ ann_make_list(_, [], Node) -> %% @doc Returns <code>true</code> if <code>Node</code> is an abstract %% map constructor, otherwise <code>false</code>. +-type map_op() :: #c_literal{val::'assoc'} | #c_literal{val::'exact'}. + -spec is_c_map(cerl()) -> boolean(). is_c_map(#c_map{}) -> @@ -1679,8 +1681,16 @@ update_c_map(#c_map{is_pat=true}=Old, M, Es) -> update_c_map(#c_map{is_pat=false}=Old, M, Es) -> ann_c_map(get_ann(Old), M, Es). +-spec map_pair_key(c_map_pair()) -> cerl(). + map_pair_key(#c_map_pair{key=K}) -> K. + +-spec map_pair_val(c_map_pair()) -> cerl(). + map_pair_val(#c_map_pair{val=V}) -> V. + +-spec map_pair_op(c_map_pair()) -> map_op(). + map_pair_op(#c_map_pair{op=Op}) -> Op. -spec c_map_pair(cerl(), cerl()) -> c_map_pair(). @@ -1699,6 +1709,8 @@ c_map_pair_exact(Key,Val) -> ann_c_map_pair(As,Op,K,V) -> #c_map_pair{op=Op, key = K, val=V, anno = As}. +-spec update_c_map_pair(c_map_pair(), map_op(), cerl(), cerl()) -> c_map_pair(). + update_c_map_pair(Old,Op,K,V) -> #c_map_pair{op=Op, key=K, val=V, anno = get_ann(Old)}. |