Branch cleanup and test outputs update

Lots of tests have a new warning because they were calling subscopes without
using their outputs. A better solution could be to mark these subscopes as
`output`, now that it's possible !
This commit is contained in:
Louis Gesbert 2024-04-04 10:48:25 +02:00
parent cde9a66295
commit 0ec04c4925
24 changed files with 293 additions and 414 deletions

View File

@ -56,9 +56,6 @@ type 'm ctx = {
toplevel_vars : ('m Ast.expr Var.t * naked_typ) TopdefName.Map.t;
scope_vars :
('m Ast.expr Var.t * naked_typ * Desugared.Ast.io) ScopeVar.Map.t;
(* subscope_vars :
* ('m Ast.expr Var.t * naked_typ * bool (\* reentrant *\)) ScopeVar.Map.t
* ScopeVar.Map.t; *)
date_rounding : date_rounding;
}
@ -644,229 +641,6 @@ let translate_rule
(a_var, Mark.remove typ, io)
ctx.scope_vars;
} )
(* | S.SubScopeVarDefinition { var; origin_var; typ; scope; e } ->
* let pos = Mark.get var in
* let a_name = ScopeVar.get_info var in
* let a_var = Var.make (Mark.remove a_name) in
* let a_io =
* { Desugared.Ast.io_input = NoInput, pos; io_output = false, pos }
* (\* - "input subscopes" aren't allowed at the moment
* - definitions are only for subscope *input* variables. Even if this is an "output subscope" and the variable was "input output", the output will be read from the output structure of the scope call, not from this variable.
* *\)
* in
* let new_e =
* tag_with_log_entry (translate_expr ctx e)
* (VarDef
* {
* log_typ = Mark.remove typ;
* log_io_output = false;
* log_io_input = Mark.remove a_io.Desugared.Ast.io_input;
* })
* [sigma_name, pos_sigma; a_name]
* in
* let thunked_or_nonempty_new_e =
* match a_io.Desugared.Ast.io_input with
* | Runtime.NoInput, _ -> assert false
* | Runtime.OnlyInput, _ -> new_e
* | Runtime.Reentrant, pos -> (
* match Mark.remove typ with
* | TArrow _ -> new_e
* | _ -> Mark.map_mark (Expr.with_pos pos) (Expr.thunk_term new_e))
* in
* ( (fun next ->
* Bindlib.box_apply2
* (fun next thunked_or_nonempty_new_e ->
* Cons
* ( {
* scope_let_pos = Mark.get a_name;
* scope_let_typ = input_var_typ (Mark.remove typ) a_io;
* scope_let_expr = thunked_or_nonempty_new_e;
* scope_let_kind = SubScopeVarDefinition;
* },
* next ))
* (Bindlib.bind_var a_var next)
* (Expr.Box.lift thunked_or_nonempty_new_e)),
* {
* ctx with
* subscope_vars =
* ScopeVar.Map.update (Mark.remove alias)
* (fun map ->
* match map with
* | Some map ->
* Some
* (ScopeVar.Map.add (Mark.remove origin_var)
* (a_var, Mark.remove typ, a_io)
* map)
* | None ->
* Some
* (ScopeVar.Map.singleton (Mark.remove origin_var)
* (a_var, Mark.remove typ, a_io)))
* ctx.subscope_vars;
* } ) *)
(*
| Call (subname, subindex, m) ->
let subscope_sig = ScopeName.Map.find subname ctx.scopes_parameters in
let scope_sig_decl = ScopeName.Map.find subname ctx.decl_ctx.ctx_scopes in
let all_subscope_vars = subscope_sig.scope_sig_local_vars in
let all_subscope_input_vars =
List.filter
(fun var_ctx ->
match Mark.remove var_ctx.scope_var_io.Desugared.Ast.io_input with
| NoInput -> false
| _ -> true)
all_subscope_vars
in
let called_scope_input_struct = subscope_sig.scope_sig_input_struct in
let called_scope_return_struct = subscope_sig.scope_sig_output_struct in
let all_subscope_output_vars =
List.filter_map
(fun var_ctx ->
if Mark.remove var_ctx.scope_var_io.Desugared.Ast.io_output then
(* Retrieve the actual expected output type through the scope output
struct definition *)
let str =
StructName.Map.find called_scope_return_struct
ctx.decl_ctx.ctx_structs
in
let fld =
ScopeVar.Map.find var_ctx.scope_var_name
scope_sig_decl.out_struct_fields
in
let ty = StructField.Map.find fld str in
Some { var_ctx with scope_var_typ = Mark.remove ty }
else None)
all_subscope_vars
in
let pos_call = Mark.get (ScopeVar.get_info subindex) in
let scope_dcalc_ref =
let m = mark_tany m pos_call in
match subscope_sig.scope_sig_scope_ref with
| Local_scope_ref var -> Expr.make_var var m
| External_scope_ref name ->
Expr.eexternal ~name:(Mark.map (fun n -> External_scope n) name) m
in
let subscope_vars_defined =
try ScopeVar.Map.find subindex ctx.subscope_vars
with ScopeVar.Map.Not_found _ -> ScopeVar.Map.empty
in
let subscope_var_not_yet_defined subvar =
not (ScopeVar.Map.mem subvar subscope_vars_defined)
in
let subscope_args =
List.fold_left
(fun acc (subvar : scope_var_ctx) ->
let e =
if subscope_var_not_yet_defined subvar.scope_var_name then
(* This is a redundant check. Normally, all subscope variables
should have been defined (even an empty definition, if they're
not defined by any rule in the source code) by the translation
from desugared to the scope language. *)
Expr.empty_thunked_term m
else
let a_var, _, _ =
ScopeVar.Map.find subvar.scope_var_name subscope_vars_defined
in
Expr.make_var a_var (mark_tany m pos_call)
in
let field =
(ScopeVar.Map.find subvar.scope_var_name
subscope_sig.scope_sig_in_fields)
.scope_input_name
in
StructField.Map.add field e acc)
StructField.Map.empty all_subscope_input_vars
in
let subscope_struct_arg =
Expr.estruct ~name:called_scope_input_struct ~fields:subscope_args
(mark_tany m pos_call)
in
let all_subscope_output_vars_dcalc =
List.map
(fun (subvar : scope_var_ctx) ->
let sub_dcalc_var =
Var.make
(Mark.remove (ScopeVar.get_info subindex)
^ "."
^ Mark.remove (ScopeVar.get_info subvar.scope_var_name))
in
subvar, sub_dcalc_var)
all_subscope_output_vars
in
let subscope_func =
tag_with_log_entry scope_dcalc_ref BeginCall
[
sigma_name, pos_sigma;
ScopeVar.get_info subindex;
ScopeName.get_info subname;
]
in
let call_expr =
tag_with_log_entry
(Expr.eapp ~f:subscope_func ~args:[subscope_struct_arg]
~tys:[TStruct called_scope_input_struct, Expr.mark_pos m]
(mark_tany m pos_call))
EndCall
[
sigma_name, pos_sigma;
ScopeVar.get_info subindex;
ScopeName.get_info subname;
]
in
let result_tuple_var = Var.make "result" in
let result_tuple_typ = TStruct called_scope_return_struct, pos_sigma in
let call_scope_let next =
Bindlib.box_apply2
(fun next call_expr ->
Cons
( {
scope_let_pos = pos_sigma;
scope_let_kind = CallingSubScope;
scope_let_typ = result_tuple_typ;
scope_let_expr = call_expr;
},
next ))
(Bindlib.bind_var result_tuple_var next)
(Expr.Box.lift call_expr)
in
let result_bindings_lets next =
List.fold_right
(fun (var_ctx, v) next ->
let field =
ScopeVar.Map.find var_ctx.scope_var_name
scope_sig_decl.out_struct_fields
in
Bindlib.box_apply2
(fun next r ->
Cons
( {
scope_let_pos = pos_sigma;
scope_let_typ = var_ctx.scope_var_typ, pos_sigma;
scope_let_kind = DestructuringSubScopeResults;
scope_let_expr =
( EStructAccess
{ name = called_scope_return_struct; e = r; field },
mark_tany m pos_sigma );
},
next ))
(Bindlib.bind_var v next)
(Expr.Box.lift
(Expr.make_var result_tuple_var (mark_tany m pos_sigma))))
all_subscope_output_vars_dcalc next
in
( (fun next -> call_scope_let (result_bindings_lets next)),
{
ctx with
subscope_vars =
ScopeVar.Map.add subindex
(List.fold_left
(fun acc (var_ctx, dvar) ->
ScopeVar.Map.add var_ctx.scope_var_name
(dvar, var_ctx.scope_var_typ, var_ctx.scope_var_io)
acc)
ScopeVar.Map.empty all_subscope_output_vars_dcalc)
ctx.subscope_vars;
} )
*)
| Assertion e ->
let new_e = translate_expr ctx e in
let scope_let_pos = Expr.pos e in

View File

@ -286,19 +286,6 @@ let process_subscope_decl
}
in
{ ctxt with scopes = ScopeName.Map.add scope scope_ctxt ctxt.scopes }
(* var_typs =
* ScopeVar.Map.add uid
* {
* var_sig_typ = data_typ;
* var_sig_is_condition = is_cond;
* var_sig_parameters;
* var_sig_io = decl.scope_decl_context_item_attribute;
* var_sig_states_idmap = states_idmap;
* var_sig_states_list = states_list;
* }
* ctxt.var_typs; *)
let is_type_cond ((typ, _) : Surface.Ast.typ) =
match typ with

View File

@ -650,10 +650,6 @@ let translate_rule
Expr.escopecall ~scope:subscope ~args:subscope_param_map (Untyped { pos })
in
let subscope_expr = subscope_call_expr in
(* ScopeVar.Map.fold (fun _ (var, pos, typ, expr) acc ->
* Expr.make_let_in var typ expr acc pos)
* subscope_params subscope_call_expr
* in *)
assert (RuleName.Map.is_empty scope_def.D.scope_def_rules);
(* The subscope will be defined by its inputs, it's not supposed to have direct rules yet *)
let scope_info = ScopeName.Map.find subscope ctx.decl_ctx.ctx_scopes in
@ -729,11 +725,6 @@ let translate_scope_interface ctx scope =
let scope_def =
D.ScopeDef.Map.find ((var, Pos.no_pos), D.ScopeDef.Var None) scope.D.scope_defs
in
(* let acc =
* Message.emit_debug "et %a>%a alors ?" ScopeName.format scope.D.scope_uid ScopeVar.format var;
*
* ScopeVar.Map.add var (get_svar scope_def) acc
* in *)
ScopeVar.Map.add
(match ScopeVar.Map.find var ctx.scope_var_mapping with
| WholeVar v -> v

View File

@ -412,10 +412,6 @@ module Env = struct
let add_scope_var v typ t =
{ t with scope_vars = A.ScopeVar.Map.add v typ t.scope_vars }
let get_subscope_in_var t scope var =
Option.bind (A.ScopeName.Map.find_opt scope t.scopes) (fun vmap ->
A.ScopeVar.Map.find_opt var vmap)
let add_scope scope_name ~vars ~in_vars t =
{
t with
@ -594,10 +590,11 @@ and typecheck_expr_top_down :
with
| Some (scope_out, _) ->
Message.raise_multispanned_error_full
[None, Expr.mark_pos context_mark;
Some (fun ppf -> Format.fprintf ppf "Subscope %a is declared here" A.ScopeName.format scope_out),
[Some (fun ppf -> Format.fprintf ppf "@{<yellow>%s@} is used here as an output" field),
Expr.mark_pos context_mark;
Some (fun ppf -> Format.fprintf ppf "Scope %a is declared here" A.ScopeName.format scope_out),
Mark.get (A.StructName.get_info name)]
"Variable @{<yellow>\"%s\"@} is not a declared output of scope %a."
"Variable @{<yellow>%s@} is not a declared output of scope %a."
field A.ScopeName.format scope_out
~suggestion:(List.map A.StructField.to_string (A.StructField.Map.keys str))
| None ->

View File

@ -1,6 +1,6 @@
source_file: BEGIN_CODE DECLARATION ENUM UIDENT COLON ALT UIDENT CONTENT TEXT YEAR
##
## Ends in an error in state: 438.
## Ends in an error in state: 590.
##
## list(addpos(enum_decl_line)) -> enum_decl_line . list(addpos(enum_decl_line)) [ SCOPE END_CODE DECLARATION ]
##
@ -12,7 +12,7 @@ expected another enum case, or a new declaration or scope use
source_file: BEGIN_CODE DECLARATION ENUM UIDENT COLON ALT UIDENT CONTENT YEAR
##
## Ends in an error in state: 434.
## Ends in an error in state: 586.
##
## option(preceded(CONTENT,addpos(typ))) -> CONTENT . typ_data [ SCOPE END_CODE DECLARATION ALT ]
##
@ -24,7 +24,7 @@ expected a content type
source_file: BEGIN_CODE DECLARATION ENUM UIDENT COLON ALT UIDENT YEAR
##
## Ends in an error in state: 433.
## Ends in an error in state: 585.
##
## enum_decl_line -> ALT UIDENT . option(preceded(CONTENT,addpos(typ))) [ SCOPE END_CODE DECLARATION ALT ]
##
@ -36,7 +36,7 @@ expected a payload for your enum case, or another case or declaration
source_file: BEGIN_CODE DECLARATION ENUM UIDENT COLON ALT YEAR
##
## Ends in an error in state: 432.
## Ends in an error in state: 584.
##
## enum_decl_line -> ALT . UIDENT option(preceded(CONTENT,addpos(typ))) [ SCOPE END_CODE DECLARATION ALT ]
##
@ -48,7 +48,7 @@ expected the name of an enum case
source_file: BEGIN_CODE DECLARATION ENUM UIDENT COLON YEAR
##
## Ends in an error in state: 431.
## Ends in an error in state: 583.
##
## code_item -> DECLARATION ENUM UIDENT COLON . list(addpos(enum_decl_line)) [ SCOPE END_CODE DECLARATION ]
##
@ -60,7 +60,7 @@ expected an enum case
source_file: BEGIN_CODE DECLARATION ENUM UIDENT YEAR
##
## Ends in an error in state: 430.
## Ends in an error in state: 582.
##
## code_item -> DECLARATION ENUM UIDENT . COLON list(addpos(enum_decl_line)) [ SCOPE END_CODE DECLARATION ]
##
@ -72,7 +72,7 @@ expected a colon
source_file: BEGIN_CODE DECLARATION ENUM YEAR
##
## Ends in an error in state: 429.
## Ends in an error in state: 581.
##
## code_item -> DECLARATION ENUM . UIDENT COLON list(addpos(enum_decl_line)) [ SCOPE END_CODE DECLARATION ]
##
@ -960,7 +960,7 @@ expected the name of the scope being used
source_file: BEGIN_CODE YEAR
##
## Ends in an error in state: 479.
## Ends in an error in state: 631.
##
## source_file_item -> BEGIN_CODE . code END_CODE [ LAW_TEXT LAW_HEADING EOF BEGIN_METADATA BEGIN_DIRECTIVE BEGIN_CODE ]
##
@ -1021,8 +1021,8 @@ source_file: BEGIN_METADATA LAW_TEXT LAW_HEADING
## accurate view of the past (what has been recognized so far), they
## may provide an INCOMPLETE view of the future (what was expected next).
## In state 1, spurious reduction of production nonempty_list(LAW_TEXT) -> LAW_TEXT
## In state 458, spurious reduction of production law_text -> nonempty_list(LAW_TEXT)
## In state 459, spurious reduction of production option(law_text) -> law_text
## In state 610, spurious reduction of production law_text -> nonempty_list(LAW_TEXT)
## In state 611, spurious reduction of production option(law_text) -> law_text
##
expected some law text or code block
@ -3450,74 +3450,96 @@ expected a binary operator continuing the expression, or a keyword ending the ex
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT YEAR
##
## Ends in an error in state: 397.
## Ends in an error in state: 510.
##
## scope_decl_item_attribute -> scope_decl_item_attribute_input . scope_decl_item_attribute_output [ LIDENT ]
## scope_decl_item -> CONTEXT . OUTPUT lident CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT . OUTPUT lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT . OUTPUT lident CONTENT typ_data list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT . lident CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT . lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT . lident CONTENT typ_data list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT . OUTPUT lident SCOPE quident [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT . lident SCOPE quident [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT . OUTPUT lident CONDITION DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT . OUTPUT lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT . OUTPUT lident CONDITION list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT . lident CONDITION DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT . lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT . lident CONDITION list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute_input
## CONTEXT
##
expected a variable name, optionally preceded by 'output'
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON INTERNAL YEAR
##
## Ends in an error in state: 400.
## Ends in an error in state: 418.
##
## scope_decl_item -> scope_decl_item_attribute . lident CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute . lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute . lident CONTENT typ_data list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute . lident CONDITION DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute . lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute . lident CONDITION list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> INTERNAL . OUTPUT lident CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> INTERNAL . OUTPUT lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> INTERNAL . OUTPUT lident CONTENT typ_data list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> INTERNAL . lident CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> INTERNAL . lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> INTERNAL . lident CONTENT typ_data list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> INTERNAL . OUTPUT lident SCOPE quident [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> INTERNAL . lident SCOPE quident [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> INTERNAL . OUTPUT lident CONDITION DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> INTERNAL . OUTPUT lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> INTERNAL . OUTPUT lident CONDITION list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> INTERNAL . lident CONDITION DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> INTERNAL . lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> INTERNAL . lident CONDITION list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute
## INTERNAL
##
expected a variable name
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT YEAR
##
## Ends in an error in state: 401.
## Ends in an error in state: 534.
##
## scope_decl_item -> scope_decl_item_attribute lident . CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute lident . CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute lident . CONTENT typ_data list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute lident . CONDITION DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute lident . CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute lident . CONDITION list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident . CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident . CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident . CONTENT typ_data list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident . SCOPE quident [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident . CONDITION DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident . CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident . CONDITION list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute lident
## CONTEXT lident
##
expected either 'condition', or 'content' followed by the expected variable type
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT YEAR
##
## Ends in an error in state: 402.
## Ends in an error in state: 537.
##
## scope_decl_item -> scope_decl_item_attribute lident CONTENT . typ_data DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute lident CONTENT . typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute lident CONTENT . typ_data list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONTENT . typ_data DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONTENT . typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONTENT . typ_data list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute lident CONTENT
## CONTEXT lident CONTENT
##
expected a type
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT BOOLEAN YEAR
##
## Ends in an error in state: 403.
## Ends in an error in state: 538.
##
## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data . DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data . DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONTENT typ_data . DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONTENT typ_data . DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONTENT typ_data . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute lident CONTENT typ_data
## CONTEXT lident CONTENT typ_data
##
expected either 'state' definitions for the variable, or the next declaration
@ -3525,37 +3547,37 @@ for the scope
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT UIDENT DEPENDS YEAR
##
## Ends in an error in state: 404.
## Ends in an error in state: 539.
##
## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data DEPENDS . separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data DEPENDS . LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONTENT typ_data DEPENDS . separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONTENT typ_data DEPENDS . LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute lident CONTENT typ_data DEPENDS
## CONTEXT lident CONTENT typ_data DEPENDS
##
expected a name and type for the dependency of this definition ('<ident> content <type>')
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT UIDENT DEPENDS LPAREN YEAR
##
## Ends in an error in state: 405.
## Ends in an error in state: 540.
##
## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data DEPENDS LPAREN . separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONTENT typ_data DEPENDS LPAREN . separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute lident CONTENT typ_data DEPENDS LPAREN
## CONTEXT lident CONTENT typ_data DEPENDS LPAREN
##
expected a name and type for the dependency of this definition ('<ident> content <type>')
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT UIDENT DEPENDS LPAREN LIDENT CONTENT UIDENT STATE
##
## Ends in an error in state: 406.
## Ends in an error in state: 541.
##
## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) . RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) . RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content)
## CONTEXT lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content)
##
## WARNING: This example involves spurious reductions.
## This implies that, although the LR(1) items shown above provide an
@ -3571,19 +3593,19 @@ expected a closing paren, or a comma followed by another argument specification
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT UIDENT DEPENDS LPAREN LIDENT CONTENT UIDENT RPAREN YEAR
##
## Ends in an error in state: 407.
## Ends in an error in state: 542.
##
## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN
## CONTEXT lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN
##
expected a 'state' declaration for the preceding declaration, or the next declaration for the scope
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONDITION STATE LIDENT YEAR
##
## Ends in an error in state: 408.
## Ends in an error in state: 403.
##
## list(state) -> state . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
@ -3596,12 +3618,12 @@ declaration for the scope
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONTENT UIDENT DEPENDS LIDENT CONTENT UIDENT DEFINED_AS
##
## Ends in an error in state: 411.
## Ends in an error in state: 544.
##
## scope_decl_item -> scope_decl_item_attribute lident CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute lident CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content)
## CONTEXT lident CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content)
##
## WARNING: This example involves spurious reductions.
## This implies that, although the LR(1) items shown above provide an
@ -3617,51 +3639,51 @@ expected the next declaration for the scope
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONDITION YEAR
##
## Ends in an error in state: 414.
## Ends in an error in state: 547.
##
## scope_decl_item -> scope_decl_item_attribute lident CONDITION . DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute lident CONDITION . DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute lident CONDITION . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONDITION . DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONDITION . DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONDITION . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute lident CONDITION
## CONTEXT lident CONDITION
##
expected the next declaration for the scope
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONDITION DEPENDS YEAR
##
## Ends in an error in state: 415.
## Ends in an error in state: 548.
##
## scope_decl_item -> scope_decl_item_attribute lident CONDITION DEPENDS . separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> scope_decl_item_attribute lident CONDITION DEPENDS . LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONDITION DEPENDS . separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONDITION DEPENDS . LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute lident CONDITION DEPENDS
## CONTEXT lident CONDITION DEPENDS
##
expected the form 'depends on <ident> content <type>'
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONDITION DEPENDS LPAREN YEAR
##
## Ends in an error in state: 416.
## Ends in an error in state: 549.
##
## scope_decl_item -> scope_decl_item_attribute lident CONDITION DEPENDS LPAREN . separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONDITION DEPENDS LPAREN . separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute lident CONDITION DEPENDS LPAREN
## CONTEXT lident CONDITION DEPENDS LPAREN
##
expected the form 'depends on (<ident> content <type> [, <ident> content <type> ...])'
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONDITION DEPENDS LPAREN LIDENT CONTENT UIDENT STATE
##
## Ends in an error in state: 417.
## Ends in an error in state: 550.
##
## scope_decl_item -> scope_decl_item_attribute lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) . RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) . RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content)
## CONTEXT lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content)
##
## WARNING: This example involves spurious reductions.
## This implies that, although the LR(1) items shown above provide an
@ -3677,21 +3699,27 @@ expected a closing paren, or a comma followed by another argument declaration ('
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON CONTEXT LIDENT CONDITION DEPENDS LPAREN LIDENT CONTENT UIDENT RPAREN YEAR
##
## Ends in an error in state: 418.
## Ends in an error in state: 551.
##
## scope_decl_item -> scope_decl_item_attribute lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> CONTEXT lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN . list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## scope_decl_item_attribute lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN
## CONTEXT lident CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN
##
expected the next definition in scope
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON LIDENT YEAR
##
## Ends in an error in state: 425.
## Ends in an error in state: 558.
##
## scope_decl_item -> lident . CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> lident . CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> lident . CONTENT typ_data list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> lident . SCOPE quident [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> lident . CONDITION DEPENDS separated_nonempty_list(COMMA,var_content) list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> lident . CONDITION DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
## scope_decl_item -> lident . CONDITION list(state) [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
## The known suffix of the stack is as follows:
## lident
@ -3701,7 +3729,7 @@ expected the form '<ident> scope <Scope_name>', or a scope variable declaration
source_file: BEGIN_CODE DECLARATION SCOPE UIDENT COLON LIDENT SCOPE YEAR
##
## Ends in an error in state: 426.
## Ends in an error in state: 559.
##
## scope_decl_item -> lident SCOPE . quident [ SCOPE OUTPUT LIDENT INTERNAL INPUT END_CODE DECLARATION CONTEXT ]
##
@ -3713,7 +3741,7 @@ expected a scope name
source_file: BEGIN_CODE DECLARATION LIDENT YEAR
##
## Ends in an error in state: 440.
## Ends in an error in state: 592.
##
## code_item -> DECLARATION lident . CONTENT typ_data DEPENDS separated_nonempty_list(COMMA,var_content) option(opt_def) [ SCOPE END_CODE DECLARATION ]
## code_item -> DECLARATION lident . CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN option(opt_def) [ SCOPE END_CODE DECLARATION ]
@ -3727,7 +3755,7 @@ expected 'content <type>'
source_file: BEGIN_CODE DECLARATION LIDENT CONTENT YEAR
##
## Ends in an error in state: 441.
## Ends in an error in state: 593.
##
## code_item -> DECLARATION lident CONTENT . typ_data DEPENDS separated_nonempty_list(COMMA,var_content) option(opt_def) [ SCOPE END_CODE DECLARATION ]
## code_item -> DECLARATION lident CONTENT . typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN option(opt_def) [ SCOPE END_CODE DECLARATION ]
@ -3741,7 +3769,7 @@ expected a type
source_file: BEGIN_CODE DECLARATION LIDENT CONTENT BOOLEAN YEAR
##
## Ends in an error in state: 442.
## Ends in an error in state: 594.
##
## code_item -> DECLARATION lident CONTENT typ_data . DEPENDS separated_nonempty_list(COMMA,var_content) option(opt_def) [ SCOPE END_CODE DECLARATION ]
## code_item -> DECLARATION lident CONTENT typ_data . DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN option(opt_def) [ SCOPE END_CODE DECLARATION ]
@ -3756,7 +3784,7 @@ expected 'equals <expression>', optionally preceded by 'depends on <var> content
source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS YEAR
##
## Ends in an error in state: 443.
## Ends in an error in state: 595.
##
## code_item -> DECLARATION lident CONTENT typ_data DEPENDS . separated_nonempty_list(COMMA,var_content) option(opt_def) [ SCOPE END_CODE DECLARATION ]
## code_item -> DECLARATION lident CONTENT typ_data DEPENDS . LPAREN separated_nonempty_list(COMMA,var_content) RPAREN option(opt_def) [ SCOPE END_CODE DECLARATION ]
@ -3769,7 +3797,7 @@ expected a variable name, following the form 'depends on <var> content <type>'
source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LPAREN YEAR
##
## Ends in an error in state: 444.
## Ends in an error in state: 596.
##
## code_item -> DECLARATION lident CONTENT typ_data DEPENDS LPAREN . separated_nonempty_list(COMMA,var_content) RPAREN option(opt_def) [ SCOPE END_CODE DECLARATION ]
##
@ -3781,7 +3809,7 @@ expected a variable name, following the form 'depends on (<var> content <type>,
source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LPAREN LIDENT CONTENT UIDENT DEFINED_AS
##
## Ends in an error in state: 445.
## Ends in an error in state: 597.
##
## code_item -> DECLARATION lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) . RPAREN option(opt_def) [ SCOPE END_CODE DECLARATION ]
##
@ -3803,7 +3831,7 @@ content <type>'
source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LPAREN LIDENT CONTENT UIDENT RPAREN YEAR
##
## Ends in an error in state: 446.
## Ends in an error in state: 598.
##
## code_item -> DECLARATION lident CONTENT typ_data DEPENDS LPAREN separated_nonempty_list(COMMA,var_content) RPAREN . option(opt_def) [ SCOPE END_CODE DECLARATION ]
##
@ -3815,7 +3843,7 @@ expected 'equals <expression>'
source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LPAREN LIDENT CONTENT UIDENT RPAREN DEFINED_AS YEAR
##
## Ends in an error in state: 447.
## Ends in an error in state: 599.
##
## option(opt_def) -> DEFINED_AS . expression [ SCOPE END_CODE DECLARATION ]
##
@ -3878,7 +3906,7 @@ expected the definition of another argument in the form '<var> content <type>'
source_file: BEGIN_CODE DECLARATION LIDENT CONTENT UIDENT DEPENDS LIDENT CONTENT UIDENT DEFINED_AS FALSE YEAR
##
## Ends in an error in state: 448.
## Ends in an error in state: 600.
##
## expression -> expression . DOT qlident [ XOR WITH SCOPE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL END_CODE DOT DIV DECLARATION CONTAINS AND ]
## expression -> expression . OF funcall_args [ XOR WITH SCOPE PLUSPLUS PLUS OR OF NOT_EQUAL MULT MINUS LESSER_EQUAL LESSER GREATER_EQUAL GREATER FOR EQUAL END_CODE DOT DIV DECLARATION CONTAINS AND ]
@ -3912,7 +3940,7 @@ expected a binary operator continuing the expression, or a keyword ending the ex
source_file: BEGIN_DIRECTIVE YEAR
##
## Ends in an error in state: 460.
## Ends in an error in state: 612.
##
## source_file_item -> BEGIN_DIRECTIVE . directive END_DIRECTIVE [ LAW_TEXT LAW_HEADING EOF BEGIN_METADATA BEGIN_DIRECTIVE BEGIN_CODE ]
##
@ -3924,7 +3952,7 @@ expected a directive, e.g. 'Include: <filename>'
source_file: BEGIN_DIRECTIVE LAW_INCLUDE YEAR
##
## Ends in an error in state: 470.
## Ends in an error in state: 622.
##
## directive -> LAW_INCLUDE . COLON nonempty_list(DIRECTIVE_ARG) option(AT_PAGE) [ END_DIRECTIVE ]
##
@ -3936,7 +3964,7 @@ expected ':', then a file name or 'JORFTEXTNNNNNNNNNNNN'
source_file: BEGIN_DIRECTIVE LAW_INCLUDE COLON YEAR
##
## Ends in an error in state: 471.
## Ends in an error in state: 623.
##
## directive -> LAW_INCLUDE COLON . nonempty_list(DIRECTIVE_ARG) option(AT_PAGE) [ END_DIRECTIVE ]
##
@ -3948,7 +3976,7 @@ expected a file name or 'JORFTEXTNNNNNNNNNNNN'
source_file: BEGIN_DIRECTIVE LAW_INCLUDE COLON DIRECTIVE_ARG YEAR
##
## Ends in an error in state: 472.
## Ends in an error in state: 624.
##
## nonempty_list(DIRECTIVE_ARG) -> DIRECTIVE_ARG . [ END_DIRECTIVE AT_PAGE ]
## nonempty_list(DIRECTIVE_ARG) -> DIRECTIVE_ARG . nonempty_list(DIRECTIVE_ARG) [ END_DIRECTIVE AT_PAGE ]
@ -3961,7 +3989,7 @@ expected a page specification in the form '@p.<number>', or a newline
source_file: BEGIN_DIRECTIVE LAW_INCLUDE COLON DIRECTIVE_ARG AT_PAGE YEAR
##
## Ends in an error in state: 477.
## Ends in an error in state: 629.
##
## source_file_item -> BEGIN_DIRECTIVE directive . END_DIRECTIVE [ LAW_TEXT LAW_HEADING EOF BEGIN_METADATA BEGIN_DIRECTIVE BEGIN_CODE ]
##
@ -3973,7 +4001,7 @@ expected a newline
source_file: LAW_HEADING YEAR
##
## Ends in an error in state: 482.
## Ends in an error in state: 634.
##
## source_file -> source_file_item . source_file [ # ]
##

View File

@ -72,9 +72,9 @@ let scope Foo (y: integer|input) (x: integer|internal|output) =
| true ⊢ ⟨ ⟨y = 2 ⊢ ⟨2⟩⟩, ⟨y = 3 ⊢ ⟨3⟩⟩ | false ⊢ ∅ ⟩ ⟩
| true ⊢ ⟨ ⟨y = 0 ⊢ ⟨0⟩⟩, ⟨y = 1 ⊢ ⟨1⟩⟩ | false ⊢ ∅ ⟩ ⟩
let scope Test (x: integer|internal|output) =
let f.y : integer = error_empty ⟨ ⟨true ⊢ ⟨2⟩⟩ | false ⊢ ∅ ⟩;
call Foo[f];
let scope Test (x: integer|internal|output) (f: Foo {x: integer}|internal) =
let f : Foo {x: integer} =
Foo of {"y"= error_empty ⟨ ⟨true ⊢ ⟨2⟩⟩ | false ⊢ ∅ ⟩};
let x : integer = error_empty ⟨ ⟨true ⊢ ⟨f.x⟩⟩ | false ⊢ ∅ ⟩
```

View File

@ -28,15 +28,15 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala Lcalc -s T --avoid-exceptions -O --closure-conversion
let scope T (T_in: T_in): T {y: integer} =
let sub_set s.x : bool = false in
let call result : S {f: ((closure_env, integer) → integer * closure_env)}
=
S { S_in x_in = s.x; }
let set s : S {f: ((closure_env, integer) → integer * closure_env)} =
{ S f = (closure_s, to_closure_env ()); }
in
let sub_get s.f : ((closure_env, integer) → integer * closure_env) =
result.f
let set y : integer =
let code_and_env : ((closure_env, integer) → integer * closure_env) =
s.f
in
code_and_env.0 code_and_env.1 2
in
let set y : integer = s.f.0 s.f.1 2 in
return { T y = y; }
```

View File

@ -19,20 +19,40 @@ scope B:
```catala-test-inline
$ catala Typecheck --check-invariants
[WARNING] Unused varible: a does not contribute to computing any of scope B outputs. Did you forget something?
┌─⯈ tests/func/good/context_func.catala_en:9.3-9.4:
└─┐
9 │ a scope A
│ ‾
└─ Test
[RESULT] All invariant checks passed
[RESULT] Typechecking successful!
```
```catala-test-inline
$ catala Scopelang -s B
let scope B (b: bool|input) =
let a.f : integer → ⟨integer⟩ = λ (x: integer) →
⟨ ⟨b && x > 0 ⊢ ⟨x - 1⟩⟩ | false ⊢ ∅ ⟩;
call A[a]
[WARNING] Unused varible: a does not contribute to computing any of scope B outputs. Did you forget something?
┌─⯈ tests/func/good/context_func.catala_en:9.3-9.4:
└─┐
9 │ a scope A
│ ‾
└─ Test
let scope B (b: bool|input) (a: A {f: integer → integer}|internal) =
let a : A {f: integer → integer} =
A of {"f"= (λ (x: integer) → ⟨ ⟨b && x > 0 ⊢ ⟨x - 1⟩⟩ | false ⊢ ∅ ⟩)}
```
```catala-test-inline
$ catala Dcalc -s A
[WARNING] Unused varible: a does not contribute to computing any of scope B outputs. Did you forget something?
┌─⯈ tests/func/good/context_func.catala_en:9.3-9.4:
└─┐
9 │ a scope A
│ ‾
└─ Test
let scope A
(A_in: A_in {f_in: integer → ⟨integer⟩})
: A {f: integer → integer}
@ -48,13 +68,24 @@ let scope A
```catala-test-inline
$ catala Dcalc -s B
[WARNING] Unused varible: a does not contribute to computing any of scope B outputs. Did you forget something?
┌─⯈ tests/func/good/context_func.catala_en:9.3-9.4:
└─┐
9 │ a scope A
│ ‾
└─ Test
let scope B (B_in: B_in {b_in: bool}): B =
let get b : bool = B_in.b_in in
let sub_set a.f : integer → ⟨integer⟩ =
λ (x: integer) →
⟨ ⟨b && x > 0 ⊢ ⟨x - 1⟩⟩ | false ⊢ ∅ ⟩
let set a : A {f: integer → integer} =
let result : A =
A
{ A_in
f_in = λ (x: integer) → ⟨ ⟨b && x > 0 ⊢ ⟨x - 1⟩⟩ | false ⊢ ∅ ⟩;
}
in
let result1 : A = { A f = λ (param0: integer) → result.f param0; } in
if true then result1 else result1
in
let call result : A {f: integer → integer} = A { A_in f_in = a.f; } in
let sub_get a.f : integer → integer = result.f in
return {B}
```

View File

@ -17,7 +17,7 @@ scope B:
```catala-test-inline
$ catala Typecheck
[ERROR]
It is impossible to give a definition to a subscope variable not tagged as input or context.
Invalid assignment to a subscope variable that is not tagged as input or context.
Incriminated subscope:
┌─⯈ tests/io/bad/inputing_to_not_input.catala_en:8.3-8.4:

View File

@ -15,35 +15,21 @@ scope B:
```
```catala-test-inline
$ catala Typecheck
[WARNING] This variable is dead code; it does not contribute to computing any of scope "A" outputs. Did you forget something?
┌─⯈ tests/io/bad/using_non_output.catala_en:5.12-5.13:
└─┐
5 │ internal a content integer
│ ‾
└─ Test
[ERROR]
The variable a.a cannot be used here, as it is not part of subscope a's results. Maybe you forgot to qualify it as an output?
Variable a is not a declared output of scope A.
Incriminated variable usage:
a is used here as an output
┌─⯈ tests/io/bad/using_non_output.catala_en:14.13-14.16:
└──┐
14 │ assertion a.a = 0
│ ‾‾‾
└─ Test
Incriminated subscope variable declaration:
┌─⯈ tests/io/bad/using_non_output.catala_en:5.12-5.13:
Scope A is declared here
┌─⯈ tests/io/bad/using_non_output.catala_en:4.19-4.20:
└─┐
5 │ internal a content integer
│ ‾
└─ Test
Incriminated subscope declaration:
┌─⯈ tests/io/bad/using_non_output.catala_en:8.3-8.4:
└─┐
8 │ a scope A
│ ‾
4 │ declaration scope A:
│ ‾
└─ Test
#return code 123#
```

View File

@ -25,9 +25,13 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala Dcalc -s B
let scope B (B_in: B_in): B =
let sub_set a.x : bool = error_empty ⟨ ⟨true ⊢ ⟨false⟩⟩ | false ⊢ ∅ ⟩ in
let call result : A {y: integer} = A { A_in x_in = a.x; } in
let sub_get a.y : integer = result.y in
let set a : A {y: integer} =
let result : A =
A { A_in x_in = error_empty ⟨ ⟨true ⊢ ⟨false⟩⟩ | false ⊢ ∅ ⟩; }
in
let result1 : A = { A y = result.y; } in
if true then result1 else result1
in
let assert _ : unit = assert ((a.y = 1)) in
return {B}
```

View File

@ -31,10 +31,17 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala Dcalc -s B
let scope B (B_in: B_in): B =
let sub_set a.a : unit → ⟨integer⟩ = λ () → ∅ in
let sub_set a.b : integer = error_empty ⟨ ⟨true ⊢ ⟨2⟩⟩ | false ⊢ ∅ ⟩ in
let call result : A {c: integer} = A { A_in a_in = a.a; b_in = a.b; } in
let sub_get a.c : integer = result.c in
let set a : A {c: integer} =
let result : A =
A
{ A_in
a_in = λ () → ∅;
b_in = error_empty ⟨ ⟨true ⊢ ⟨2⟩⟩ | false ⊢ ∅ ⟩;
}
in
let result1 : A = { A c = result.c; } in
if true then result1 else result1
in
let assert _ : unit = assert ((a.c = 1)) in
return {B}
```

View File

@ -55,6 +55,13 @@ scope S2:
```catala-test-inline
$ catala test-scope S2
[WARNING] Unused varible: x does not contribute to computing any of scope S2 outputs. Did you forget something?
┌─⯈ tests/name_resolution/good/let_in.catala_en:47.4-47.5:
└──┐
47 │ x scope S
│ ‾
└─ Check scope of let-in vs scope variable
[RESULT] Computation successful! Results:
[RESULT] y = 1
```

View File

@ -124,7 +124,7 @@ scope Amount:
```catala-test-inline
$ catala Proof --disable-counterexamples
[ERROR]
It is impossible to give a definition to a subscope variable not tagged as input or context.
Invalid assignment to a subscope variable that is not tagged as input or context.
Incriminated subscope:
┌─⯈ tests/proof/bad/prolala_motivating_example.catala_en:56.3-56.14:

View File

@ -16,12 +16,12 @@ scope B:
```catala-test-inline
$ catala test-scope A
[ERROR]
The subscope a is used when defining one of its inputs, but recursion is forbidden in Catala
The variable a.y is used in one of its definitions, but recursion is forbidden in Catala
┌─⯈ tests/scope/bad/sub_vars_in_sub_var.catala_en:13.28-13.31:
┌─⯈ tests/scope/bad/sub_vars_in_sub_var.catala_en:13.28-13.29:
└──┐
13 │ definition a.y equals if a.x then 0 else 1
│ ‾‾‾
│ ‾
└─ Article
#return code 123#
```

View File

@ -25,7 +25,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala OCaml -O
Generating entry points for scopes: ScopeA ScopeB
(** This file has been generated by the Catala compiler, do not edit! *)
@ -56,9 +55,8 @@ let scope_a (scope_a_in: ScopeA_in.t) : ScopeA.t =
{ScopeA.a = a_}
let scope_b (scope_b_in: ScopeB_in.t) : ScopeB.t =
let result_: ScopeA.t = scope_a (()) in
let scope_a_dot_a_: bool = result_.ScopeA.a in
let a_: bool = scope_a_dot_a_ in
let scope_a_: ScopeA.t = {ScopeA.a = ((scope_a (())).ScopeA.a)} in
let a_: bool = scope_a_.ScopeA.a in
{ScopeB.a = a_}

View File

@ -20,8 +20,14 @@ scope S:
```catala-test-inline
$ catala test-scope S
[WARNING] Unused varible: a does not contribute to computing any of scope S outputs. Did you forget something?
┌─⯈ tests/scope/good/local-capture-subscope.catala_en:7.3-7.4:
└─┐
7 │ a scope A
│ ‾
[RESULT] Computation successful! Results:
[RESULT] so = 99
[RESULT] so = 42
```

View File

@ -21,12 +21,7 @@ scope B:
```catala-test-inline
$ catala test-scope B
[ERROR]
"a": unknown identifier for a local, scope-wide or global variable
┌─⯈ tests/scope/good/out_sub_scope.catala_en:18.23-18.24:
└──┐
18 │ definition b equals a.o
│ ‾
#return code 123#
[RESULT] Computation successful! Results:
[RESULT] a = A { -- o: 99 -- io: 100 }
[RESULT] b = 99
```

View File

@ -22,12 +22,24 @@ scope Titi:
```catala-test-inline
$ catala Typecheck --check-invariants
[WARNING] Unused varible: toto does not contribute to computing any of scope Titi outputs. Did you forget something?
┌─⯈ tests/scope/good/scope_call2.catala_en:13.3-13.7:
└──┐
13 │ toto scope Toto
│ ‾‾‾‾
[RESULT] All invariant checks passed
[RESULT] Typechecking successful!
```
```catala-test-inline
$ catala test-scope Titi
[WARNING] Unused varible: toto does not contribute to computing any of scope Titi outputs. Did you forget something?
┌─⯈ tests/scope/good/scope_call2.catala_en:13.3-13.7:
└──┐
13 │ toto scope Toto
│ ‾‾‾‾
[RESULT] Computation successful! Results:
[RESULT] fizz = Toto { -- foo: 1,213 }
[RESULT] fuzz = Toto { -- foo: 1,323 }

View File

@ -21,7 +21,6 @@ scope B:
definition a equals 42
definition b equals scopeA.b
definition scopeA.a under condition a > 0 consequence equals scopeAbis.a_base
definition scopeA.a under condition a > 10 consequence equals 0
```

View File

@ -34,12 +34,40 @@ scope C:
```catala-test-inline
$ catala Typecheck --check-invariants
[WARNING] Unused varible: a does not contribute to computing any of scope C outputs. Did you forget something?
┌─⯈ tests/scope/good/sub_sub_scope.catala_en:14.3-14.4:
└──┐
14 │ a scope A
│ ‾
└─ Article
[WARNING] Unused varible: b does not contribute to computing any of scope C outputs. Did you forget something?
┌─⯈ tests/scope/good/sub_sub_scope.catala_en:15.3-15.4:
└──┐
15 │ b scope B
│ ‾
└─ Article
[RESULT] All invariant checks passed
[RESULT] Typechecking successful!
```
```catala-test-inline
$ catala test-scope A
[WARNING] Unused varible: a does not contribute to computing any of scope C outputs. Did you forget something?
┌─⯈ tests/scope/good/sub_sub_scope.catala_en:14.3-14.4:
└──┐
14 │ a scope A
│ ‾
└─ Article
[WARNING] Unused varible: b does not contribute to computing any of scope C outputs. Did you forget something?
┌─⯈ tests/scope/good/sub_sub_scope.catala_en:15.3-15.4:
└──┐
15 │ b scope B
│ ‾
└─ Article
[RESULT] Computation successful! Results:
[RESULT] u = true
[RESULT] x = 0
@ -47,12 +75,40 @@ $ catala test-scope A
```catala-test-inline
$ catala test-scope B
[WARNING] Unused varible: a does not contribute to computing any of scope C outputs. Did you forget something?
┌─⯈ tests/scope/good/sub_sub_scope.catala_en:14.3-14.4:
└──┐
14 │ a scope A
│ ‾
└─ Article
[WARNING] Unused varible: b does not contribute to computing any of scope C outputs. Did you forget something?
┌─⯈ tests/scope/good/sub_sub_scope.catala_en:15.3-15.4:
└──┐
15 │ b scope B
│ ‾
└─ Article
[RESULT] Computation successful! Results:
[RESULT] y = 1
```
```catala-test-inline
$ catala test-scope C
[WARNING] Unused varible: a does not contribute to computing any of scope C outputs. Did you forget something?
┌─⯈ tests/scope/good/sub_sub_scope.catala_en:14.3-14.4:
└──┐
14 │ a scope A
│ ‾
└─ Article
[WARNING] Unused varible: b does not contribute to computing any of scope C outputs. Did you forget something?
┌─⯈ tests/scope/good/sub_sub_scope.catala_en:15.3-15.4:
└──┐
15 │ b scope B
│ ‾
└─ Article
[RESULT] Computation successful! Results:
[RESULT] z = 2
```

View File

@ -20,7 +20,8 @@ scope A:
```catala-test-inline
$ catala test-scope A
[ERROR]
Field "g" does not belong to structure "Foo", but to "Bar"
Field "g" does not belong to structure "Foo"
(however, structure "Bar" defines it)
┌─⯈ tests/struct/bad/wrong_qualified_field.catala_en:17.23-17.30:
└──┐

View File

@ -31,7 +31,7 @@ $ catala Typecheck --check-invariants
└──┐
15 │ output a content decimal
│ ‾
[WARNING] This variable is dead code; it does not contribute to computing any of scope "S" outputs. Did you forget something?
[WARNING] Unused varible: x does not contribute to computing any of scope S outputs. Did you forget something?
┌─⯈ tests/typing/good/common.catala_en:12.9-12.10:
└──┐

View File

@ -17,7 +17,7 @@ scope A:
```catala-test-inline
$ catala Typecheck
[ERROR]
Unknown label for the scope variable foo.baz: "thing"
Unknown label for the scope variable foo@baz: "thing"
┌─⯈ tests/variable_state/bad/no_cross_exceptions.catala_en:14.13-14.18:
└──┐