Merged first changes towards handling comments. Refactoring.

This commit is contained in:
Christian Rinderknecht 2020-06-23 11:52:39 +02:00
parent 3ec21a8762
commit d34b345edc
10 changed files with 441 additions and 372 deletions

View File

@ -142,7 +142,9 @@ type_decl:
terminator = $5} terminator = $5}
in {region; value} } in {region; value} }
type_expr_colon: ":" type_expr { $1,$2 } type_annot:
":" type_expr { $1,$2 }
type_expr: type_expr:
fun_type | sum_type | record_type { $1 } fun_type | sum_type | record_type { $1 }
@ -240,7 +242,7 @@ field_decl:
fun_expr: fun_expr:
"function" parameters type_expr_colon? "is" expr { "function" parameters type_annot? "is" expr {
let stop = expr_to_region $5 in let stop = expr_to_region $5 in
let region = cover $1 stop let region = cover $1 stop
and value = {kwd_function = $1; and value = {kwd_function = $1;
@ -253,7 +255,7 @@ fun_expr:
(* Function declarations *) (* Function declarations *)
open_fun_decl: open_fun_decl:
ioption ("recursive") "function" fun_name parameters type_expr_colon? "is" ioption ("recursive") "function" fun_name parameters type_annot? "is"
block "with" expr { block "with" expr {
Scoping.check_reserved_name $3; Scoping.check_reserved_name $3;
let stop = expr_to_region $9 in let stop = expr_to_region $9 in
@ -270,7 +272,7 @@ open_fun_decl:
attributes = None} attributes = None}
in {region; value} in {region; value}
} }
| ioption ("recursive") "function" fun_name parameters type_expr_colon? "is" | ioption ("recursive") "function" fun_name parameters type_annot? "is"
expr { expr {
Scoping.check_reserved_name $3; Scoping.check_reserved_name $3;
let stop = expr_to_region $7 in let stop = expr_to_region $7 in
@ -372,7 +374,7 @@ open_var_decl:
in {region; value} } in {region; value} }
unqualified_decl(OP): unqualified_decl(OP):
var type_expr_colon? OP expr { var type_annot? OP expr {
Scoping.check_reserved_name $1; Scoping.check_reserved_name $1;
let region = expr_to_region $4 let region = expr_to_region $4
in $1, $2, $3, $4, region } in $1, $2, $3, $4, region }
@ -610,28 +612,17 @@ while_loop:
in While {region; value} } in While {region; value} }
for_loop: for_loop:
"for" var ":=" expr "to" expr block { "for" var ":=" expr "to" expr step_clause? block {
let region = cover $1 $7.region in Scoping.check_reserved_name $2;
let region = cover $1 $8.region in
let value = {kwd_for = $1; let value = {kwd_for = $1;
binder = $2; binder = $2;
assign = $3; assign = $3;
init = $4; init = $4;
kwd_to = $5; kwd_to = $5;
bound = $6; bound = $6;
step = None; step = $7;
block = $7} block = $8}
in For (ForInt {region; value})
}
| "for" var ":=" expr "to" expr "step" expr block {
let region = cover $1 $9.region in
let value = {kwd_for = $1;
binder = $2;
assign = $3;
init = $4;
kwd_to = $5;
bound = $6;
step = Some ($7, $8);
block = $9}
in For (ForInt {region; value}) in For (ForInt {region; value})
} }
| "for" var arrow_clause? "in" collection expr block { | "for" var arrow_clause? "in" collection expr block {
@ -646,6 +637,9 @@ for_loop:
block = $7} block = $7}
in For (ForCollect {region; value}) } in For (ForCollect {region; value}) }
step_clause:
"step" expr { $1,$2 }
collection: collection:
"map" { Map $1 } "map" { Map $1 }
| "set" { Set $1 } | "set" { Set $1 }

View File

@ -64,7 +64,7 @@ let print_sepseq :
None -> () None -> ()
| Some seq -> print_nsepseq state sep print seq | Some seq -> print_nsepseq state sep print seq
let print_option : state -> (state -> 'a -> unit ) -> 'a option -> unit = let print_option : state -> (state -> 'a -> unit) -> 'a option -> unit =
fun state print -> function fun state print -> function
None -> () None -> ()
| Some opt -> print state opt | Some opt -> print state opt
@ -141,7 +141,7 @@ and print_const_decl state {value; _} =
equal; init; terminator; _} = value in equal; init; terminator; _} = value in
print_token state kwd_const "const"; print_token state kwd_const "const";
print_var state name; print_var state name;
print_option state print_colon_type_expr const_type; print_option state print_type_annot const_type;
print_token state equal "="; print_token state equal "=";
print_expr state init; print_expr state init;
print_terminator state terminator print_terminator state terminator
@ -165,7 +165,7 @@ and print_type_expr state = function
| TVar type_var -> print_var state type_var | TVar type_var -> print_var state type_var
| TString str -> print_string state str | TString str -> print_string state str
and print_colon_type_expr state (colon, type_expr) = and print_type_annot state (colon, type_expr) =
print_token state colon ":"; print_token state colon ":";
print_type_expr state type_expr; print_type_expr state type_expr;
@ -223,7 +223,7 @@ and print_fun_decl state {value; _} =
print_token state kwd_function "function"; print_token state kwd_function "function";
print_var state fun_name; print_var state fun_name;
print_parameters state param; print_parameters state param;
print_option state print_colon_type_expr ret_type; print_option state print_type_annot ret_type;
print_token state kwd_is "is"; print_token state kwd_is "is";
(match block_with with (match block_with with
None -> () None -> ()
@ -238,7 +238,7 @@ and print_fun_expr state {value; _} =
ret_type; kwd_is; return} : fun_expr = value in ret_type; kwd_is; return} : fun_expr = value in
print_token state kwd_function "function"; print_token state kwd_function "function";
print_parameters state param; print_parameters state param;
print_option state print_colon_type_expr ret_type; print_option state print_type_annot ret_type;
print_token state kwd_is "is"; print_token state kwd_is "is";
print_expr state return print_expr state return
@ -266,13 +266,13 @@ and print_param_const state {value; _} =
let {kwd_const; var; param_type} = value in let {kwd_const; var; param_type} = value in
print_token state kwd_const "const"; print_token state kwd_const "const";
print_var state var; print_var state var;
print_option state print_colon_type_expr param_type print_option state print_type_annot param_type
and print_param_var state {value; _} = and print_param_var state {value; _} =
let {kwd_var; var; param_type} = value in let {kwd_var; var; param_type} = value in
print_token state kwd_var "var"; print_token state kwd_var "var";
print_var state var; print_var state var;
print_option state print_colon_type_expr param_type print_option state print_type_annot param_type
and print_block state block = and print_block state block =
let {enclosing; statements; terminator} = block.value in let {enclosing; statements; terminator} = block.value in
@ -299,7 +299,7 @@ and print_var_decl state {value; _} =
assign; init; terminator} = value in assign; init; terminator} = value in
print_token state kwd_var "var"; print_token state kwd_var "var";
print_var state name; print_var state name;
print_option state print_colon_type_expr var_type; print_option state print_type_annot var_type;
print_token state assign ":="; print_token state assign ":=";
print_expr state init; print_expr state init;
print_terminator state terminator print_terminator state terminator
@ -917,43 +917,59 @@ and pp_declaration state = function
and pp_attr_decl state = pp_ne_injection pp_string state and pp_attr_decl state = pp_ne_injection pp_string state
and pp_fun_decl state decl = and pp_fun_decl state decl =
let arity, start = let kwd_recursive = if decl.kwd_recursive = None then 0 else 1 in
let ret_type = if decl.ret_type = None then 0 else 1 in
let block_with = if decl.block_with = None then 0 else 1 in
let arity = kwd_recursive + ret_type + block_with + 3 in
let index = 0 in
let index =
match decl.kwd_recursive with match decl.kwd_recursive with
None -> 5,0 None -> index
| Some _ -> | Some _ -> let state = state#pad arity index in
let state = state#pad 6 0 in pp_node state "recursive";
let () = pp_node state "recursive" index + 1 in
in 6,1 in let index =
let () = let state = state#pad arity index in
let state = state#pad arity start in pp_ident state decl.fun_name;
pp_ident state decl.fun_name in index + 1 in
let () = let index =
let state = state#pad arity (start + 1) in let state = state#pad arity index in
pp_node state "<parameters>"; pp_node state "<parameters>";
pp_parameters state decl.param in pp_parameters state decl.param;
let () = index + 1 in
let state = state#pad arity (start + 2) in let index =
match decl.ret_type with
None -> index
| Some (_, t_expr) ->
let state = state#pad arity index in
pp_node state "<return type>"; pp_node state "<return type>";
print_option (state#pad 1 0) pp_type_expr @@ Option.map snd decl.ret_type in pp_type_expr (state#pad 1 0) t_expr;
let () = index+1 in
let state = state#pad arity (start + 3) in let index =
pp_node state "<body>";
let statements =
match decl.block_with with match decl.block_with with
Some (block,_) -> block.value.statements None -> index
| None -> Instr (Skip Region.ghost), [] in | Some (block,_) ->
pp_statements state statements in let statements = block.value.statements in
let state = state#pad arity index in
pp_node state "<body>";
pp_statements state statements;
index+1 in
let () = let () =
let state = state#pad arity (start + 4) in let state = state#pad arity index in
pp_node state "<return>"; pp_node state "<return>";
pp_expr (state#pad 1 0) decl.return pp_expr (state#pad 1 0) decl.return
in () in ()
and pp_const_decl state decl = and pp_const_decl state decl =
let arity = 3 in let arity = if decl.const_type = None then 2 else 3 in
pp_ident (state#pad arity 0) decl.name; let index = 0 in
print_option (state#pad arity 1) pp_type_expr @@ Option.map snd decl.const_type; let index =
pp_expr (state#pad arity 2) decl.init pp_ident (state#pad arity 0) decl.name; index+1 in
let index =
pp_type_annot (state#pad arity index) index decl.const_type in
let () =
pp_expr (state#pad arity index) decl.init
in ()
and pp_type_expr state = function and pp_type_expr state = function
TProd cartesian -> TProd cartesian ->
@ -1014,16 +1030,23 @@ and pp_type_tuple state {value; _} =
in List.iteri (List.length components |> apply) components in List.iteri (List.length components |> apply) components
and pp_fun_expr state (expr: fun_expr) = and pp_fun_expr state (expr: fun_expr) =
let () = let arity = if expr.ret_type = None then 2 else 3 in
let state = state#pad 3 0 in let index = 0 in
let index =
let state = state#pad arity index in
pp_node state "<parameters>"; pp_node state "<parameters>";
pp_parameters state expr.param in pp_parameters state expr.param;
let () = index + 1 in
let state = state#pad 3 1 in let index =
match expr.ret_type with
None -> index
| Some (_, t_expr) ->
let state = state#pad arity index in
pp_node state "<return type>"; pp_node state "<return type>";
print_option (state#pad 1 0) pp_type_expr @@ Option.map snd expr.ret_type in pp_type_expr (state#pad 1 0) t_expr;
index + 1 in
let () = let () =
let state = state#pad 3 2 in let state = state#pad arity index in
pp_node state "<return>"; pp_node state "<return>";
pp_expr (state#pad 1 0) expr.return pp_expr (state#pad 1 0) expr.return
in () in ()
@ -1047,13 +1070,15 @@ and pp_parameters state {value; _} =
and pp_param_decl state = function and pp_param_decl state = function
ParamConst {value; region} -> ParamConst {value; region} ->
let arity = if value.param_type = None then 1 else 2 in
pp_loc_node state "ParamConst" region; pp_loc_node state "ParamConst" region;
pp_ident (state#pad 2 0) value.var; pp_ident (state#pad arity 0) value.var;
print_option (state#pad 2 1) pp_type_expr @@ Option.map snd value.param_type ignore (pp_type_annot (state#pad arity 1) 1 value.param_type)
| ParamVar {value; region} -> | ParamVar {value; region} ->
let arity = if value.param_type = None then 1 else 2 in
pp_loc_node state "ParamVar" region; pp_loc_node state "ParamVar" region;
pp_ident (state#pad 2 0) value.var; pp_ident (state#pad 2 0) value.var;
print_option (state#pad 2 1) pp_type_expr @@ Option.map snd value.param_type ignore (pp_type_annot (state#pad arity 1) 1 value.param_type)
and pp_statements state statements = and pp_statements state statements =
let statements = Utils.nsepseq_to_list statements in let statements = Utils.nsepseq_to_list statements in
@ -1454,9 +1479,11 @@ and pp_data_decl state = function
pp_fun_decl state value pp_fun_decl state value
and pp_var_decl state decl = and pp_var_decl state decl =
pp_ident (state#pad 3 0) decl.name; let arity = if decl.var_type = None then 2 else 3 in
print_option (state#pad 3 1) pp_type_expr @@ Option.map snd decl.var_type; let index = 0 in
pp_expr (state#pad 3 2) decl.init let index = pp_ident (state#pad arity index) decl.name; index+1 in
let index = pp_type_annot (state#pad arity index) index decl.var_type
in pp_expr (state#pad arity index) decl.init
and pp_expr state = function and pp_expr state = function
ECase {value; region} -> ECase {value; region} ->
@ -1653,3 +1680,7 @@ and pp_bin_op node region state op =
pp_loc_node state node region; pp_loc_node state node region;
pp_expr (state#pad 2 0) op.arg1; pp_expr (state#pad 2 0) op.arg1;
pp_expr (state#pad 2 1) op.arg2 pp_expr (state#pad 2 1) op.arg2
and pp_type_annot state index = function
None -> index
| Some (_, e) -> pp_type_expr state e; index+1

View File

@ -39,12 +39,16 @@ and pp_attr_decl decl = pp_ne_injection pp_string decl
and pp_const_decl {value; _} = and pp_const_decl {value; _} =
let {name; const_type; init; attributes; _} = value in let {name; const_type; init; attributes; _} = value in
let start = string ("const " ^ name.value) in
let t_expr = const_type in
let attr = match attributes with let attr = match attributes with
None -> empty None -> empty
| Some a -> hardline ^^ pp_attr_decl a in | Some a -> hardline ^^ pp_attr_decl a in
group (start ^/^ pp_option (fun (_, d) -> nest 2 (string ": " ^^ pp_type_expr d)) t_expr) let start = string ("const " ^ name.value) in
let start =
match const_type with
None -> start
| Some (_, e) ->
group (start ^/^ nest 2 (string ": " ^^ pp_type_expr e)) in
start
^^ group (break 1 ^^ nest 2 (string "= " ^^ pp_expr init)) ^^ group (break 1 ^^ nest 2 (string "= " ^^ pp_expr init))
^^ attr ^^ attr
@ -128,22 +132,33 @@ and pp_fun_expr {value; _} =
let {param; ret_type; return; _} : fun_expr = value in let {param; ret_type; return; _} : fun_expr = value in
let start = string "function" in let start = string "function" in
let parameters = pp_par pp_parameters param in let parameters = pp_par pp_parameters param in
let expr = pp_expr return in let t_annot =
match ret_type with
None -> empty
| Some (_, e) ->
group (break 1 ^^ nest 2 (string ": " ^^ pp_type_expr e)) in
group (start ^^ nest 2 (break 1 ^^ parameters)) group (start ^^ nest 2 (break 1 ^^ parameters))
^^ pp_option (fun (_,d) -> group (break 1 ^^ nest 2 (string ": " ^^ pp_type_expr d))) ret_type ^^ t_annot
^^ string " is" ^^ group (nest 4 (break 1 ^^ expr)) ^^ string " is" ^^ group (nest 4 (break 1 ^^ pp_expr return))
and pp_fun_decl {value; _} = and pp_fun_decl {value; _} =
let {kwd_recursive; fun_name; param; let {kwd_recursive; fun_name; param; ret_type;
ret_type; block_with; return; attributes; _} = value in block_with; return; attributes; _} = value in
let start = let start =
match kwd_recursive with match kwd_recursive with
None -> string "function" None -> string "function"
| Some _ -> string "recursive" ^/^ string "function" in | Some _ -> string "recursive" ^/^ string "function" in
let start = start ^^ group (break 1 ^^ nest 2 (pp_ident fun_name)) in let start = start ^^ group (break 1 ^^ nest 2 (pp_ident fun_name))
let parameters = pp_par pp_parameters param in and parameters = pp_par pp_parameters param
and t_annot_is =
match ret_type with
None -> string " is"
| Some (_, e) ->
let ret_type = pp_type_expr e in
group (nest 2 (break 1 ^^ string ": " ^^ nest 2 ret_type
^^ string " is"))
and body =
let expr = pp_expr return in let expr = pp_expr return in
let body =
match block_with with match block_with with
None -> group (nest 2 (break 1 ^^ expr)) None -> group (nest 2 (break 1 ^^ expr))
| Some (b,_) -> hardline ^^ pp_block b ^^ string " with" | Some (b,_) -> hardline ^^ pp_block b ^^ string " with"
@ -153,8 +168,9 @@ and pp_fun_decl {value; _} =
None -> empty None -> empty
| Some a -> hardline ^^ pp_attr_decl a in | Some a -> hardline ^^ pp_attr_decl a in
prefix 2 1 start parameters prefix 2 1 start parameters
^^ group (nest 2 (pp_option (fun (_, d) -> break 1 ^^ string ": " ^^ nest 2 (pp_type_expr d)) ret_type ^^ string " is")) ^^ t_annot_is
^^ body ^^ attr ^^ body
^^ attr
and pp_parameters p = pp_nsepseq ";" pp_param_decl p and pp_parameters p = pp_nsepseq ";" pp_param_decl p
@ -164,13 +180,19 @@ and pp_param_decl = function
and pp_param_const {value; _} = and pp_param_const {value; _} =
let {var; param_type; _} : param_const = value in let {var; param_type; _} : param_const = value in
let name = string ("const " ^ var.value) let name = string ("const " ^ var.value) in
in prefix 2 1 name @@ pp_option (fun (_,d) -> string ": " ^^ pp_type_expr d) param_type match param_type with
None -> name
| Some (_, e) ->
prefix 2 1 (name ^^ string " :") (pp_type_expr e)
and pp_param_var {value; _} = and pp_param_var {value; _} =
let {var; param_type; _} : param_var = value in let {var; param_type; _} : param_var = value in
let name = string ("var " ^ var.value) let name = string ("var " ^ var.value) in
in prefix 2 1 name @@ pp_option (fun (_,d) -> string ": " ^^ pp_type_expr d) param_type match param_type with
None -> name
| Some (_, e) ->
prefix 2 1 (name ^^ string " :") (pp_type_expr e)
and pp_block {value; _} = and pp_block {value; _} =
string "block {" string "block {"
@ -192,7 +214,12 @@ and pp_data_decl = function
and pp_var_decl {value; _} = and pp_var_decl {value; _} =
let {name; var_type; init; _} = value in let {name; var_type; init; _} = value in
let start = string ("var " ^ name.value) in let start = string ("var " ^ name.value) in
group (start ^/^ pp_option (fun (_,d) -> nest 2 (string ": " ^^ pp_type_expr d)) var_type) let start =
match const_type with
None -> start
| Some (_, e) ->
group (start ^/^ nest 2 (string ": " ^^ pp_type_expr e)) in
start
^^ group (break 1 ^^ nest 2 (string ":= " ^^ pp_expr init)) ^^ group (break 1 ^^ nest 2 (string ":= " ^^ pp_expr init))
and pp_instruction = function and pp_instruction = function

View File

@ -703,10 +703,10 @@ interactive_expr: Function LPAR Const Ident RPAR COLON Ident VBAR
## ##
## Ends in an error in state: 116. ## Ends in an error in state: 116.
## ##
## fun_expr -> Function parameters option(type_expr_colon) . Is expr [ VBAR Type To Then Step SEMI Recursive RPAR RBRACKET RBRACE Of Function From End Else EOF Const COMMA Block Begin Attributes ARROW ] ## fun_expr -> Function parameters option(type_annot) . Is expr [ VBAR Type To Then Step SEMI Recursive RPAR RBRACKET RBRACE Of Function From End Else EOF Const COMMA Block Begin Attributes ARROW ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Function parameters option(type_expr_colon) ## Function parameters option(type_annot)
## ##
## WARNING: This example involves spurious reductions. ## WARNING: This example involves spurious reductions.
## This implies that, although the LR(1) items shown above provide an ## This implies that, although the LR(1) items shown above provide an
@ -716,8 +716,8 @@ interactive_expr: Function LPAR Const Ident RPAR COLON Ident VBAR
## In state 30, spurious reduction of production cartesian -> core_type ## In state 30, spurious reduction of production cartesian -> core_type
## In state 36, spurious reduction of production fun_type -> cartesian ## In state 36, spurious reduction of production fun_type -> cartesian
## In state 44, spurious reduction of production type_expr -> fun_type ## In state 44, spurious reduction of production type_expr -> fun_type
## In state 88, spurious reduction of production type_expr_colon -> COLON type_expr ## In state 88, spurious reduction of production type_annot -> COLON type_expr
## In state 89, spurious reduction of production option(type_expr_colon) -> type_expr_colon ## In state 89, spurious reduction of production option(type_annot) -> type_annot
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
@ -726,10 +726,10 @@ interactive_expr: Function LPAR Const Ident RPAR Is With
## ##
## Ends in an error in state: 117. ## Ends in an error in state: 117.
## ##
## fun_expr -> Function parameters option(type_expr_colon) Is . expr [ VBAR Type To Then Step SEMI Recursive RPAR RBRACKET RBRACE Of Function From End Else EOF Const COMMA Block Begin Attributes ARROW ] ## fun_expr -> Function parameters option(type_annot) Is . expr [ VBAR Type To Then Step SEMI Recursive RPAR RBRACKET RBRACE Of Function From End Else EOF Const COMMA Block Begin Attributes ARROW ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Function parameters option(type_expr_colon) Is ## Function parameters option(type_annot) Is
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
@ -738,7 +738,7 @@ interactive_expr: Function LPAR Const Ident RPAR With
## ##
## Ends in an error in state: 115. ## Ends in an error in state: 115.
## ##
## fun_expr -> Function parameters . option(type_expr_colon) Is expr [ VBAR Type To Then Step SEMI Recursive RPAR RBRACKET RBRACE Of Function From End Else EOF Const COMMA Block Begin Attributes ARROW ] ## fun_expr -> Function parameters . option(type_annot) Is expr [ VBAR Type To Then Step SEMI Recursive RPAR RBRACKET RBRACE Of Function From End Else EOF Const COMMA Block Begin Attributes ARROW ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Function parameters ## Function parameters
@ -857,7 +857,7 @@ interactive_expr: Function With
## ##
## Ends in an error in state: 114. ## Ends in an error in state: 114.
## ##
## fun_expr -> Function . parameters option(type_expr_colon) Is expr [ VBAR Type To Then Step SEMI Recursive RPAR RBRACKET RBRACE Of Function From End Else EOF Const COMMA Block Begin Attributes ARROW ] ## fun_expr -> Function . parameters option(type_annot) Is expr [ VBAR Type To Then Step SEMI Recursive RPAR RBRACKET RBRACE Of Function From End Else EOF Const COMMA Block Begin Attributes ARROW ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Function ## Function
@ -2515,7 +2515,7 @@ interactive_expr: Verbatim TIMES With
interactive_expr: Verbatim VBAR interactive_expr: Verbatim VBAR
## ##
## Ends in an error in state: 601. ## Ends in an error in state: 602.
## ##
## interactive_expr -> expr . EOF [ # ] ## interactive_expr -> expr . EOF [ # ]
## ##
@ -2555,7 +2555,7 @@ interactive_expr: Verbatim With
interactive_expr: With interactive_expr: With
## ##
## Ends in an error in state: 599. ## Ends in an error in state: 600.
## ##
## interactive_expr' -> . interactive_expr [ # ] ## interactive_expr' -> . interactive_expr [ # ]
## ##
@ -2567,7 +2567,7 @@ interactive_expr: With
contract: Attributes LBRACKET String End contract: Attributes LBRACKET String End
## ##
## Ends in an error in state: 545. ## Ends in an error in state: 546.
## ##
## ne_injection(Attributes,String) -> Attributes LBRACKET sep_or_term_list(String,SEMI) . RBRACKET [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## ne_injection(Attributes,String) -> Attributes LBRACKET sep_or_term_list(String,SEMI) . RBRACKET [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
@ -2578,15 +2578,15 @@ contract: Attributes LBRACKET String End
## This implies that, although the LR(1) items shown above provide an ## This implies that, although the LR(1) items shown above provide an
## accurate view of the past (what has been recognized so far), they ## accurate view of the past (what has been recognized so far), they
## may provide an INCOMPLETE view of the future (what was expected next). ## may provide an INCOMPLETE view of the future (what was expected next).
## In state 537, spurious reduction of production nsepseq(String,SEMI) -> String ## In state 538, spurious reduction of production nsepseq(String,SEMI) -> String
## In state 548, spurious reduction of production sep_or_term_list(String,SEMI) -> nsepseq(String,SEMI) ## In state 549, spurious reduction of production sep_or_term_list(String,SEMI) -> nsepseq(String,SEMI)
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
contract: Attributes LBRACKET With contract: Attributes LBRACKET With
## ##
## Ends in an error in state: 544. ## Ends in an error in state: 545.
## ##
## ne_injection(Attributes,String) -> Attributes LBRACKET . sep_or_term_list(String,SEMI) RBRACKET [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## ne_injection(Attributes,String) -> Attributes LBRACKET . sep_or_term_list(String,SEMI) RBRACKET [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
@ -2598,7 +2598,7 @@ contract: Attributes LBRACKET With
contract: Attributes String End Attributes String End SEMI With contract: Attributes String End Attributes String End SEMI With
## ##
## Ends in an error in state: 594. ## Ends in an error in state: 595.
## ##
## seq(declaration) -> declaration . seq(declaration) [ EOF ] ## seq(declaration) -> declaration . seq(declaration) [ EOF ]
## ##
@ -2610,7 +2610,7 @@ contract: Attributes String End Attributes String End SEMI With
contract: Attributes String End SEMI With contract: Attributes String End SEMI With
## ##
## Ends in an error in state: 592. ## Ends in an error in state: 593.
## ##
## nseq(declaration) -> declaration . seq(declaration) [ EOF ] ## nseq(declaration) -> declaration . seq(declaration) [ EOF ]
## ##
@ -2622,7 +2622,7 @@ contract: Attributes String End SEMI With
contract: Attributes String End With contract: Attributes String End With
## ##
## Ends in an error in state: 587. ## Ends in an error in state: 588.
## ##
## attr_decl -> open_attr_decl . option(SEMI) [ Type Recursive Function EOF Const Attributes ] ## attr_decl -> open_attr_decl . option(SEMI) [ Type Recursive Function EOF Const Attributes ]
## ##
@ -2634,7 +2634,7 @@ contract: Attributes String End With
contract: Attributes String RBRACKET contract: Attributes String RBRACKET
## ##
## Ends in an error in state: 549. ## Ends in an error in state: 550.
## ##
## ne_injection(Attributes,String) -> Attributes sep_or_term_list(String,SEMI) . End [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## ne_injection(Attributes,String) -> Attributes sep_or_term_list(String,SEMI) . End [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
@ -2645,15 +2645,15 @@ contract: Attributes String RBRACKET
## This implies that, although the LR(1) items shown above provide an ## This implies that, although the LR(1) items shown above provide an
## accurate view of the past (what has been recognized so far), they ## accurate view of the past (what has been recognized so far), they
## may provide an INCOMPLETE view of the future (what was expected next). ## may provide an INCOMPLETE view of the future (what was expected next).
## In state 537, spurious reduction of production nsepseq(String,SEMI) -> String ## In state 538, spurious reduction of production nsepseq(String,SEMI) -> String
## In state 548, spurious reduction of production sep_or_term_list(String,SEMI) -> nsepseq(String,SEMI) ## In state 549, spurious reduction of production sep_or_term_list(String,SEMI) -> nsepseq(String,SEMI)
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
contract: Attributes String SEMI String SEMI With contract: Attributes String SEMI String SEMI With
## ##
## Ends in an error in state: 540. ## Ends in an error in state: 541.
## ##
## nsepseq(String,SEMI) -> String SEMI . nsepseq(String,SEMI) [ RBRACKET End ] ## nsepseq(String,SEMI) -> String SEMI . nsepseq(String,SEMI) [ RBRACKET End ]
## seq(__anonymous_0(String,SEMI)) -> String SEMI . seq(__anonymous_0(String,SEMI)) [ RBRACKET End ] ## seq(__anonymous_0(String,SEMI)) -> String SEMI . seq(__anonymous_0(String,SEMI)) [ RBRACKET End ]
@ -2666,7 +2666,7 @@ contract: Attributes String SEMI String SEMI With
contract: Attributes String SEMI String With contract: Attributes String SEMI String With
## ##
## Ends in an error in state: 539. ## Ends in an error in state: 540.
## ##
## nsepseq(String,SEMI) -> String . [ RBRACKET End ] ## nsepseq(String,SEMI) -> String . [ RBRACKET End ]
## nsepseq(String,SEMI) -> String . SEMI nsepseq(String,SEMI) [ RBRACKET End ] ## nsepseq(String,SEMI) -> String . SEMI nsepseq(String,SEMI) [ RBRACKET End ]
@ -2680,7 +2680,7 @@ contract: Attributes String SEMI String With
contract: Attributes String SEMI With contract: Attributes String SEMI With
## ##
## Ends in an error in state: 538. ## Ends in an error in state: 539.
## ##
## nsepseq(String,SEMI) -> String SEMI . nsepseq(String,SEMI) [ RBRACKET End ] ## nsepseq(String,SEMI) -> String SEMI . nsepseq(String,SEMI) [ RBRACKET End ]
## nseq(__anonymous_0(String,SEMI)) -> String SEMI . seq(__anonymous_0(String,SEMI)) [ RBRACKET End ] ## nseq(__anonymous_0(String,SEMI)) -> String SEMI . seq(__anonymous_0(String,SEMI)) [ RBRACKET End ]
@ -2693,7 +2693,7 @@ contract: Attributes String SEMI With
contract: Attributes String With contract: Attributes String With
## ##
## Ends in an error in state: 537. ## Ends in an error in state: 538.
## ##
## nsepseq(String,SEMI) -> String . [ RBRACKET End ] ## nsepseq(String,SEMI) -> String . [ RBRACKET End ]
## nsepseq(String,SEMI) -> String . SEMI nsepseq(String,SEMI) [ RBRACKET End ] ## nsepseq(String,SEMI) -> String . SEMI nsepseq(String,SEMI) [ RBRACKET End ]
@ -2707,7 +2707,7 @@ contract: Attributes String With
contract: Attributes With contract: Attributes With
## ##
## Ends in an error in state: 536. ## Ends in an error in state: 537.
## ##
## ne_injection(Attributes,String) -> Attributes . sep_or_term_list(String,SEMI) End [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## ne_injection(Attributes,String) -> Attributes . sep_or_term_list(String,SEMI) End [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ne_injection(Attributes,String) -> Attributes . LBRACKET sep_or_term_list(String,SEMI) RBRACKET [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## ne_injection(Attributes,String) -> Attributes . LBRACKET sep_or_term_list(String,SEMI) RBRACKET [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
@ -2720,12 +2720,12 @@ contract: Attributes With
contract: Const Ident COLON Ident VBAR contract: Const Ident COLON Ident VBAR
## ##
## Ends in an error in state: 491. ## Ends in an error in state: 492.
## ##
## unqualified_decl(EQ) -> Ident option(type_expr_colon) . EQ expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## unqualified_decl(EQ) -> Ident option(type_annot) . EQ expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Ident option(type_expr_colon) ## Ident option(type_annot)
## ##
## WARNING: This example involves spurious reductions. ## WARNING: This example involves spurious reductions.
## This implies that, although the LR(1) items shown above provide an ## This implies that, although the LR(1) items shown above provide an
@ -2735,8 +2735,8 @@ contract: Const Ident COLON Ident VBAR
## In state 30, spurious reduction of production cartesian -> core_type ## In state 30, spurious reduction of production cartesian -> core_type
## In state 36, spurious reduction of production fun_type -> cartesian ## In state 36, spurious reduction of production fun_type -> cartesian
## In state 44, spurious reduction of production type_expr -> fun_type ## In state 44, spurious reduction of production type_expr -> fun_type
## In state 88, spurious reduction of production type_expr_colon -> COLON type_expr ## In state 88, spurious reduction of production type_annot -> COLON type_expr
## In state 89, spurious reduction of production option(type_expr_colon) -> type_expr_colon ## In state 89, spurious reduction of production option(type_annot) -> type_annot
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
@ -2745,7 +2745,7 @@ contract: Const Ident COLON With
## ##
## Ends in an error in state: 87. ## Ends in an error in state: 87.
## ##
## type_expr_colon -> COLON . type_expr [ Is EQ ASS ] ## type_annot -> COLON . type_expr [ Is EQ ASS ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## COLON ## COLON
@ -2755,7 +2755,7 @@ contract: Const Ident COLON With
contract: Const Ident EQ Bytes VBAR contract: Const Ident EQ Bytes VBAR
## ##
## Ends in an error in state: 585. ## Ends in an error in state: 586.
## ##
## const_decl -> open_const_decl . option(SEMI) [ Type Recursive Function EOF Const Attributes ] ## const_decl -> open_const_decl . option(SEMI) [ Type Recursive Function EOF Const Attributes ]
## ##
@ -2776,29 +2776,29 @@ contract: Const Ident EQ Bytes VBAR
## In state 147, spurious reduction of production conj_expr -> set_membership ## In state 147, spurious reduction of production conj_expr -> set_membership
## In state 228, spurious reduction of production disj_expr -> conj_expr ## In state 228, spurious reduction of production disj_expr -> conj_expr
## In state 196, spurious reduction of production expr -> disj_expr ## In state 196, spurious reduction of production expr -> disj_expr
## In state 493, spurious reduction of production unqualified_decl(EQ) -> Ident option(type_expr_colon) EQ expr ## In state 494, spurious reduction of production unqualified_decl(EQ) -> Ident option(type_annot) EQ expr
## In state 494, spurious reduction of production open_const_decl -> Const unqualified_decl(EQ) ## In state 495, spurious reduction of production open_const_decl -> Const unqualified_decl(EQ)
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
contract: Const Ident EQ With contract: Const Ident EQ With
## ##
## Ends in an error in state: 492. ## Ends in an error in state: 493.
## ##
## unqualified_decl(EQ) -> Ident option(type_expr_colon) EQ . expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## unqualified_decl(EQ) -> Ident option(type_annot) EQ . expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Ident option(type_expr_colon) EQ ## Ident option(type_annot) EQ
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
contract: Const Ident With contract: Const Ident With
## ##
## Ends in an error in state: 490. ## Ends in an error in state: 491.
## ##
## unqualified_decl(EQ) -> Ident . option(type_expr_colon) EQ expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## unqualified_decl(EQ) -> Ident . option(type_annot) EQ expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Ident ## Ident
@ -2808,7 +2808,7 @@ contract: Const Ident With
contract: Const With contract: Const With
## ##
## Ends in an error in state: 489. ## Ends in an error in state: 490.
## ##
## open_const_decl -> Const . unqualified_decl(EQ) [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_const_decl -> Const . unqualified_decl(EQ) [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
@ -2822,11 +2822,11 @@ contract: Function Ident LPAR Const Ident RPAR COLON Ident VBAR
## ##
## Ends in an error in state: 461. ## Ends in an error in state: 461.
## ##
## open_fun_decl -> Function Ident parameters option(type_expr_colon) . Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Function Ident parameters option(type_annot) . Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## open_fun_decl -> Function Ident parameters option(type_expr_colon) . Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Function Ident parameters option(type_annot) . Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Function Ident parameters option(type_expr_colon) ## Function Ident parameters option(type_annot)
## ##
## WARNING: This example involves spurious reductions. ## WARNING: This example involves spurious reductions.
## This implies that, although the LR(1) items shown above provide an ## This implies that, although the LR(1) items shown above provide an
@ -2836,15 +2836,15 @@ contract: Function Ident LPAR Const Ident RPAR COLON Ident VBAR
## In state 30, spurious reduction of production cartesian -> core_type ## In state 30, spurious reduction of production cartesian -> core_type
## In state 36, spurious reduction of production fun_type -> cartesian ## In state 36, spurious reduction of production fun_type -> cartesian
## In state 44, spurious reduction of production type_expr -> fun_type ## In state 44, spurious reduction of production type_expr -> fun_type
## In state 88, spurious reduction of production type_expr_colon -> COLON type_expr ## In state 88, spurious reduction of production type_annot -> COLON type_expr
## In state 89, spurious reduction of production option(type_expr_colon) -> type_expr_colon ## In state 89, spurious reduction of production option(type_annot) -> type_annot
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of LBRACKET VBAR Block contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of LBRACKET VBAR Block
## ##
## Ends in an error in state: 499. ## Ends in an error in state: 500.
## ##
## case(if_clause) -> Case expr Of LBRACKET option(VBAR) . cases(if_clause) RBRACKET [ VBAR SEMI RBRACKET RBRACE End Else ] ## case(if_clause) -> Case expr Of LBRACKET option(VBAR) . cases(if_clause) RBRACKET [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -2856,7 +2856,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of LBRACKE
contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of LBRACKET WILD ARROW Skip End contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of LBRACKET WILD ARROW Skip End
## ##
## Ends in an error in state: 528. ## Ends in an error in state: 529.
## ##
## case(if_clause) -> Case expr Of LBRACKET option(VBAR) cases(if_clause) . RBRACKET [ VBAR SEMI RBRACKET RBRACE End Else ] ## case(if_clause) -> Case expr Of LBRACKET option(VBAR) cases(if_clause) . RBRACKET [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -2867,15 +2867,15 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of LBRACKE
## This implies that, although the LR(1) items shown above provide an ## This implies that, although the LR(1) items shown above provide an
## accurate view of the past (what has been recognized so far), they ## accurate view of the past (what has been recognized so far), they
## may provide an INCOMPLETE view of the future (what was expected next). ## may provide an INCOMPLETE view of the future (what was expected next).
## In state 530, spurious reduction of production nsepseq(case_clause(if_clause),VBAR) -> case_clause(if_clause) ## In state 531, spurious reduction of production nsepseq(case_clause(if_clause),VBAR) -> case_clause(if_clause)
## In state 527, spurious reduction of production cases(if_clause) -> nsepseq(case_clause(if_clause),VBAR) ## In state 528, spurious reduction of production cases(if_clause) -> nsepseq(case_clause(if_clause),VBAR)
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of LBRACKET With contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of LBRACKET With
## ##
## Ends in an error in state: 498. ## Ends in an error in state: 499.
## ##
## case(if_clause) -> Case expr Of LBRACKET . option(VBAR) cases(if_clause) RBRACKET [ VBAR SEMI RBRACKET RBRACE End Else ] ## case(if_clause) -> Case expr Of LBRACKET . option(VBAR) cases(if_clause) RBRACKET [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -2887,7 +2887,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of LBRACKE
contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of VBAR Block contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of VBAR Block
## ##
## Ends in an error in state: 533. ## Ends in an error in state: 534.
## ##
## case(if_clause) -> Case expr Of option(VBAR) . cases(if_clause) End [ VBAR SEMI RBRACKET RBRACE End Else ] ## case(if_clause) -> Case expr Of option(VBAR) . cases(if_clause) End [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -2899,7 +2899,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of VBAR Bl
contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD ARROW Skip RBRACKET contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD ARROW Skip RBRACKET
## ##
## Ends in an error in state: 534. ## Ends in an error in state: 535.
## ##
## case(if_clause) -> Case expr Of option(VBAR) cases(if_clause) . End [ VBAR SEMI RBRACKET RBRACE End Else ] ## case(if_clause) -> Case expr Of option(VBAR) cases(if_clause) . End [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -2910,15 +2910,15 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD AR
## This implies that, although the LR(1) items shown above provide an ## This implies that, although the LR(1) items shown above provide an
## accurate view of the past (what has been recognized so far), they ## accurate view of the past (what has been recognized so far), they
## may provide an INCOMPLETE view of the future (what was expected next). ## may provide an INCOMPLETE view of the future (what was expected next).
## In state 530, spurious reduction of production nsepseq(case_clause(if_clause),VBAR) -> case_clause(if_clause) ## In state 531, spurious reduction of production nsepseq(case_clause(if_clause),VBAR) -> case_clause(if_clause)
## In state 527, spurious reduction of production cases(if_clause) -> nsepseq(case_clause(if_clause),VBAR) ## In state 528, spurious reduction of production cases(if_clause) -> nsepseq(case_clause(if_clause),VBAR)
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD ARROW Skip VBAR With contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD ARROW Skip VBAR With
## ##
## Ends in an error in state: 531. ## Ends in an error in state: 532.
## ##
## nsepseq(case_clause(if_clause),VBAR) -> case_clause(if_clause) VBAR . nsepseq(case_clause(if_clause),VBAR) [ RBRACKET End ] ## nsepseq(case_clause(if_clause),VBAR) -> case_clause(if_clause) VBAR . nsepseq(case_clause(if_clause),VBAR) [ RBRACKET End ]
## ##
@ -2930,7 +2930,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD AR
contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD ARROW Skip With contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD ARROW Skip With
## ##
## Ends in an error in state: 530. ## Ends in an error in state: 531.
## ##
## nsepseq(case_clause(if_clause),VBAR) -> case_clause(if_clause) . [ RBRACKET End ] ## nsepseq(case_clause(if_clause),VBAR) -> case_clause(if_clause) . [ RBRACKET End ]
## nsepseq(case_clause(if_clause),VBAR) -> case_clause(if_clause) . VBAR nsepseq(case_clause(if_clause),VBAR) [ RBRACKET End ] ## nsepseq(case_clause(if_clause),VBAR) -> case_clause(if_clause) . VBAR nsepseq(case_clause(if_clause),VBAR) [ RBRACKET End ]
@ -2943,7 +2943,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD AR
contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD ARROW With contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD ARROW With
## ##
## Ends in an error in state: 501. ## Ends in an error in state: 502.
## ##
## case_clause(if_clause) -> pattern ARROW . if_clause [ VBAR RBRACKET End ] ## case_clause(if_clause) -> pattern ARROW . if_clause [ VBAR RBRACKET End ]
## ##
@ -2955,7 +2955,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD AR
contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD RPAR contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD RPAR
## ##
## Ends in an error in state: 500. ## Ends in an error in state: 501.
## ##
## case_clause(if_clause) -> pattern . ARROW if_clause [ VBAR RBRACKET End ] ## case_clause(if_clause) -> pattern . ARROW if_clause [ VBAR RBRACKET End ]
## ##
@ -2973,7 +2973,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of WILD RP
contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of With contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of With
## ##
## Ends in an error in state: 497. ## Ends in an error in state: 498.
## ##
## case(if_clause) -> Case expr Of . option(VBAR) cases(if_clause) End [ VBAR SEMI RBRACKET RBRACE End Else ] ## case(if_clause) -> Case expr Of . option(VBAR) cases(if_clause) End [ VBAR SEMI RBRACKET RBRACE End Else ]
## case(if_clause) -> Case expr Of . LBRACKET option(VBAR) cases(if_clause) RBRACKET [ VBAR SEMI RBRACKET RBRACE End Else ] ## case(if_clause) -> Case expr Of . LBRACKET option(VBAR) cases(if_clause) RBRACKET [ VBAR SEMI RBRACKET RBRACE End Else ]
@ -2986,7 +2986,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim Of With
contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim VBAR contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim VBAR
## ##
## Ends in an error in state: 496. ## Ends in an error in state: 497.
## ##
## case(if_clause) -> Case expr . Of option(VBAR) cases(if_clause) End [ VBAR SEMI RBRACKET RBRACE End Else ] ## case(if_clause) -> Case expr . Of option(VBAR) cases(if_clause) End [ VBAR SEMI RBRACKET RBRACE End Else ]
## case(if_clause) -> Case expr . Of LBRACKET option(VBAR) cases(if_clause) RBRACKET [ VBAR SEMI RBRACKET RBRACE End Else ] ## case(if_clause) -> Case expr . Of LBRACKET option(VBAR) cases(if_clause) RBRACKET [ VBAR SEMI RBRACKET RBRACE End Else ]
@ -3014,7 +3014,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Case Verbatim VBAR
contract: Function Ident LPAR Const Ident RPAR Is Begin Case With contract: Function Ident LPAR Const Ident RPAR Is Begin Case With
## ##
## Ends in an error in state: 495. ## Ends in an error in state: 496.
## ##
## case(if_clause) -> Case . expr Of option(VBAR) cases(if_clause) End [ VBAR SEMI RBRACKET RBRACE End Else ] ## case(if_clause) -> Case . expr Of option(VBAR) cases(if_clause) End [ VBAR SEMI RBRACKET RBRACE End Else ]
## case(if_clause) -> Case . expr Of LBRACKET option(VBAR) cases(if_clause) RBRACKET [ VBAR SEMI RBRACKET RBRACE End Else ] ## case(if_clause) -> Case . expr Of LBRACKET option(VBAR) cases(if_clause) RBRACKET [ VBAR SEMI RBRACKET RBRACE End Else ]
@ -3027,7 +3027,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Case With
contract: Function Ident LPAR Const Ident RPAR Is Begin Constr DOT And With contract: Function Ident LPAR Const Ident RPAR Is Begin Constr DOT And With
## ##
## Ends in an error in state: 508. ## Ends in an error in state: 509.
## ##
## fun_call -> module_field . arguments [ VBAR SEMI RBRACKET RBRACE End Else ] ## fun_call -> module_field . arguments [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -3039,7 +3039,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Constr DOT And With
contract: Function Ident LPAR Const Ident RPAR Is Begin Constr With contract: Function Ident LPAR Const Ident RPAR Is Begin Constr With
## ##
## Ends in an error in state: 488. ## Ends in an error in state: 489.
## ##
## module_field -> Constr . DOT module_fun [ LPAR ] ## module_field -> Constr . DOT module_fun [ LPAR ]
## projection -> Constr . DOT Ident DOT nsepseq(selection,DOT) [ LBRACKET ASS ] ## projection -> Constr . DOT Ident DOT nsepseq(selection,DOT) [ LBRACKET ASS ]
@ -3052,7 +3052,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Constr With
contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ARROW Ident With contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ARROW Ident With
## ##
## Ends in an error in state: 479. ## Ends in an error in state: 480.
## ##
## for_loop -> For Ident option(arrow_clause) . In collection expr block [ VBAR SEMI RBRACKET RBRACE End Else ] ## for_loop -> For Ident option(arrow_clause) . In collection expr block [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -3064,7 +3064,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ARROW Ident Wi
contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ARROW With contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ARROW With
## ##
## Ends in an error in state: 477. ## Ends in an error in state: 478.
## ##
## arrow_clause -> ARROW . Ident [ In ] ## arrow_clause -> ARROW . Ident [ In ]
## ##
@ -3076,12 +3076,12 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ARROW With
contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ASS Verbatim To Verbatim Step Verbatim VBAR contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ASS Verbatim To Verbatim Step Verbatim VBAR
## ##
## Ends in an error in state: 474. ## Ends in an error in state: 476.
## ##
## for_loop -> For Ident ASS expr To expr Step expr . block [ VBAR SEMI RBRACKET RBRACE End Else ] ## for_loop -> For Ident ASS expr To expr option(step_clause) . block [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## For Ident ASS expr To expr Step expr ## For Ident ASS expr To expr option(step_clause)
## ##
## WARNING: This example involves spurious reductions. ## WARNING: This example involves spurious reductions.
## This implies that, although the LR(1) items shown above provide an ## This implies that, although the LR(1) items shown above provide an
@ -3097,6 +3097,8 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ASS Verbatim T
## In state 147, spurious reduction of production conj_expr -> set_membership ## In state 147, spurious reduction of production conj_expr -> set_membership
## In state 228, spurious reduction of production disj_expr -> conj_expr ## In state 228, spurious reduction of production disj_expr -> conj_expr
## In state 196, spurious reduction of production expr -> disj_expr ## In state 196, spurious reduction of production expr -> disj_expr
## In state 474, spurious reduction of production step_clause -> Step expr
## In state 475, spurious reduction of production option(step_clause) -> step_clause
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
@ -3105,10 +3107,10 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ASS Verbatim T
## ##
## Ends in an error in state: 473. ## Ends in an error in state: 473.
## ##
## for_loop -> For Ident ASS expr To expr Step . expr block [ VBAR SEMI RBRACKET RBRACE End Else ] ## step_clause -> Step . expr [ Block Begin ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## For Ident ASS expr To expr Step ## Step
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
@ -3117,8 +3119,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ASS Verbatim T
## ##
## Ends in an error in state: 472. ## Ends in an error in state: 472.
## ##
## for_loop -> For Ident ASS expr To expr . block [ VBAR SEMI RBRACKET RBRACE End Else ] ## for_loop -> For Ident ASS expr To expr . option(step_clause) block [ VBAR SEMI RBRACKET RBRACE End Else ]
## for_loop -> For Ident ASS expr To expr . Step expr block [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## For Ident ASS expr To expr ## For Ident ASS expr To expr
@ -3145,8 +3146,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ASS Verbatim T
## ##
## Ends in an error in state: 471. ## Ends in an error in state: 471.
## ##
## for_loop -> For Ident ASS expr To . expr block [ VBAR SEMI RBRACKET RBRACE End Else ] ## for_loop -> For Ident ASS expr To . expr option(step_clause) block [ VBAR SEMI RBRACKET RBRACE End Else ]
## for_loop -> For Ident ASS expr To . expr Step expr block [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## For Ident ASS expr To ## For Ident ASS expr To
@ -3158,8 +3158,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ASS Verbatim V
## ##
## Ends in an error in state: 470. ## Ends in an error in state: 470.
## ##
## for_loop -> For Ident ASS expr . To expr block [ VBAR SEMI RBRACKET RBRACE End Else ] ## for_loop -> For Ident ASS expr . To expr option(step_clause) block [ VBAR SEMI RBRACKET RBRACE End Else ]
## for_loop -> For Ident ASS expr . To expr Step expr block [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## For Ident ASS expr ## For Ident ASS expr
@ -3186,8 +3185,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ASS With
## ##
## Ends in an error in state: 469. ## Ends in an error in state: 469.
## ##
## for_loop -> For Ident ASS . expr To expr block [ VBAR SEMI RBRACKET RBRACE End Else ] ## for_loop -> For Ident ASS . expr To expr option(step_clause) block [ VBAR SEMI RBRACKET RBRACE End Else ]
## for_loop -> For Ident ASS . expr To expr Step expr block [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## For Ident ASS ## For Ident ASS
@ -3197,7 +3195,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident ASS With
contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident In Set Verbatim VBAR contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident In Set Verbatim VBAR
## ##
## Ends in an error in state: 485. ## Ends in an error in state: 486.
## ##
## for_loop -> For Ident option(arrow_clause) In collection expr . block [ VBAR SEMI RBRACKET RBRACE End Else ] ## for_loop -> For Ident option(arrow_clause) In collection expr . block [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -3224,7 +3222,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident In Set Verbati
contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident In Set With contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident In Set With
## ##
## Ends in an error in state: 484. ## Ends in an error in state: 485.
## ##
## for_loop -> For Ident option(arrow_clause) In collection . expr block [ VBAR SEMI RBRACKET RBRACE End Else ] ## for_loop -> For Ident option(arrow_clause) In collection . expr block [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -3236,7 +3234,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident In Set With
contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident In With contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident In With
## ##
## Ends in an error in state: 480. ## Ends in an error in state: 481.
## ##
## for_loop -> For Ident option(arrow_clause) In . collection expr block [ VBAR SEMI RBRACKET RBRACE End Else ] ## for_loop -> For Ident option(arrow_clause) In . collection expr block [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -3250,8 +3248,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin For Ident With
## ##
## Ends in an error in state: 468. ## Ends in an error in state: 468.
## ##
## for_loop -> For Ident . ASS expr To expr block [ VBAR SEMI RBRACKET RBRACE End Else ] ## for_loop -> For Ident . ASS expr To expr option(step_clause) block [ VBAR SEMI RBRACKET RBRACE End Else ]
## for_loop -> For Ident . ASS expr To expr Step expr block [ VBAR SEMI RBRACKET RBRACE End Else ]
## for_loop -> For Ident . option(arrow_clause) In collection expr block [ VBAR SEMI RBRACKET RBRACE End Else ] ## for_loop -> For Ident . option(arrow_clause) In collection expr block [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
@ -3264,8 +3261,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin For With
## ##
## Ends in an error in state: 467. ## Ends in an error in state: 467.
## ##
## for_loop -> For . Ident ASS expr To expr block [ VBAR SEMI RBRACKET RBRACE End Else ] ## for_loop -> For . Ident ASS expr To expr option(step_clause) block [ VBAR SEMI RBRACKET RBRACE End Else ]
## for_loop -> For . Ident ASS expr To expr Step expr block [ VBAR SEMI RBRACKET RBRACE End Else ]
## for_loop -> For . Ident option(arrow_clause) In collection expr block [ VBAR SEMI RBRACKET RBRACE End Else ] ## for_loop -> For . Ident option(arrow_clause) In collection expr block [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
@ -3276,7 +3272,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin For With
contract: Function Ident LPAR Const Ident RPAR Is Begin Ident ASS With contract: Function Ident LPAR Const Ident RPAR Is Begin Ident ASS With
## ##
## Ends in an error in state: 514. ## Ends in an error in state: 515.
## ##
## assignment -> lhs ASS . rhs [ VBAR SEMI RBRACKET RBRACE End Else ] ## assignment -> lhs ASS . rhs [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -3288,7 +3284,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Ident ASS With
contract: Function Ident LPAR Const Ident RPAR Is Begin Ident DOT Ident With contract: Function Ident LPAR Const Ident RPAR Is Begin Ident DOT Ident With
## ##
## Ends in an error in state: 507. ## Ends in an error in state: 508.
## ##
## lhs -> path . [ ASS ] ## lhs -> path . [ ASS ]
## map_lookup -> path . brackets(expr) [ ASS ] ## map_lookup -> path . brackets(expr) [ ASS ]
@ -3309,7 +3305,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Ident DOT Ident With
contract: Function Ident LPAR Const Ident RPAR Is Begin Ident LBRACKET Bytes RBRACKET With contract: Function Ident LPAR Const Ident RPAR Is Begin Ident LBRACKET Bytes RBRACKET With
## ##
## Ends in an error in state: 513. ## Ends in an error in state: 514.
## ##
## assignment -> lhs . ASS rhs [ VBAR SEMI RBRACKET RBRACE End Else ] ## assignment -> lhs . ASS rhs [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -3335,7 +3331,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Ident With
contract: Function Ident LPAR Const Ident RPAR Is Begin If Verbatim Then LBRACE Skip End contract: Function Ident LPAR Const Ident RPAR Is Begin If Verbatim Then LBRACE Skip End
## ##
## Ends in an error in state: 565. ## Ends in an error in state: 566.
## ##
## clause_block -> LBRACE sep_or_term_list(statement,SEMI) . RBRACE [ VBAR SEMI RBRACKET RBRACE End Else ] ## clause_block -> LBRACE sep_or_term_list(statement,SEMI) . RBRACE [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -3346,8 +3342,8 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin If Verbatim Then LBRACE
## This implies that, although the LR(1) items shown above provide an ## This implies that, although the LR(1) items shown above provide an
## accurate view of the past (what has been recognized so far), they ## accurate view of the past (what has been recognized so far), they
## may provide an INCOMPLETE view of the future (what was expected next). ## may provide an INCOMPLETE view of the future (what was expected next).
## In state 551, spurious reduction of production nsepseq(statement,SEMI) -> statement ## In state 552, spurious reduction of production nsepseq(statement,SEMI) -> statement
## In state 568, spurious reduction of production sep_or_term_list(statement,SEMI) -> nsepseq(statement,SEMI) ## In state 569, spurious reduction of production sep_or_term_list(statement,SEMI) -> nsepseq(statement,SEMI)
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
@ -3366,7 +3362,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin If Verbatim Then LBRACE
contract: Function Ident LPAR Const Ident RPAR Is Begin If Verbatim Then Skip Else With contract: Function Ident LPAR Const Ident RPAR Is Begin If Verbatim Then Skip Else With
## ##
## Ends in an error in state: 571. ## Ends in an error in state: 572.
## ##
## conditional -> If expr Then if_clause option(SEMI) Else . if_clause [ VBAR SEMI RBRACKET RBRACE End Else ] ## conditional -> If expr Then if_clause option(SEMI) Else . if_clause [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -3378,7 +3374,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin If Verbatim Then Skip El
contract: Function Ident LPAR Const Ident RPAR Is Begin If Verbatim Then Skip SEMI EQ contract: Function Ident LPAR Const Ident RPAR Is Begin If Verbatim Then Skip SEMI EQ
## ##
## Ends in an error in state: 570. ## Ends in an error in state: 571.
## ##
## conditional -> If expr Then if_clause option(SEMI) . Else if_clause [ VBAR SEMI RBRACKET RBRACE End Else ] ## conditional -> If expr Then if_clause option(SEMI) . Else if_clause [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -3390,7 +3386,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin If Verbatim Then Skip SE
contract: Function Ident LPAR Const Ident RPAR Is Begin If Verbatim Then Skip With contract: Function Ident LPAR Const Ident RPAR Is Begin If Verbatim Then Skip With
## ##
## Ends in an error in state: 569. ## Ends in an error in state: 570.
## ##
## conditional -> If expr Then if_clause . option(SEMI) Else if_clause [ VBAR SEMI RBRACKET RBRACE End Else ] ## conditional -> If expr Then if_clause . option(SEMI) Else if_clause [ VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -3834,10 +3830,10 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Skip End While
## ##
## Ends in an error in state: 464. ## Ends in an error in state: 464.
## ##
## open_fun_decl -> Function Ident parameters option(type_expr_colon) Is block . With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Function Ident parameters option(type_annot) Is block . With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Function Ident parameters option(type_expr_colon) Is block ## Function Ident parameters option(type_annot) Is block
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
@ -3846,17 +3842,17 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Skip End With With
## ##
## Ends in an error in state: 465. ## Ends in an error in state: 465.
## ##
## open_fun_decl -> Function Ident parameters option(type_expr_colon) Is block With . expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Function Ident parameters option(type_annot) Is block With . expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Function Ident parameters option(type_expr_colon) Is block With ## Function Ident parameters option(type_annot) Is block With
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
contract: Function Ident LPAR Const Ident RPAR Is Begin Skip RBRACE contract: Function Ident LPAR Const Ident RPAR Is Begin Skip RBRACE
## ##
## Ends in an error in state: 573. ## Ends in an error in state: 574.
## ##
## block -> Begin sep_or_term_list(statement,SEMI) . End [ With VBAR SEMI RBRACKET RBRACE End Else ] ## block -> Begin sep_or_term_list(statement,SEMI) . End [ With VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -3867,15 +3863,15 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Skip RBRACE
## This implies that, although the LR(1) items shown above provide an ## This implies that, although the LR(1) items shown above provide an
## accurate view of the past (what has been recognized so far), they ## accurate view of the past (what has been recognized so far), they
## may provide an INCOMPLETE view of the future (what was expected next). ## may provide an INCOMPLETE view of the future (what was expected next).
## In state 551, spurious reduction of production nsepseq(statement,SEMI) -> statement ## In state 552, spurious reduction of production nsepseq(statement,SEMI) -> statement
## In state 568, spurious reduction of production sep_or_term_list(statement,SEMI) -> nsepseq(statement,SEMI) ## In state 569, spurious reduction of production sep_or_term_list(statement,SEMI) -> nsepseq(statement,SEMI)
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
contract: Function Ident LPAR Const Ident RPAR Is Begin Skip SEMI Skip SEMI With contract: Function Ident LPAR Const Ident RPAR Is Begin Skip SEMI Skip SEMI With
## ##
## Ends in an error in state: 554. ## Ends in an error in state: 555.
## ##
## nsepseq(statement,SEMI) -> statement SEMI . nsepseq(statement,SEMI) [ RBRACE End ] ## nsepseq(statement,SEMI) -> statement SEMI . nsepseq(statement,SEMI) [ RBRACE End ]
## seq(__anonymous_0(statement,SEMI)) -> statement SEMI . seq(__anonymous_0(statement,SEMI)) [ RBRACE End ] ## seq(__anonymous_0(statement,SEMI)) -> statement SEMI . seq(__anonymous_0(statement,SEMI)) [ RBRACE End ]
@ -3888,7 +3884,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Skip SEMI Skip SEMI With
contract: Function Ident LPAR Const Ident RPAR Is Begin Skip SEMI Skip With contract: Function Ident LPAR Const Ident RPAR Is Begin Skip SEMI Skip With
## ##
## Ends in an error in state: 553. ## Ends in an error in state: 554.
## ##
## nsepseq(statement,SEMI) -> statement . [ RBRACE End ] ## nsepseq(statement,SEMI) -> statement . [ RBRACE End ]
## nsepseq(statement,SEMI) -> statement . SEMI nsepseq(statement,SEMI) [ RBRACE End ] ## nsepseq(statement,SEMI) -> statement . SEMI nsepseq(statement,SEMI) [ RBRACE End ]
@ -3902,7 +3898,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Skip SEMI Skip With
contract: Function Ident LPAR Const Ident RPAR Is Begin Skip SEMI With contract: Function Ident LPAR Const Ident RPAR Is Begin Skip SEMI With
## ##
## Ends in an error in state: 552. ## Ends in an error in state: 553.
## ##
## nsepseq(statement,SEMI) -> statement SEMI . nsepseq(statement,SEMI) [ RBRACE End ] ## nsepseq(statement,SEMI) -> statement SEMI . nsepseq(statement,SEMI) [ RBRACE End ]
## nseq(__anonymous_0(statement,SEMI)) -> statement SEMI . seq(__anonymous_0(statement,SEMI)) [ RBRACE End ] ## nseq(__anonymous_0(statement,SEMI)) -> statement SEMI . seq(__anonymous_0(statement,SEMI)) [ RBRACE End ]
@ -3915,7 +3911,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Skip SEMI With
contract: Function Ident LPAR Const Ident RPAR Is Begin Skip With contract: Function Ident LPAR Const Ident RPAR Is Begin Skip With
## ##
## Ends in an error in state: 551. ## Ends in an error in state: 552.
## ##
## nsepseq(statement,SEMI) -> statement . [ RBRACE End ] ## nsepseq(statement,SEMI) -> statement . [ RBRACE End ]
## nsepseq(statement,SEMI) -> statement . SEMI nsepseq(statement,SEMI) [ RBRACE End ] ## nsepseq(statement,SEMI) -> statement . SEMI nsepseq(statement,SEMI) [ RBRACE End ]
@ -3931,10 +3927,10 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Var Ident ASS With
## ##
## Ends in an error in state: 418. ## Ends in an error in state: 418.
## ##
## unqualified_decl(ASS) -> Ident option(type_expr_colon) ASS . expr [ SEMI RBRACE End ] ## unqualified_decl(ASS) -> Ident option(type_annot) ASS . expr [ SEMI RBRACE End ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Ident option(type_expr_colon) ASS ## Ident option(type_annot) ASS
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
@ -3943,10 +3939,10 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Var Ident COLON Ident VB
## ##
## Ends in an error in state: 417. ## Ends in an error in state: 417.
## ##
## unqualified_decl(ASS) -> Ident option(type_expr_colon) . ASS expr [ SEMI RBRACE End ] ## unqualified_decl(ASS) -> Ident option(type_annot) . ASS expr [ SEMI RBRACE End ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Ident option(type_expr_colon) ## Ident option(type_annot)
## ##
## WARNING: This example involves spurious reductions. ## WARNING: This example involves spurious reductions.
## This implies that, although the LR(1) items shown above provide an ## This implies that, although the LR(1) items shown above provide an
@ -3956,8 +3952,8 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Var Ident COLON Ident VB
## In state 30, spurious reduction of production cartesian -> core_type ## In state 30, spurious reduction of production cartesian -> core_type
## In state 36, spurious reduction of production fun_type -> cartesian ## In state 36, spurious reduction of production fun_type -> cartesian
## In state 44, spurious reduction of production type_expr -> fun_type ## In state 44, spurious reduction of production type_expr -> fun_type
## In state 88, spurious reduction of production type_expr_colon -> COLON type_expr ## In state 88, spurious reduction of production type_annot -> COLON type_expr
## In state 89, spurious reduction of production option(type_expr_colon) -> type_expr_colon ## In state 89, spurious reduction of production option(type_annot) -> type_annot
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
@ -3966,7 +3962,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin Var Ident With
## ##
## Ends in an error in state: 416. ## Ends in an error in state: 416.
## ##
## unqualified_decl(ASS) -> Ident . option(type_expr_colon) ASS expr [ SEMI RBRACE End ] ## unqualified_decl(ASS) -> Ident . option(type_annot) ASS expr [ SEMI RBRACE End ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Ident ## Ident
@ -4039,7 +4035,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Begin With
contract: Function Ident LPAR Const Ident RPAR Is Block LBRACE Skip End contract: Function Ident LPAR Const Ident RPAR Is Block LBRACE Skip End
## ##
## Ends in an error in state: 576. ## Ends in an error in state: 577.
## ##
## block -> Block LBRACE sep_or_term_list(statement,SEMI) . RBRACE [ With VBAR SEMI RBRACKET RBRACE End Else ] ## block -> Block LBRACE sep_or_term_list(statement,SEMI) . RBRACE [ With VBAR SEMI RBRACKET RBRACE End Else ]
## ##
@ -4050,8 +4046,8 @@ contract: Function Ident LPAR Const Ident RPAR Is Block LBRACE Skip End
## This implies that, although the LR(1) items shown above provide an ## This implies that, although the LR(1) items shown above provide an
## accurate view of the past (what has been recognized so far), they ## accurate view of the past (what has been recognized so far), they
## may provide an INCOMPLETE view of the future (what was expected next). ## may provide an INCOMPLETE view of the future (what was expected next).
## In state 551, spurious reduction of production nsepseq(statement,SEMI) -> statement ## In state 552, spurious reduction of production nsepseq(statement,SEMI) -> statement
## In state 568, spurious reduction of production sep_or_term_list(statement,SEMI) -> nsepseq(statement,SEMI) ## In state 569, spurious reduction of production sep_or_term_list(statement,SEMI) -> nsepseq(statement,SEMI)
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
@ -4082,7 +4078,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Block With
contract: Function Ident LPAR Const Ident RPAR Is Bytes VBAR contract: Function Ident LPAR Const Ident RPAR Is Bytes VBAR
## ##
## Ends in an error in state: 583. ## Ends in an error in state: 584.
## ##
## fun_decl -> open_fun_decl . option(SEMI) [ Type Recursive Function EOF Const Attributes ] ## fun_decl -> open_fun_decl . option(SEMI) [ Type Recursive Function EOF Const Attributes ]
## ##
@ -4103,7 +4099,7 @@ contract: Function Ident LPAR Const Ident RPAR Is Bytes VBAR
## In state 147, spurious reduction of production conj_expr -> set_membership ## In state 147, spurious reduction of production conj_expr -> set_membership
## In state 228, spurious reduction of production disj_expr -> conj_expr ## In state 228, spurious reduction of production disj_expr -> conj_expr
## In state 196, spurious reduction of production expr -> disj_expr ## In state 196, spurious reduction of production expr -> disj_expr
## In state 463, spurious reduction of production open_fun_decl -> Function Ident parameters option(type_expr_colon) Is expr ## In state 463, spurious reduction of production open_fun_decl -> Function Ident parameters option(type_annot) Is expr
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
@ -4112,11 +4108,11 @@ contract: Function Ident LPAR Const Ident RPAR Is With
## ##
## Ends in an error in state: 462. ## Ends in an error in state: 462.
## ##
## open_fun_decl -> Function Ident parameters option(type_expr_colon) Is . block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Function Ident parameters option(type_annot) Is . block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## open_fun_decl -> Function Ident parameters option(type_expr_colon) Is . expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Function Ident parameters option(type_annot) Is . expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Function Ident parameters option(type_expr_colon) Is ## Function Ident parameters option(type_annot) Is
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
@ -4125,8 +4121,8 @@ contract: Function Ident LPAR Const Ident RPAR With
## ##
## Ends in an error in state: 460. ## Ends in an error in state: 460.
## ##
## open_fun_decl -> Function Ident parameters . option(type_expr_colon) Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Function Ident parameters . option(type_annot) Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## open_fun_decl -> Function Ident parameters . option(type_expr_colon) Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Function Ident parameters . option(type_annot) Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Function Ident parameters ## Function Ident parameters
@ -4138,8 +4134,8 @@ contract: Function Ident With
## ##
## Ends in an error in state: 459. ## Ends in an error in state: 459.
## ##
## open_fun_decl -> Function Ident . parameters option(type_expr_colon) Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Function Ident . parameters option(type_annot) Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## open_fun_decl -> Function Ident . parameters option(type_expr_colon) Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Function Ident . parameters option(type_annot) Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Function Ident ## Function Ident
@ -4151,8 +4147,8 @@ contract: Function With
## ##
## Ends in an error in state: 458. ## Ends in an error in state: 458.
## ##
## open_fun_decl -> Function . Ident parameters option(type_expr_colon) Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Function . Ident parameters option(type_annot) Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## open_fun_decl -> Function . Ident parameters option(type_expr_colon) Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Function . Ident parameters option(type_annot) Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Function ## Function
@ -4164,11 +4160,11 @@ contract: Recursive Function Ident LPAR Const Ident RPAR COLON String VBAR
## ##
## Ends in an error in state: 90. ## Ends in an error in state: 90.
## ##
## open_fun_decl -> Recursive Function Ident parameters option(type_expr_colon) . Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Recursive Function Ident parameters option(type_annot) . Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## open_fun_decl -> Recursive Function Ident parameters option(type_expr_colon) . Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Recursive Function Ident parameters option(type_annot) . Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Recursive Function Ident parameters option(type_expr_colon) ## Recursive Function Ident parameters option(type_annot)
## ##
## WARNING: This example involves spurious reductions. ## WARNING: This example involves spurious reductions.
## This implies that, although the LR(1) items shown above provide an ## This implies that, although the LR(1) items shown above provide an
@ -4177,32 +4173,32 @@ contract: Recursive Function Ident LPAR Const Ident RPAR COLON String VBAR
## In state 30, spurious reduction of production cartesian -> core_type ## In state 30, spurious reduction of production cartesian -> core_type
## In state 36, spurious reduction of production fun_type -> cartesian ## In state 36, spurious reduction of production fun_type -> cartesian
## In state 44, spurious reduction of production type_expr -> fun_type ## In state 44, spurious reduction of production type_expr -> fun_type
## In state 88, spurious reduction of production type_expr_colon -> COLON type_expr ## In state 88, spurious reduction of production type_annot -> COLON type_expr
## In state 89, spurious reduction of production option(type_expr_colon) -> type_expr_colon ## In state 89, spurious reduction of production option(type_annot) -> type_annot
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
contract: Recursive Function Ident LPAR Const Ident RPAR Is Begin Skip End While contract: Recursive Function Ident LPAR Const Ident RPAR Is Begin Skip End While
## ##
## Ends in an error in state: 579. ## Ends in an error in state: 580.
## ##
## open_fun_decl -> Recursive Function Ident parameters option(type_expr_colon) Is block . With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Recursive Function Ident parameters option(type_annot) Is block . With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Recursive Function Ident parameters option(type_expr_colon) Is block ## Recursive Function Ident parameters option(type_annot) Is block
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
contract: Recursive Function Ident LPAR Const Ident RPAR Is Begin Skip End With With contract: Recursive Function Ident LPAR Const Ident RPAR Is Begin Skip End With With
## ##
## Ends in an error in state: 580. ## Ends in an error in state: 581.
## ##
## open_fun_decl -> Recursive Function Ident parameters option(type_expr_colon) Is block With . expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Recursive Function Ident parameters option(type_annot) Is block With . expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Recursive Function Ident parameters option(type_expr_colon) Is block With ## Recursive Function Ident parameters option(type_annot) Is block With
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
@ -4211,11 +4207,11 @@ contract: Recursive Function Ident LPAR Const Ident RPAR Is With
## ##
## Ends in an error in state: 91. ## Ends in an error in state: 91.
## ##
## open_fun_decl -> Recursive Function Ident parameters option(type_expr_colon) Is . block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Recursive Function Ident parameters option(type_annot) Is . block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## open_fun_decl -> Recursive Function Ident parameters option(type_expr_colon) Is . expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Recursive Function Ident parameters option(type_annot) Is . expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Recursive Function Ident parameters option(type_expr_colon) Is ## Recursive Function Ident parameters option(type_annot) Is
## ##
<YOUR SYNTAX ERROR MESSAGE HERE> <YOUR SYNTAX ERROR MESSAGE HERE>
@ -4224,8 +4220,8 @@ contract: Recursive Function Ident LPAR Const Ident RPAR With
## ##
## Ends in an error in state: 86. ## Ends in an error in state: 86.
## ##
## open_fun_decl -> Recursive Function Ident parameters . option(type_expr_colon) Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Recursive Function Ident parameters . option(type_annot) Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## open_fun_decl -> Recursive Function Ident parameters . option(type_expr_colon) Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Recursive Function Ident parameters . option(type_annot) Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Recursive Function Ident parameters ## Recursive Function Ident parameters
@ -4237,8 +4233,8 @@ contract: Recursive Function Ident With
## ##
## Ends in an error in state: 70. ## Ends in an error in state: 70.
## ##
## open_fun_decl -> Recursive Function Ident . parameters option(type_expr_colon) Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Recursive Function Ident . parameters option(type_annot) Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## open_fun_decl -> Recursive Function Ident . parameters option(type_expr_colon) Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Recursive Function Ident . parameters option(type_annot) Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Recursive Function Ident ## Recursive Function Ident
@ -4250,8 +4246,8 @@ contract: Recursive Function With
## ##
## Ends in an error in state: 69. ## Ends in an error in state: 69.
## ##
## open_fun_decl -> Recursive Function . Ident parameters option(type_expr_colon) Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Recursive Function . Ident parameters option(type_annot) Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## open_fun_decl -> Recursive Function . Ident parameters option(type_expr_colon) Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Recursive Function . Ident parameters option(type_annot) Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Recursive Function ## Recursive Function
@ -4263,8 +4259,8 @@ contract: Recursive With
## ##
## Ends in an error in state: 68. ## Ends in an error in state: 68.
## ##
## open_fun_decl -> Recursive . Function Ident parameters option(type_expr_colon) Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Recursive . Function Ident parameters option(type_annot) Is block With expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## open_fun_decl -> Recursive . Function Ident parameters option(type_expr_colon) Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ] ## open_fun_decl -> Recursive . Function Ident parameters option(type_annot) Is expr [ Type SEMI Recursive RBRACE Function End EOF Const Attributes ]
## ##
## The known suffix of the stack is as follows: ## The known suffix of the stack is as follows:
## Recursive ## Recursive

View File

@ -439,11 +439,11 @@ and scan state = parse
(* String *) (* String *)
| '"' { let opening, _, state = state#sync lexbuf in | '"' { let opening, _, state = state#sync lexbuf in
let thread = LexerLib.mk_thread opening "" in let thread = LexerLib.mk_thread opening in
scan_string thread state lexbuf |> mk_string } scan_string thread state lexbuf |> mk_string }
| "{|" { let opening, _, state = state#sync lexbuf in | "{|" { let opening, _, state = state#sync lexbuf in
let thread = LexerLib.mk_thread opening "" in let thread = LexerLib.mk_thread opening in
scan_verbatim thread state lexbuf |> mk_verbatim } scan_verbatim thread state lexbuf |> mk_verbatim }
(* Comments *) (* Comments *)
@ -453,33 +453,28 @@ and scan state = parse
match state#block with match state#block with
Some block when block#opening = lexeme -> Some block when block#opening = lexeme ->
let opening, _, state = state#sync lexbuf in let opening, _, state = state#sync lexbuf in
let thread = LexerLib.mk_thread opening lexeme in let thread = LexerLib.mk_thread opening in
let thread, state = scan_block block thread state lexbuf in let thread = thread#push_string lexeme in
let state = state#push_block thread let thread, state = scan_block block thread state lexbuf
in scan state lexbuf in scan (state#push_block thread) lexbuf
| Some _ | None -> | Some _ | None -> (* Not a comment for this LIGO syntax *)
let n = String.length lexeme in let n = String.length lexeme in
begin let () = LexerLib.rollback lexbuf in
LexerLib.rollback lexbuf; scan (scan_n_sym n state lexbuf) lexbuf }
assert (n > 0);
scan (scan_n_sym n state lexbuf) lexbuf
end }
| line_comments { | line_comments {
let lexeme = Lexing.lexeme lexbuf in let lexeme = Lexing.lexeme lexbuf in
match state#line with match state#line with
Some line when line = lexeme -> Some line when line = lexeme ->
let opening, _, state = state#sync lexbuf in let opening, _, state = state#sync lexbuf in
let thread = LexerLib.mk_thread opening lexeme in let thread = LexerLib.mk_thread opening in
let thread, state = scan_line thread state lexbuf in let thread = thread#push_string lexeme in
let state = state#push_line thread let thread, state = scan_line thread state lexbuf
in scan state lexbuf in scan (state#push_line thread) lexbuf
| Some _ | None -> | Some _ | None -> (* Not a comment for this LIGO syntax *)
let n = String.length lexeme in let n = String.length lexeme in
begin let () = LexerLib.rollback lexbuf in
LexerLib.rollback lexbuf; scan (scan_n_sym n state lexbuf) lexbuf }
scan (scan_n_sym n state lexbuf) lexbuf
end }
| _ as c { let region, _, _ = state#sync lexbuf | _ as c { let region, _, _ = state#sync lexbuf
in fail region (Unexpected_character c) } in fail region (Unexpected_character c) }
@ -488,8 +483,7 @@ and scan state = parse
and scan_n_sym n state = parse and scan_n_sym n state = parse
symbol { let state = mk_sym state lexbuf in symbol { let state = mk_sym state lexbuf in
if n = 1 then state if n = 1 then state else scan_n_sym (n-1) state lexbuf }
else scan_n_sym (n-1) state lexbuf }
(* Scanning #include flag *) (* Scanning #include flag *)
@ -552,7 +546,6 @@ and scan_block block thread state = parse
in scan_block block thread state lexbuf in scan_block block thread state lexbuf
else let () = LexerLib.rollback lexbuf in else let () = LexerLib.rollback lexbuf in
let n = String.length lexeme in let n = String.length lexeme in
let () = assert (n > 0) in
let state = scan_n_sym n state lexbuf let state = scan_n_sym n state lexbuf
in scan_block block thread state lexbuf } in scan_block block thread state lexbuf }
@ -563,7 +556,6 @@ and scan_block block thread state = parse
in thread#push_string lexeme, state in thread#push_string lexeme, state
else let () = LexerLib.rollback lexbuf in else let () = LexerLib.rollback lexbuf in
let n = String.length lexeme in let n = String.length lexeme in
let () = assert (n > 0) in
let state = scan_n_sym n state lexbuf let state = scan_n_sym n state lexbuf
in scan_block block thread state lexbuf } in scan_block block thread state lexbuf }
@ -588,6 +580,18 @@ and scan_block block thread state = parse
let region = Region.make ~start:state#pos ~stop:pos let region = Region.make ~start:state#pos ~stop:pos
in fail region error } in fail region error }
and scan_utf8 block thread state = parse
eof { let err = Unterminated_comment block#closing
in fail thread#opening err }
| _ as c { let thread = thread#push_char c in
let lexeme = Lexing.lexeme lexbuf in
let () = state#supply (Bytes.of_string lexeme) 0 1 in
match Uutf.decode state#decoder with
`Uchar _ -> thread, Stdlib.Ok ()
| `Malformed _ -> thread, Stdlib.Error Invalid_utf8_sequence
| `Await -> scan_utf8 block thread state lexbuf
| `End -> assert false }
(* Finishing a line comment *) (* Finishing a line comment *)
and scan_line thread state = parse and scan_line thread state = parse
@ -609,18 +613,6 @@ and scan_line thread state = parse
let region = Region.make ~start:state#pos ~stop:pos let region = Region.make ~start:state#pos ~stop:pos
in fail region error } in fail region error }
and scan_utf8 block thread state = parse
eof { let err = Unterminated_comment block#closing
in fail thread#opening err }
| _ as c { let thread = thread#push_char c in
let lexeme = Lexing.lexeme lexbuf in
let () = state#supply (Bytes.of_string lexeme) 0 1 in
match Uutf.decode state#decoder with
`Uchar _ -> thread, Stdlib.Ok ()
| `Malformed _ -> thread, Stdlib.Error Invalid_utf8_sequence
| `Await -> scan_utf8 block thread state lexbuf
| `End -> assert false }
and scan_utf8_inline thread state = parse and scan_utf8_inline thread state = parse
eof { thread, Stdlib.Ok () } eof { thread, Stdlib.Ok () }
| _ as c { let thread = thread#push_char c in | _ as c { let thread = thread#push_char c in

View File

@ -69,7 +69,7 @@ type thread = <
set_opening : Region.t -> thread set_opening : Region.t -> thread
> >
let mk_thread region lexeme : thread = let mk_thread region : thread =
(* The call [explode s a] is the list made by pushing the characters (* The call [explode s a] is the list made by pushing the characters
in the string [s] on top of [a], in reverse order. For example, in the string [s] on top of [a], in reverse order. For example,
[explode "ba" ['c';'d'] = ['a'; 'b'; 'c'; 'd']]. *) [explode "ba" ['c';'d'] = ['a'; 'b'; 'c'; 'd']]. *)
@ -83,10 +83,10 @@ let mk_thread region lexeme : thread =
val opening = region val opening = region
method opening = opening method opening = opening
val length = String.length lexeme val length = 0
method length = length method length = length
val acc = explode lexeme [] val acc = []
method acc = acc method acc = acc
method set_opening opening = {< opening; length; acc >} method set_opening opening = {< opening; length; acc >}
@ -100,10 +100,10 @@ let mk_thread region lexeme : thread =
acc = explode str acc >} acc = explode str acc >}
(* The value of [thread#to_string] is a string of length (* The value of [thread#to_string] is a string of length
[thread#length] containing the [thread#length] characters in [thread#length] containing the characters in the list
the list [thread#acc], in reverse order. For instance, [thread#acc], in reverse order. For instance, [thread#to_string
[thread#to_string = "abc"] if [thread#length = 3] and = "abc"] if [thread#length = 3] and [thread#acc =
[thread#acc = ['c';'b';'a']]. *) ['c';'b';'a']]. *)
method to_string = method to_string =
let bytes = Bytes.make length ' ' in let bytes = Bytes.make length ' ' in
@ -161,6 +161,7 @@ type 'token window =
type 'token state = < type 'token state = <
units : (Markup.t list * 'token) FQueue.t; units : (Markup.t list * 'token) FQueue.t;
markup : Markup.t list; markup : Markup.t list;
comments : Markup.comment FQueue.t;
window : 'token window; window : 'token window;
last : Region.t; last : Region.t;
pos : Pos.t; pos : Pos.t;
@ -184,15 +185,18 @@ type 'token state = <
push_tabs : Lexing.lexbuf -> 'token state; push_tabs : Lexing.lexbuf -> 'token state;
push_bom : Lexing.lexbuf -> 'token state; push_bom : Lexing.lexbuf -> 'token state;
push_markup : Markup.t -> 'token state; push_markup : Markup.t -> 'token state;
push_comment : Markup.comment -> 'token state
> >
let mk_state ~units ~markup ~window ~last ~pos ~decoder ~supply let mk_state ~units ~markup ~comments ~window ~last ~pos ~decoder ~supply
?block ?line () : _ state = ?block ?line () : _ state =
object (self) object (self)
val units = units val units = units
method units = units method units = units
val markup = markup val markup = markup
method markup = markup method markup = markup
val comments = comments
method comments = comments
val window = window val window = window
method window = window method window = window
val last = last val last = last
@ -229,6 +233,9 @@ let mk_state ~units ~markup ~window ~last ~pos ~decoder ~supply
(* Committing markup to the current logical state *) (* Committing markup to the current logical state *)
method push_comment comment =
{< comments = FQueue.enq comment comments >}
method push_markup unit = {< markup = unit :: markup >} method push_markup unit = {< markup = unit :: markup >}
method push_newline buffer = method push_newline buffer =
@ -238,21 +245,23 @@ let mk_state ~units ~markup ~window ~last ~pos ~decoder ~supply
let stop = start#new_line value in let stop = start#new_line value in
let region = Region.make ~start ~stop in let region = Region.make ~start ~stop in
let unit = Markup.Newline Region.{region; value} let unit = Markup.Newline Region.{region; value}
in {< pos = stop; markup = unit::markup >} in (self#push_markup unit)#set_pos stop
method push_line thread = method push_line thread =
let start = thread#opening#start in let start = thread#opening#start in
let region = Region.make ~start ~stop:self#pos let region = Region.make ~start ~stop:self#pos
and value = thread#to_string in and value = thread#to_string in
let unit = Markup.LineCom Region.{region; value} let reg = Region.{region; value} in
in {< markup = unit::markup >} let unit = Markup.LineCom reg
in (self#push_markup unit)#push_comment (Markup.Line reg)
method push_block thread = method push_block thread =
let start = thread#opening#start in let start = thread#opening#start in
let region = Region.make ~start ~stop:self#pos let region = Region.make ~start ~stop:self#pos
and value = thread#to_string in and value = thread#to_string in
let unit = Markup.BlockCom Region.{region; value} let reg = Region.{region; value} in
in {< markup = unit::markup >} let unit = Markup.BlockCom reg
in (self#push_markup unit)#push_comment (Markup.Block reg)
method push_space buffer = method push_space buffer =
let region, lex, state = self#sync buffer in let region, lex, state = self#sync buffer in
@ -286,11 +295,12 @@ type 'token instance = {
input : input; input : input;
read : log:('token logger) -> Lexing.lexbuf -> 'token; read : log:('token logger) -> Lexing.lexbuf -> 'token;
buffer : Lexing.lexbuf; buffer : Lexing.lexbuf;
close : unit -> unit;
get_win : unit -> 'token window; get_win : unit -> 'token window;
get_pos : unit -> Pos.t; get_pos : unit -> Pos.t;
get_last : unit -> Region.t; get_last : unit -> Region.t;
get_file : unit -> file_path; get_file : unit -> file_path;
close : unit -> unit get_comments : unit -> Markup.comment FQueue.t
} }
type open_err = File_opening of string type open_err = File_opening of string
@ -329,14 +339,17 @@ let open_token_stream ?line ?block ~scan
~window:Nil ~window:Nil
~pos ~pos
~markup:[] ~markup:[]
~comments:FQueue.empty
~decoder ~decoder
~supply ~supply
?block ?block
?line ?line
()) in ()) in
let get_pos () = !state#pos let get_pos () = !state#pos
and get_last () = !state#last and get_last () = !state#last
and get_win () = !state#window and get_win () = !state#window
and get_comments () = !state#comments
and get_file () = file_path in and get_file () = file_path in
let patch_buffer (start, stop) buffer = let patch_buffer (start, stop) buffer =
@ -382,6 +395,7 @@ let open_token_stream ?line ?block ~scan
| _ -> () in | _ -> () in
let instance = { let instance = {
read = read scan ~token_to_region ~style; read = read scan ~token_to_region ~style;
input; buffer; get_win; get_pos; get_last; get_file; close} input; buffer; close;
get_win; get_pos; get_last; get_file; get_comments}
in Ok instance in Ok instance
| Error _ as e -> e | Error _ as e -> e

View File

@ -39,7 +39,7 @@ type thread = <
set_opening : Region.t -> thread set_opening : Region.t -> thread
> >
val mk_thread : Region.t -> lexeme -> thread val mk_thread : Region.t -> thread
(* STATE *) (* STATE *)
@ -110,6 +110,7 @@ type 'token window =
type 'token state = < type 'token state = <
units : (Markup.t list * 'token) FQueue.t; units : (Markup.t list * 'token) FQueue.t;
markup : Markup.t list; markup : Markup.t list;
comments : Markup.comment FQueue.t;
window : 'token window; window : 'token window;
last : Region.t; last : Region.t;
pos : Pos.t; pos : Pos.t;
@ -133,6 +134,7 @@ type 'token state = <
push_tabs : Lexing.lexbuf -> 'token state; push_tabs : Lexing.lexbuf -> 'token state;
push_bom : Lexing.lexbuf -> 'token state; push_bom : Lexing.lexbuf -> 'token state;
push_markup : Markup.t -> 'token state; push_markup : Markup.t -> 'token state;
push_comment : Markup.comment -> 'token state
> >
(* LEXER INSTANCE *) (* LEXER INSTANCE *)
@ -178,11 +180,12 @@ type 'token instance = {
input : input; input : input;
read : log:('token logger) -> Lexing.lexbuf -> 'token; read : log:('token logger) -> Lexing.lexbuf -> 'token;
buffer : Lexing.lexbuf; buffer : Lexing.lexbuf;
close : unit -> unit;
get_win : unit -> 'token window; get_win : unit -> 'token window;
get_pos : unit -> Pos.t; get_pos : unit -> Pos.t;
get_last : unit -> Region.t; get_last : unit -> Region.t;
get_file : unit -> file_path; get_file : unit -> file_path;
close : unit -> unit get_comments : unit -> Markup.comment FQueue.t
} }
type open_err = File_opening of string type open_err = File_opening of string

View File

@ -42,3 +42,9 @@ let to_string markup ?(offsets=true) mode =
region, sprintf "BOM \"%s\"" (String.escaped value) in region, sprintf "BOM \"%s\"" (String.escaped value) in
let reg_str = region#compact ~offsets mode let reg_str = region#compact ~offsets mode
in sprintf "%s: %s" reg_str val_str in sprintf "%s: %s" reg_str val_str
(* Comments *)
type comment =
Line of lexeme Region.reg
| Block of lexeme Region.reg

View File

@ -1,11 +1,12 @@
(** This module defines the sorts of markup recognised by the LIGO (* This module defines the sorts of markup recognised by the LIGO
lexer *) lexer *)
module Region = Simple_utils.Region module Region = Simple_utils.Region
(** A lexeme is piece of concrete syntax belonging to a token. In (* A lexeme is piece of concrete syntax belonging to a token. In
algebraic terms, a token is also a piece of abstract lexical algebraic terms, a token is also a piece of abstract lexical
syntax. Lexical units emcompass both markup and lexemes. *) syntax. Lexical units emcompass both markup and lexemes. *)
type lexeme = string type lexeme = string
type t = type t =
@ -18,7 +19,7 @@ type t =
type markup = t type markup = t
(** Pretty-printing of markup (* Pretty-printing of markup
The difference between [to_lexeme] and [to_string] is that the The difference between [to_lexeme] and [to_string] is that the
former builds the corresponding concrete syntax (the lexeme), former builds the corresponding concrete syntax (the lexeme),
@ -31,3 +32,9 @@ type markup = t
val to_lexeme : t -> lexeme val to_lexeme : t -> lexeme
val to_string : t -> ?offsets:bool -> [`Byte | `Point] -> string val to_string : t -> ?offsets:bool -> [`Byte | `Point] -> string
(* Comments *)
type comment =
Line of lexeme Region.reg
| Block of lexeme Region.reg

View File

@ -569,7 +569,6 @@ let rec compile_instruction : ?next: AST.expression -> CST.instruction -> _ resu
let%bind (_, var, path) = compile_path mlu.path in let%bind (_, var, path) = compile_path mlu.path in
let%bind index = compile_expression @@ mlu.index.value.inside in let%bind index = compile_expression @@ mlu.index.value.inside in
ok @@ (var, path @ [Access_map index]) ok @@ (var, path @ [Access_map index])
in in
match instruction with match instruction with
Cond c -> Cond c ->
@ -725,8 +724,8 @@ and compile_block : ?next:AST.expression -> CST.block CST.reg -> _ result = fun
let (block', _loc) = r_split block in let (block', _loc) = r_split block in
let statements = npseq_to_list block'.statements in let statements = npseq_to_list block'.statements in
let aux (next,attr) statement = let aux (next,attr) statement =
let%bind (statement, attr) = compile_statement ?next attr statement in let%bind (statement, attr) = compile_statement ?next attr statement
return (statement,attr) in return (statement,attr)
in in
let%bind (block', _) = bind_fold_right_list aux (next,None) statements in let%bind (block', _) = bind_fold_right_list aux (next,None) statements in
match block' with match block' with