From 9e072eea6279245462891eddf8ac8fc03d365ff9 Mon Sep 17 00:00:00 2001 From: Damien Doligez Date: Fri, 21 Jan 2000 19:01:39 +0000 Subject: [PATCH] quelques conflits de moins git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2763 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- parsing/parser.mly | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/parsing/parser.mly b/parsing/parser.mly index 9bd4de060..0442c59f3 100644 --- a/parsing/parser.mly +++ b/parsing/parser.mly @@ -698,7 +698,7 @@ label_simple_pattern: { ($1, mkpat(Ppat_var $1)) } ; expr: - simple_expr + simple_expr %prec SHARP { $1 } | simple_expr simple_labeled_expr_list %prec prec_appl { mkexp(Pexp_apply($1, List.rev $2)) } @@ -720,7 +720,7 @@ expr: { mkexp(Pexp_try($2, List.rev $5)) } | TRY seq_expr WITH error %prec prec_try { syntax_error() } - | expr_comma_list + | expr_comma_list %prec COMMA { mkexp(Pexp_tuple(List.rev $1)) } | constr_longident simple_expr %prec prec_constr_appl { mkexp(Pexp_construct($1, Some $2, false)) } @@ -810,6 +810,8 @@ simple_expr: { unclosed "(" 1 ")" 3 } | BEGIN seq_expr END { $2 } + | BEGIN END + { mkexp (Pexp_ident (Lident "()")) } | BEGIN seq_expr error { unclosed "begin" 1 "end" 3 } | LPAREN seq_expr type_constraint RPAREN @@ -1337,7 +1339,7 @@ val_longident: | mod_longident DOT val_ident { Ldot($1, $3) } ; constr_longident: - mod_longident { $1 } + mod_longident %prec DOT { $1 } | LBRACKET RBRACKET { Lident "[]" } | LPAREN RPAREN { Lident "()" } | FALSE { Lident "false" }