Fixed the stratification of "++".
This commit is contained in:
parent
e9c36f1688
commit
dadf1fbe41
@ -320,6 +320,8 @@ core_pattern:
|
|||||||
| "_" { PWild $1 }
|
| "_" { PWild $1 }
|
||||||
| unit { PUnit $1 }
|
| unit { PUnit $1 }
|
||||||
| "<int>" { PInt $1 }
|
| "<int>" { PInt $1 }
|
||||||
|
| "<nat>" { PNat $1 }
|
||||||
|
| "<bytes>" { PBytes $1 }
|
||||||
| "true" { PTrue $1 }
|
| "true" { PTrue $1 }
|
||||||
| "false" { PFalse $1 }
|
| "false" { PFalse $1 }
|
||||||
| "<string>" { PString $1 }
|
| "<string>" { PString $1 }
|
||||||
@ -424,7 +426,8 @@ fun_expr:
|
|||||||
{p.value with inside = arg_to_pattern p.value.inside}
|
{p.value with inside = arg_to_pattern p.value.inside}
|
||||||
in PPar {p with value}
|
in PPar {p with value}
|
||||||
| EUnit u -> PUnit u
|
| EUnit u -> PUnit u
|
||||||
| e -> raise (SyntaxError.Error (WrongFunctionArguments e))
|
| e -> let open! SyntaxError
|
||||||
|
in raise (Error (WrongFunctionArguments e))
|
||||||
in
|
in
|
||||||
let fun_args_to_pattern = function
|
let fun_args_to_pattern = function
|
||||||
EAnnot {
|
EAnnot {
|
||||||
@ -453,7 +456,8 @@ fun_expr:
|
|||||||
in arg_to_pattern (fst fun_args), bindings
|
in arg_to_pattern (fst fun_args), bindings
|
||||||
| EUnit e ->
|
| EUnit e ->
|
||||||
arg_to_pattern (EUnit e), []
|
arg_to_pattern (EUnit e), []
|
||||||
| e -> raise (SyntaxError.Error (WrongFunctionArguments e))
|
| e -> let open! SyntaxError
|
||||||
|
in raise (Error (WrongFunctionArguments e))
|
||||||
in
|
in
|
||||||
let binders = fun_args_to_pattern $1 in
|
let binders = fun_args_to_pattern $1 in
|
||||||
let f = {kwd_fun;
|
let f = {kwd_fun;
|
||||||
@ -601,7 +605,7 @@ comp_expr_level:
|
|||||||
| cat_expr_level { $1 }
|
| cat_expr_level { $1 }
|
||||||
|
|
||||||
cat_expr_level:
|
cat_expr_level:
|
||||||
bin_op(add_expr_level, "++", add_expr_level) { EString (Cat $1) }
|
bin_op(add_expr_level, "++", cat_expr_level) { EString (Cat $1) }
|
||||||
| add_expr_level { $1 }
|
| add_expr_level { $1 }
|
||||||
|
|
||||||
add_expr_level:
|
add_expr_level:
|
||||||
@ -682,6 +686,7 @@ common_expr:
|
|||||||
"<int>" { EArith (Int $1) }
|
"<int>" { EArith (Int $1) }
|
||||||
| "<mutez>" { EArith (Mutez $1) }
|
| "<mutez>" { EArith (Mutez $1) }
|
||||||
| "<nat>" { EArith (Nat $1) }
|
| "<nat>" { EArith (Nat $1) }
|
||||||
|
| "<bytes>" { EBytes $1 }
|
||||||
| "<ident>" | module_field { EVar $1 }
|
| "<ident>" | module_field { EVar $1 }
|
||||||
| projection { EProj $1 }
|
| projection { EProj $1 }
|
||||||
| "<string>" { EString (String $1) }
|
| "<string>" { EString (String $1) }
|
||||||
|
Loading…
Reference in New Issue
Block a user