diff options
author | Hans Bolinder <[email protected]> | 2016-04-18 10:31:18 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2016-04-28 16:16:11 +0200 |
commit | c693869484d5716b0d522aa01d54458722bb9c18 (patch) | |
tree | ccf53b957e46c385f77f586ba64b7d27d6086ae6 | |
parent | 8631b1adfd54b8cc8d38b0853a4c6502aa7100e5 (diff) | |
download | otp-c693869484d5716b0d522aa01d54458722bb9c18.tar.gz otp-c693869484d5716b0d522aa01d54458722bb9c18.tar.bz2 otp-c693869484d5716b0d522aa01d54458722bb9c18.zip |
stdlib: Correct association types
'...' is allowed at the end of of association types.
-rw-r--r-- | lib/stdlib/src/erl_parse.yrl | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl index 6d84f82713..a896de4f1c 100644 --- a/lib/stdlib/src/erl_parse.yrl +++ b/lib/stdlib/src/erl_parse.yrl @@ -170,13 +170,16 @@ fun_type -> '(' top_types ')' '->' top_type : {type, ?anno('$1'), 'fun', [{type, ?anno('$1'), product, '$2'},'$5']}. +map_pair_types -> '...' : [{type, ?anno('$1'), map_field_assoc, + [{type, ?anno('$1'), any, []}, + {type, ?anno('$1'), any, []}]}]. 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, []}]}. + +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']}. field_types -> field_type : ['$1']. field_types -> field_type ',' field_types : ['$1'|'$3']. @@ -814,7 +817,8 @@ Erlang code. | {'type', anno(), 'map', [af_map_pair_type()]}. -type af_map_pair_type() :: - {'type', anno(), 'map_field_assoc', [abstract_type()]}. + {'type', anno(), 'map_field_assoc', [abstract_type()]} + | {'type', anno(), 'map_field_exact', [abstract_type()]}. -type af_predefined_type() :: {'type', anno(), type_name(), [abstract_type()]}. |