aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edoc/src/edoc_parser.yrl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2016-06-08 12:14:21 +0200
committerHans Bolinder <[email protected]>2016-06-08 12:43:35 +0200
commit5e7542d6f7cd1964839f6214915c7f9b7d7f8866 (patch)
treeba277c79284ef266a220097b45f8ab4a9005c25a /lib/edoc/src/edoc_parser.yrl
parent39c6338a1b671a98cc2c8d21e9ba373816e5071a (diff)
downloadotp-5e7542d6f7cd1964839f6214915c7f9b7d7f8866.tar.gz
otp-5e7542d6f7cd1964839f6214915c7f9b7d7f8866.tar.bz2
otp-5e7542d6f7cd1964839f6214915c7f9b7d7f8866.zip
edoc: Fix new Maps syntax
Diffstat (limited to 'lib/edoc/src/edoc_parser.yrl')
-rw-r--r--lib/edoc/src/edoc_parser.yrl17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/edoc/src/edoc_parser.yrl b/lib/edoc/src/edoc_parser.yrl
index 835e7ccaa6..983e2f8496 100644
--- a/lib/edoc/src/edoc_parser.yrl
+++ b/lib/edoc/src/edoc_parser.yrl
@@ -36,8 +36,8 @@ Terminals
atom float integer var an_var string start_spec start_typedef start_throws
start_ref
-'(' ')' ',' '.' '=>' '->' '{' '}' '[' ']' '|' '+' ':' '::' '=' '/' '//' '*'
-'#' 'where' '<<' '>>' '..' '...'.
+'(' ')' ',' '.' '=>' ':=' '->' '{' '}' '[' ']' '|' '+' ':' '::' '=' '/' '//'
+'*' '#' 'where' '<<' '>>' '..' '...'.
Rootsymbol start.
@@ -76,7 +76,15 @@ utype_map_fields -> '$empty' : [].
utype_map_fields -> utype_map_field : ['$1'].
utype_map_fields -> utype_map_fields ',' utype_map_field : ['$3' | '$1'].
-utype_map_field -> utype '=>' utype : #t_map_field{ k_type = '$1', v_type = '$3'}.
+utype_map_field -> utype '=>' utype : #t_map_field{assoc_type = assoc,
+ k_type = '$1',
+ v_type = '$3'}.
+utype_map_field -> utype ':=' utype : #t_map_field{assoc_type = exact,
+ k_type = '$1',
+ v_type = '$3'}.
+utype_map_field -> '...' : #t_map_field{assoc_type = assoc,
+ k_type = any(),
+ v_type = any()}.
utype_tuple -> '{' utypes '}' : lists:reverse('$2').
@@ -346,6 +354,9 @@ all_vars([#t_var{} | As]) ->
all_vars(As) ->
As =:= [].
+any() ->
+ #t_type{name = #t_name{name = any}, args = []}.
+
%% ---------------------------------------------------------------------
%% @doc EDoc type specification parsing. Parses the content of