Commit 97ea82a0 authored by Kim Nguyễn's avatar Kim Nguyễn
Browse files

Fix a bug in the parser for toplevel let in expressions.

parent bb44b218
......@@ -172,8 +172,8 @@ let mk_app_pat loc var l =
%nonassoc "|"
%nonassoc below_SEMI
%nonassoc ";"
%nonassoc "let" "namespace"
%nonassoc ";;"
//%nonassoc "let" "namespace"
//%nonassoc ";;"
%right ":="
%nonassoc "ref"
%right "from" "where" "and"
......@@ -234,18 +234,18 @@ prog:
;
%inline opt_prog_expr:
l = iloption(multi_expr) { match l with
[] -> []
| e :: _ -> [ mk $sloc (EvalStatement e) ]
{ [] }
| e = multi_expr {
[ mk $sloc (EvalStatement e) ]
}
;
prog_items:
";;" e = opt_prog_expr { e }
| p = prog_item { p }
%inline prog_items:
";;" e = opt_prog_expr
| e = prog_item { e }
;
prog_item:
%inline prog_item:
| item = loc(prog_item_) { [item] }
| "include" items = RESOLVED_INCLUDE { items }
| HASH_ASCII | HASH_LATIN1 | HASH_UTF8
......@@ -696,7 +696,7 @@ namespace_binding_rem:
| {`Empty}
;
let_binding:
%inline let_binding:
| "let" "fun" f = located_ident poly = poly_list "(" fd = fun_decl_after_lpar
| "let" f = located_ident poly = poly_list "(" fd = fun_decl_after_lpar {
let p = mk $sloc (PatVar ([ snd f ],[])) in
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment