diff options
author | Magnus Lång <[email protected]> | 2016-02-27 18:49:33 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2016-04-28 16:14:25 +0200 |
commit | a07a1d465994427d322c523f26dcabefeb14cf01 (patch) | |
tree | dacc413b203de52343b9f18d09ef8529b78d576c /lib/stdlib/src/erl_parse.yrl | |
parent | ee6a551e593b9788e433f7a99857729acdd5dd53 (diff) | |
download | otp-a07a1d465994427d322c523f26dcabefeb14cf01.tar.gz otp-a07a1d465994427d322c523f26dcabefeb14cf01.tar.bz2 otp-a07a1d465994427d322c523f26dcabefeb14cf01.zip |
erl_parse: Add parsing for new map type syntax
erl_types typesets mandatory keys with :=, and uses "..." as a shorthand
for "any() => any()". Add these to erl_parse so that all representable
types can be written in type-specs.
Diffstat (limited to 'lib/stdlib/src/erl_parse.yrl')
-rw-r--r-- | lib/stdlib/src/erl_parse.yrl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl index 6f8e5e8449..6d84f82713 100644 --- a/lib/stdlib/src/erl_parse.yrl +++ b/lib/stdlib/src/erl_parse.yrl @@ -173,6 +173,10 @@ fun_type -> '(' top_types ')' '->' top_type map_pair_types -> map_pair_type : ['$1']. map_pair_types -> map_pair_type ',' map_pair_types : ['$1'|'$3']. map_pair_type -> top_type '=>' top_type : {type, ?anno('$2'), map_field_assoc,['$1','$3']}. +map_pair_type -> top_type ':=' top_type : {type, ?anno('$2'), map_field_exact,['$1','$3']}. +map_pair_type -> '...' : {type, ?anno('$1'), map_field_assoc, + [{type, ?anno('$1'), any, []}, + {type, ?anno('$1'), any, []}]}. field_types -> field_type : ['$1']. field_types -> field_type ',' field_types : ['$1'|'$3']. |