diff options
author | Alain Frisch <alain@frisch.fr> | 2014-10-14 15:51:30 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2014-10-14 15:51:30 +0000 |
commit | e3ad818fb5f8ddc7b477779a6da69ccac0f00f4f (patch) | |
tree | 9016f709d251804278be1a75f518787aa571904b /parsing/parser.mly | |
parent | a4e637ea622cf33b4c0870a98c6b1db0090f8e38 (diff) | |
parent | 8da19ea098b270230a9f1e1d252350bd69cbf8ee (diff) |
Reintegrate-merge constructors_with_record5 branch.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15556 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'parsing/parser.mly')
-rw-r--r-- | parsing/parser.mly | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/parsing/parser.mly b/parsing/parser.mly index 4e2053be3..26bbdc1e9 100644 --- a/parsing/parser.mly +++ b/parsing/parser.mly @@ -1658,16 +1658,18 @@ sig_exception_declaration: } ; generalized_constructor_arguments: - /*empty*/ { ([],None) } - | OF core_type_list { (List.rev $2,None) } - | COLON core_type_list MINUSGREATER simple_core_type - { (List.rev $2,Some $4) } + /*empty*/ { (Pcstr_tuple [],None) } + | OF constructor_arguments { ($2,None) } + | COLON constructor_arguments MINUSGREATER simple_core_type + { ($2,Some $4) } | COLON simple_core_type - { ([],Some $2) } + { (Pcstr_tuple [],Some $2) } ; - - +constructor_arguments: + | core_type_list { Pcstr_tuple (List.rev $1) } + | LBRACE label_declarations RBRACE { Pcstr_record (List.rev $2) } +; label_declarations: label_declaration { [$1] } | label_declarations SEMI label_declaration { $3 :: $1 } |