From b78cd9c29a9a3926eb644e0de668c46e0c6a3a0e Mon Sep 17 00:00:00 2001 From: Louis Gesbert Date: Wed, 10 Apr 2024 17:33:19 +0200 Subject: [PATCH] Improve message formatting throughout Ensuring messages don't print overlong lines still requires some manual work: - if they don't contain any `Format` directives (`%` or `@`), use `"%a" Format.pp_print_text` to turn word-wrapping on. - otherwise replace spaces with `@ ` to mark possible cutting points, as soon that it's possible the line will get over 80 chars (most often, this means starting before the first `%a`) --- compiler/catala_utils/message.ml | 19 +---- compiler/desugared/dependency.ml | 17 ++-- compiler/desugared/from_surface.ml | 44 +++++----- compiler/desugared/linting.ml | 24 +++--- compiler/desugared/name_resolution.ml | 23 +++--- compiler/scopelang/dependency.ml | 20 ++--- compiler/scopelang/from_desugared.ml | 6 +- compiler/shared_ast/interpreter.ml | 81 ++++++++++--------- compiler/shared_ast/typing.ml | 10 +-- compiler/surface/parser_driver.ml | 46 +++++------ .../arithmetic/bad/division_by_zero.catala_en | 12 +-- tests/arithmetic/bad/logical_prio.catala_en | 4 +- tests/array/bad/fold_error.catala_en | 4 +- tests/bool/bad/bad_assert.catala_en | 7 +- tests/bool/bad/test_xor_with_int.catala_en | 7 +- .../bad/rounding_option_conflict.catala_en | 3 +- tests/date/bad/substraction.catala_en | 4 +- .../date/bad/uncomparable_duration.catala_en | 16 ++-- tests/default/bad/empty.catala_en | 7 +- tests/default/bad/empty_with_rules.catala_en | 4 +- .../bad/typing_or_logical_error.catala_en | 21 ++--- .../good/mutliple_definitions.catala_en | 6 +- tests/enum/bad/ambiguous_cases.catala_en | 4 +- tests/enum/bad/ambiguous_wildcard.catala_en | 4 +- tests/enum/bad/duplicate_case.catala_en | 3 +- tests/enum/bad/empty.catala_en | 4 +- tests/enum/bad/missing_case.catala_en | 6 +- tests/enum/bad/not_ending_wildcard.catala_en | 6 +- tests/enum/bad/quick_pattern_2.catala_en | 7 +- tests/enum/bad/quick_pattern_3.catala_en | 7 +- tests/enum/bad/quick_pattern_4.catala_en | 7 +- tests/enum/bad/quick_pattern_fail.catala_en | 5 +- tests/enum/bad/too_many_cases.catala_en | 4 +- tests/enum/bad/useless_wildcard.catala_en | 3 +- tests/enum/bad/wrong_cons.catala_en | 5 +- .../ambiguous_unlabeled_exception.catala_en | 4 +- .../bad/dangling_exception.catala_en | 3 +- .../exception/bad/exceptions_cycle.catala_en | 5 +- .../missing_unlabeled_definition.catala_en | 3 +- .../bad/one_ambiguous_exception.catala_en | 4 +- tests/exception/bad/self_exception.catala_en | 3 +- tests/exception/bad/two_exceptions.catala_en | 4 +- .../good/double_definition.catala_en | 9 ++- tests/func/bad/bad_func.catala_en | 4 +- tests/func/bad/param_inconsistency.catala_en | 4 +- tests/func/bad/param_inconsistency2.catala_en | 4 +- tests/func/bad/param_inconsistency3.catala_en | 4 +- tests/func/bad/recursive.catala_en | 4 +- tests/func/good/context_func.catala_en | 12 ++- tests/io/bad/forgot_input.catala_en | 4 +- tests/io/bad/inputing_to_not_input.catala_en | 4 +- tests/io/bad/redefining_input.catala_en | 3 +- tests/io/bad/using_non_output.catala_en | 3 +- tests/modules/bad/mod_bad_include.catala_en | 5 +- tests/modules/bad/mod_badname.catala_en | 9 +-- tests/money/bad/no_mingle.catala_en | 4 +- .../bad/toplevel_defs.catala_en | 3 +- tests/name_resolution/good/let_in.catala_en | 3 +- .../proof/bad/dates_get_year-empty.catala_en | 3 +- tests/proof/bad/enums-empty.catala_en | 3 +- tests/proof/bad/enums-nonbool-empty.catala_en | 3 +- .../proof/bad/enums-nonbool-overlap.catala_en | 3 +- tests/proof/bad/enums-overlap.catala_en | 3 +- tests/proof/bad/enums_inj-empty.catala_en | 3 +- .../bad/prolala_motivating_example.catala_en | 4 +- tests/proof/good/enums-arith.catala_en | 6 +- tests/proof/good/enums-nonbool.catala_en | 6 +- tests/proof/good/enums.catala_en | 6 +- tests/scope/bad/cycle_in_scope.catala_en | 3 +- tests/scope/bad/cyclic_scope_calls.catala_en | 3 +- tests/scope/bad/cyclic_scopes.catala_en | 4 +- tests/scope/bad/scope.catala_en | 4 +- .../scope/bad/scope_call_duplicate.catala_en | 3 +- tests/scope/bad/scope_call_extra.catala_en | 3 +- tests/scope/bad/scope_call_missing.catala_en | 3 +- tests/scope/bad/sub_vars_in_sub_var.catala_en | 4 +- .../good/local-capture-subscope.catala_en | 3 +- tests/scope/good/nothing.catala_en | 6 +- tests/scope/good/scope_call2.catala_en | 6 +- tests/scope/good/sub_sub_scope.catala_en | 24 ++++-- tests/struct/bad/bug_107.catala_en | 3 +- tests/struct/bad/empty_struct.catala_en | 4 +- tests/struct/bad/nested.catala_en | 7 +- tests/struct/bad/nested2.catala_en | 6 +- tests/struct/bad/nonexisting_struct.catala_en | 3 +- .../bad/wrong_qualified_field.catala_en | 6 +- tests/typing/bad/err1.catala_en | 7 +- tests/typing/bad/err2.catala_en | 7 +- tests/typing/bad/err3.catala_en | 20 ++--- tests/typing/bad/err4.catala_en | 13 +-- tests/typing/bad/err5.catala_en | 7 +- tests/typing/bad/err6.catala_en | 7 +- tests/typing/good/common.catala_en | 9 ++- .../variable_state/bad/def_no_state.catala_en | 4 +- .../bad/double_same_state.catala_en | 4 +- .../bad/no_cross_exceptions.catala_en | 3 +- .../bad/self_reference_first_state.catala_en | 4 +- .../variable_state/bad/state_cycle.catala_en | 3 +- .../bad/unknown_state.catala_en | 3 +- 99 files changed, 382 insertions(+), 399 deletions(-) diff --git a/compiler/catala_utils/message.ml b/compiler/catala_utils/message.ml index 47aa05f6..47656321 100644 --- a/compiler/catala_utils/message.ml +++ b/compiler/catala_utils/message.ml @@ -145,19 +145,13 @@ module Content = struct content @ [Position { pos = position; pos_message = message }] let of_string (s : string) : t = - [ - MainMessage - (fun ppf -> - Format.pp_open_hovbox ppf 0; - Format.pp_print_text ppf s; - Format.pp_close_box ppf ()); - ] + [MainMessage (fun ppf -> Format.pp_print_text ppf s)] let emit (content : t) (target : level) : unit = match Global.options.message_format with | Global.Human -> let ppf = get_ppf target in - Format.pp_open_hvbox ppf 0; + Format.pp_open_vbox ppf 0; Format.pp_print_list ~pp_sep:(fun ppf () -> Format.fprintf ppf "@,@,") (fun ppf -> function @@ -167,14 +161,9 @@ module Content = struct pos.pos_message; Pos.format_loc_text ppf pos.pos | MainMessage msg -> - Format.fprintf ppf "%t%t%t" (pp_marker target) - (fun ppf -> - match target with - | Result | Error -> Format.pp_print_space ppf () - | _ -> Format.pp_print_char ppf ' ') - msg + Format.fprintf ppf "@[%t %t@]" (pp_marker target) msg | Outcome msg -> - Format.fprintf ppf "@[%t@ %t@]" (pp_marker target) msg + Format.fprintf ppf "@[%t@ %t@]" (pp_marker target) msg | Suggestion suggestions_list -> Suggestions.format ppf suggestions_list) ppf content; diff --git a/compiler/desugared/dependency.ml b/compiler/desugared/dependency.ml index 1630f938..51490cdf 100644 --- a/compiler/desugared/dependency.ml +++ b/compiler/desugared/dependency.ml @@ -142,8 +142,8 @@ let check_for_cycle (scope : Ast.scope) (g : ScopeDependencies.t) : unit = (List.tl cycle @ [List.hd cycle]) in Message.error ~extra_pos - "@[Cyclic dependency detected between the following variables of \ - scope %a:@ @[%a@]@]" + "Cyclic dependency detected between the following variables of scope \ + %a:@ @[%a@]" ScopeName.format scope.scope_uid (Format.pp_print_list ~pp_sep:(fun ppf () -> Format.fprintf ppf " →@ ") @@ -197,13 +197,13 @@ let build_scope_dependencies (scope : Ast.scope) : ScopeDependencies.t = match def_key with | _, Ast.ScopeDef.Var _ -> Message.error ~pos:fv_def_pos - "The variable %a is used in one of its definitions, but \ - recursion is forbidden in Catala" + "The variable@ %a@ is@ used@ in@ one@ of@ its@ \ + definitions@ (Catala doesn't support recursion)" Ast.ScopeDef.format def_key | v, Ast.ScopeDef.SubScopeInput _ -> Message.error ~pos:fv_def_pos - "The subscope %a is used in the definition of its own \ - input %a, but recursion is forbidden in Catala" + "The subscope@ %a@ is@ used@ in@ the@ definition@ of@ its@ \ + own@ input@ %a@ (Catala doesn't support recursion)" ScopeVar.format (Mark.remove v) Ast.ScopeDef.format def_key in ScopeDependencies.add_edge_e g @@ -499,6 +499,7 @@ let check_for_exception_cycle in let v, _ = RuleName.Map.choose (List.hd scc).rules in Message.error ~extra_pos:spans - "Exception cycle detected when defining %a: each of these %d exceptions \ - applies over the previous one, and the first applies over the last" + "Exception cycle detected when defining@ %a:@ each of these %d \ + exceptions applies over the previous one,@ and@ the@ first@ applies@ \ + over@ the@ last" RuleName.format v (List.length scc) diff --git a/compiler/desugared/from_surface.ml b/compiler/desugared/from_surface.ml index 228a1390..a9b162f5 100644 --- a/compiler/desugared/from_surface.ml +++ b/compiler/desugared/from_surface.ml @@ -174,8 +174,8 @@ let rec disambiguate_constructor | [] -> if EnumName.Map.cardinal possible_c_uids > 1 then Message.error ~pos:(Mark.get constructor) - "This constructor name is ambiguous, it can belong to %a. Disambiguate \ - it by prefixing it with the enum name." + "This constructor name is ambiguous, it can belong to@ %a.@ \ + Disambiguate it by prefixing it with the enum name." (EnumName.Map.format_keys ~pp_sep:(fun fmt () -> Format.pp_print_string fmt " or ")) possible_c_uids; @@ -187,8 +187,8 @@ let rec disambiguate_constructor let c_uid = EnumName.Map.find e_uid possible_c_uids in e_uid, c_uid with EnumName.Map.Not_found _ -> - Message.error ~pos "Enum %s does not contain case %s" (Mark.remove enum) - (Mark.remove constructor)) + Message.error ~pos "Enum %s@ does@ not@ contain@ case@ %s" + (Mark.remove enum) (Mark.remove constructor)) | mod_id :: path -> let constructor = List.map (Mark.map (fun (_, c) -> path, c)) constructor0 @@ -212,6 +212,7 @@ let rec check_formula (op, pos_op) e = true]) *) Message.error ~extra_pos:["", pos_op; "", pos_op1] + "%a" Format.pp_print_text "Please add parentheses to explicit which of these operators should be \ applied first"; check_formula (op1, pos_op1) e1; @@ -401,18 +402,19 @@ let rec translate_expr (* TODO *) Message.error ~pos:(Mark.get (Option.get st)) + "%a" Format.pp_print_text "Referring to a previous state of the variable being defined \ is not supported at the moment."; match sx' with | None -> - failwith + Message.error ~internal:true "inconsistent state: inside a definition of a variable with no \ state but variable has states" | Some inside_def_state -> if StateName.compare inside_def_state (List.hd states) = 0 then - Message.error ~pos - "It is impossible to refer to the variable you are defining \ - when defining its first state." + Message.error ~pos "%a" Format.pp_print_text + "The definition of the initial state of this variable refers \ + to itself." else (* Tricky: we have to retrieve in the list the previous state with respect to the state that we are defining. *) @@ -635,8 +637,8 @@ let rec translate_expr EnumName.Map.cardinal possible_c_uids > 1 then Message.error ~pos:pos_constructor - "This constructor name is ambiguous, it can belong to %a. \ - Desambiguate it by prefixing it with the enum name." + "This constructor name is ambiguous, it can belong to@ %a.@ \ + Disambiguate it by prefixing it with the enum name." (EnumName.Map.format_keys ~pp_sep:(fun fmt () -> Format.fprintf fmt " or ")) possible_c_uids @@ -963,8 +965,9 @@ and disambiguate_match_and_build_expression else Message.error ~pos:(Mark.get case.S.match_case_pattern) - "This case matches a constructor of enumeration %a but previous \ - case were matching constructors of enumeration %a" + "This case matches a constructor of enumeration@ %a@ but@ \ + previous@ cases@ were@ matching@ constructors@ of@ enumeration@ \ + %a" EnumName.format e_uid EnumName.format e_uid' in (match EnumConstructor.Map.find_opt c_uid cases_d with @@ -972,8 +975,8 @@ and disambiguate_match_and_build_expression | Some e_case -> Message.error ~extra_pos:["", Mark.get case.match_case_expr; "", Expr.pos e_case] - "The constructor %a has been matched twice:" EnumConstructor.format - c_uid); + "The constructor %a@ has@ been@ matched@ twice:" + EnumConstructor.format c_uid); let local_vars, param_var = create_var local_vars (Option.map Mark.remove binding) in @@ -1001,7 +1004,7 @@ and disambiguate_match_and_build_expression match e_uid with | None -> if 1 = nb_cases then - Message.error ~pos:case_pos + Message.error ~pos:case_pos "%a" Format.pp_print_text "Couldn't infer the enumeration name from lonely wildcard \ (wildcard cannot be used as single match case)" else raise_wildcard_not_last_case_err () @@ -1016,8 +1019,8 @@ and disambiguate_match_and_build_expression in if EnumConstructor.Map.is_empty missing_constructors then Message.warning ~pos:case_pos - "Unreachable match case, all constructors of the enumeration %a \ - are already specified" + "Unreachable match case, all constructors of the enumeration@ %a@ \ + are@ already@ specified" EnumName.format e_uid; (* The current used strategy is to replace the wildcard branch: match foo with @@ -1093,8 +1096,8 @@ let rec arglist_eq_check pos_decl pos_def pdecl pdefs = Message.error ~extra_pos: ["Argument declared here:", decl_apos; "Defined here:", def_apos] - "Function argument name mismatch between declaration ('%a') and \ - definition ('%a')" + "Function argument name mismatch between declaration@ ('%a')@ and@ \ + definition@ ('%a')" Print.lit_style decl_arg Print.lit_style def_arg let process_rule_parameters @@ -1114,7 +1117,7 @@ let process_rule_parameters "Declared here without arguments", decl_pos; "Unexpected arguments appearing here", pos; ] - "Extra arguments in this definition of %a" Ast.ScopeDef.format decl_name + "Extra arguments in this definition of@ %a" Ast.ScopeDef.format decl_name | Some (_, pos), None -> Message.error ~extra_pos: @@ -1395,6 +1398,7 @@ let check_unlabeled_exception Message.error ~pos:(Mark.get item) ~pos_msg:(fun ppf -> Format.pp_print_text ppf "Ambiguous exception") ~extra_pos:(List.map (fun p -> "Candidate definition", p) pos) + "%a" Format.pp_print_text "This exception can refer to several definitions. Try using labels \ to disambiguate" | Some (Unique _) -> ())) diff --git a/compiler/desugared/linting.ml b/compiler/desugared/linting.ml index cbb314a4..c4e24dc9 100644 --- a/compiler/desugared/linting.ml +++ b/compiler/desugared/linting.ml @@ -39,8 +39,8 @@ let detect_empty_definitions (p : program) : unit = then Message.warning ~pos:(ScopeDef.get_position scope_def_key) - "In scope \"%a\", the variable \"%a\" is declared but never \ - defined; did you forget something?" + "In scope \"%a\",@ the@ variable@ \"%a\"@ is@ declared@ but@ \ + never@ defined;@ did you forget something?" ScopeName.format scope_name Ast.ScopeDef.format scope_def_key) scope.scope_defs) p.program_root.module_scopes @@ -95,8 +95,8 @@ let detect_identical_rules (p : program) : unit = (fun _ pos -> if List.length pos > 1 then Message.warning ~extra_pos:pos - "These %s have identical justifications and consequences; is \ - it a mistake?" + "These %s have identical justifications@ and@ consequences;@ \ + is it a mistake?" (if scope_def.scope_def_is_condition then "rules" else "definitions")) rules_seen) @@ -155,7 +155,7 @@ let detect_unused_struct_fields (p : program) : unit = then Message.warning ~pos:(snd (StructName.get_info s_name)) - "The structure \"%a\" is never used; maybe it's unnecessary?" + "The structure@ \"%a\"@ is@ never@ used;@ maybe it's unnecessary?" StructName.format s_name else StructField.Map.iter @@ -166,8 +166,8 @@ let detect_unused_struct_fields (p : program) : unit = then Message.warning ~pos:(snd (StructField.get_info field)) - "The field \"%a\" of struct @{\"%a\"@} is never \ - used; maybe it's unnecessary?" + "The field@ \"%a\"@ of@ struct@ @{\"%a\"@}@ is@ \ + never@ used;@ maybe it's unnecessary?" StructField.format field StructName.format s_name) fields) p.program_ctx.ctx_structs @@ -213,7 +213,7 @@ let detect_unused_enum_constructors (p : program) : unit = then Message.warning ~pos:(snd (EnumName.get_info e_name)) - "The enumeration \"%a\" is never used; maybe it's unnecessary?" + "The enumeration@ \"%a\"@ is@ never@ used;@ maybe it's unnecessary?" EnumName.format e_name else EnumConstructor.Map.iter @@ -223,8 +223,8 @@ let detect_unused_enum_constructors (p : program) : unit = then Message.warning ~pos:(snd (EnumConstructor.get_info constructor)) - "The constructor \"%a\" of enumeration \"%a\" is never used; \ - maybe it's unnecessary?" + "The constructor@ \"%a\"@ of@ enumeration@ \"%a\"@ is@ \ + never@ used;@ maybe it's unnecessary?" EnumConstructor.format constructor EnumName.format e_name) constructors) p.program_ctx.ctx_enums @@ -268,8 +268,8 @@ let detect_dead_code (p : program) : unit = let emit_unused_warning vx = Message.warning ~pos:(Mark.get (Dependency.Vertex.info vx)) - "Unused varible: %a does not contribute to computing any of scope %a \ - outputs. Did you forget something?" + "Unused varible:@ %a@ does@ not@ contribute@ to@ computing@ any@ of@ \ + scope@ %a@ outputs.@ Did you forget something?" Dependency.Vertex.format vx ScopeName.format scope_name in Dependency.ScopeDependencies.iter_vertex diff --git a/compiler/desugared/name_resolution.ml b/compiler/desugared/name_resolution.ml index 57724dae..4c758094 100644 --- a/compiler/desugared/name_resolution.ml +++ b/compiler/desugared/name_resolution.ml @@ -396,6 +396,7 @@ let process_data_decl (Ident.Map.find state_id_name states_idmap |> StateName.get_info) ); ] + "%a" Format.pp_print_text "There are two states with the same name for the same variable: \ this is ambiguous. Please change the name of either states."; let state_uid = StateName.fresh state_id in @@ -431,8 +432,8 @@ let process_struct_decl (ctxt : context) (sdecl : Surface.Ast.struct_decl) : if sdecl.struct_decl_fields = [] then Message.error ~pos:(Mark.get sdecl.struct_decl_name) - "The struct %s does not have any fields; give it some for Catala to be \ - able to accept it." + "The struct@ %s@ does@ not@ have@ any@ fields;@ give it some for Catala \ + to be able to accept it." (Mark.remove sdecl.struct_decl_name); List.fold_left (fun ctxt (fdecl, _) -> @@ -476,8 +477,8 @@ let process_enum_decl (ctxt : context) (edecl : Surface.Ast.enum_decl) : context if List.length edecl.enum_decl_cases = 0 then Message.error ~pos:(Mark.get edecl.enum_decl_name) - "The enum %s does not have any cases; give it some for Catala to be able \ - to accept it." + "The enum@ %s@ does@ not@ have@ any@ cases;@ give it some for Catala to \ + be able to accept it." (Mark.remove edecl.enum_decl_name); List.fold_left (fun ctxt (cdecl, cdecl_pos) -> @@ -777,7 +778,7 @@ let get_def_key "", Mark.get state; "Variable declaration:", Mark.get (ScopeVar.get_info x_uid); ] - "This identifier is not a state declared for variable %a." + "This identifier is not a state declared for variable@ %a." ScopeVar.format x_uid) | None -> if not (Ident.Map.is_empty var_sig.var_sig_states_idmap) then @@ -787,8 +788,8 @@ let get_def_key "", Mark.get x; "Variable declaration:", Mark.get (ScopeVar.get_info x_uid); ] - "This definition does not indicate which state has to be \ - considered for variable %a." + "This definition does not indicate which state has to@ be@ \ + considered@ for@ variable@ %a." ScopeVar.format x_uid else None) ) | [y; x] -> @@ -796,17 +797,17 @@ let get_def_key match Ident.Map.find_opt (Mark.remove y) scope_ctxt.var_idmap with | Some (SubScope (v, u, _)) -> v, u | Some _ -> - Message.error ~pos "Invalid definition, %a is not a subscope" + Message.error ~pos "Invalid definition,@ %a@ is@ not@ a@ subscope" Print.lit_style (Mark.remove y) | None -> - Message.error ~pos "No definition found for subscope %a" Print.lit_style - (Mark.remove y) + Message.error ~pos "No definition found for subscope@ %a" + Print.lit_style (Mark.remove y) in let var_within_origin_scope = get_var_uid name ctxt x in ( (subscope_var, pos), Ast.ScopeDef.SubScopeInput { name; var_within_origin_scope } ) | _ -> - Message.error ~pos + Message.error ~pos "%a" Format.pp_print_text "This line is defining a quantity that is neither a scope variable nor a \ subscope variable. In particular, it is not possible to define struct \ fields individually in Catala." diff --git a/compiler/scopelang/dependency.ml b/compiler/scopelang/dependency.ml index 34bb774d..de664409 100644 --- a/compiler/scopelang/dependency.ml +++ b/compiler/scopelang/dependency.ml @@ -120,8 +120,9 @@ let build_program_dep_graph (prgm : 'm Ast.program) : SDependencies.t = if VMap.mem (Topdef glo_name) used_defs then Message.error ~pos:(Mark.get (TopdefName.get_info glo_name)) - "The Topdef %a has a definition that refers to itself, which is \ - forbidden since Catala does not provide recursion" + "The toplevel declaration@ %a@ has@ a@ definition@ that@ refers@ \ + to@ itself,@ which@ is@ not@ supported@ (Catala does not provide \ + recursion)" TopdefName.format glo_name; VMap.fold (fun def pos g -> @@ -138,8 +139,8 @@ let build_program_dep_graph (prgm : 'm Ast.program) : SDependencies.t = if VMap.mem (Scope scope_name) used_defs then Message.error ~pos:(Mark.get (ScopeName.get_info scope.Ast.scope_decl_name)) - "The scope %a is calling into itself as a subscope, which is \ - forbidden since Catala does not provide recursion" + "The scope@ %a@ is@ calling@ into@ itself@ as@ a@ subscope,@ \ + which@ is@ not@ supported@ (Catala does not provide recursion)" ScopeName.format scope.Ast.scope_decl_name; VMap.fold (fun used_def pos g -> @@ -192,8 +193,7 @@ let check_for_cycle_in_defs (g : SDependencies.t) : unit = (List.tl cycle @ [List.hd cycle]) in Message.error ~extra_pos:spans - "@[Cyclic dependency detected between the following scopes:@ \ - @[%a@]@]" + "Cyclic dependency detected between the following scopes:@ @[%a@]" (Format.pp_print_list ~pp_sep:(fun ppf () -> Format.fprintf ppf " →@ ") SVertex.format) @@ -283,8 +283,8 @@ let build_type_graph (structs : struct_ctx) (enums : enum_ctx) : TDependencies.t (fun used g -> if TVertex.equal used def then Message.error ~pos:(Mark.get typ) - "The type %a is defined using itself, which is forbidden \ - since Catala does not provide recursive types" + "The type@ %a@ is@ defined@ using@ itself,@ which@ is@ \ + not@ supported@ (Catala does not allow recursive types)" TVertex.format used else let edge = TDependencies.E.create used (Mark.get typ) def in @@ -305,8 +305,8 @@ let build_type_graph (structs : struct_ctx) (enums : enum_ctx) : TDependencies.t (fun used g -> if TVertex.equal used def then Message.error ~pos:(Mark.get typ) - "The type %a is defined using itself, which is forbidden \ - since Catala does not provide recursive types" + "The type@ %a@ is@ defined@ using@ itself,@ which@ is@ \ + not@ supported@ (Catala does not allow recursive types)" TVertex.format used else let edge = TDependencies.E.create used (Mark.get typ) def in diff --git a/compiler/scopelang/from_desugared.ml b/compiler/scopelang/from_desugared.ml index 79cb1bdd..61138b49 100644 --- a/compiler/scopelang/from_desugared.ml +++ b/compiler/scopelang/from_desugared.ml @@ -225,6 +225,7 @@ let rule_to_exception_graph (scope : D.scope) = function ( "Incriminated subscope variable definition:", Mark.get (RuleName.get_info rule) )) (RuleName.Map.keys def)) + "%a" Format.pp_print_text "Invalid assignment to a subscope variable that is not tagged \ as input or context." | OnlyInput when RuleName.Map.is_empty def && not is_cond -> @@ -237,6 +238,7 @@ let rule_to_exception_graph (scope : D.scope) = function Mark.get (ScopeVar.get_info (Mark.remove sscope)) ); "Incriminated variable:", Mark.get sscope; ] + "%a" Format.pp_print_text "This subscope variable is a mandatory input but no definition \ was provided." | _ -> () @@ -261,8 +263,8 @@ let rule_to_exception_graph (scope : D.scope) = function ( "Incriminated variable definition:", Mark.get (RuleName.get_info rule) )) (RuleName.Map.keys var_def)) - "It is impossible to give a definition to a scope variable tagged as \ - input." + "%a" Format.pp_print_text + "There cannot be a definition for a scope variable tagged as input." | OnlyInput -> D.ScopeDef.Map.empty (* we do not provide any definition for an input-only variable *) | _ -> diff --git a/compiler/shared_ast/interpreter.ml b/compiler/shared_ast/interpreter.ml index 433aedb8..8d0aeab2 100644 --- a/compiler/shared_ast/interpreter.ml +++ b/compiler/shared_ast/interpreter.ml @@ -138,7 +138,8 @@ let rec evaluate_operator ] "division by zero at runtime" | Runtime.UncomparableDurations -> - Message.error ~extra_pos:(get_binop_args_pos args) + Message.error ~extra_pos:(get_binop_args_pos args) "%a" + Format.pp_print_text "Cannot compare together durations that cannot be converted to a \ precise number of days" in @@ -158,11 +159,10 @@ let rec evaluate_operator arg, Expr.pos arg )) args) - "Operator %a applied to the wrong arguments\n\ - (should not happen if the term was well-typed)%a" + "Operator %a applied to the wrong@ arguments@ (should not happen if the \ + term was well-typed)" (Print.operator ~debug:true) - op Expr.format - (EAppOp { op; tys = []; args }, m) + op in let open Runtime.Oper in Mark.add m @@ -236,6 +236,7 @@ let rec evaluate_operator | _ -> Message.error ~pos:(Expr.pos (List.nth args 0)) + "%a" Format.pp_print_text "This predicate evaluated to something else than a boolean \ (should not happen if the term was well-typed)") es) @@ -392,8 +393,8 @@ let rec evaluate_operator | ELit (LBool false) -> raise (CatalaException (EmptyError, pos)) | _ -> Message.error ~pos - "Default justification has not been reduced to a boolean at \ - evaluation (should not happen if the term was well-typed@\n\ + "Default justification has not been reduced to a boolean at@ \ + evaluation@ (should not happen if the term was well-typed@\n\ %a@." Expr.format just) | [e] -> Mark.remove e @@ -603,7 +604,7 @@ and val_to_runtime : | TDefault ty, _ -> val_to_runtime eval_expr ctx ty v | _ -> Message.error ~internal:true - "Could not convert value of type %a to runtime: %a" (Print.typ ctx) ty + "Could not convert value of type %a@ to@ runtime:@ %a" (Print.typ ctx) ty Expr.format v let rec evaluate_expr : @@ -617,7 +618,7 @@ let rec evaluate_expr : let pos = Expr.mark_pos m in match Mark.remove e with | EVar _ -> - Message.error ~pos + Message.error ~pos "%a" Format.pp_print_text "free variable found at evaluation (should not happen if term was \ well-typed)" | EExternal { name } -> @@ -637,7 +638,7 @@ let rec evaluate_expr : (TStruct scope_info.out_struct_name, pos) ), pos ) with TopdefName.Map.Not_found _ | ScopeName.Map.Not_found _ -> - Message.error ~pos "Reference to %a could not be resolved" + Message.error ~pos "Reference to %a@ could@ not@ be@ resolved" Print.external_ref name in let runtime_path = @@ -673,7 +674,7 @@ let rec evaluate_expr : |> fun o -> runtime_to_val (fun ctx -> evaluate_expr ctx lang) ctx m tret o | _ -> - Message.error ~pos + Message.error ~pos "%a" Format.pp_print_text "function has not been reduced to a lambda at evaluation (should not \ happen if the term was well-typed") | EAppOp { op; args; _ } -> @@ -698,19 +699,20 @@ let rec evaluate_expr : if not (StructName.equal s name) then Message.error ~extra_pos:["", pos; "", Expr.pos e] + "%a" Format.pp_print_text "Error during struct access: not the same structs (should not happen \ if the term was well-typed)"; match StructField.Map.find_opt field es with | Some e' -> e' | None -> Message.error ~pos:(Expr.pos e) - "Invalid field access %a in struct %a (should not happen if the term \ - was well-typed)" + "Invalid field access %a@ in@ struct@ %a@ (should not happen if the \ + term was well-typed)" StructField.format field StructName.format s) | _ -> Message.error ~pos:(Expr.pos e) - "The expression %a should be a struct %a but is not (should not happen \ - if the term was well-typed)" + "The expression %a@ should@ be@ a@ struct@ %a@ but@ is@ not@ (should \ + not happen if the term was well-typed)" (Print.UserFacing.expr lang) e StructName.format s) | ETuple es -> Mark.add m (ETuple (List.map (evaluate_expr ctx lang) es)) @@ -719,8 +721,8 @@ let rec evaluate_expr : | ETuple es, _ when List.length es = size -> List.nth es index | e -> Message.error ~pos:(Expr.pos e) - "The expression %a was expected to be a tuple of size %d (should not \ - happen if the term was well-typed)" + "The expression %a@ was@ expected@ to@ be@ a@ tuple@ of@ size@ %d@ \ + (should not happen if the term was well-typed)" (Print.UserFacing.expr lang) e size) | EInj { e; name; cons } -> @@ -733,13 +735,14 @@ let rec evaluate_expr : if not (EnumName.equal name name') then Message.error ~extra_pos:["", Expr.pos e; "", Expr.pos e1] + "%a" Format.pp_print_text "Error during match: two different enums found (should not happen if \ the term was well-typed)"; let es_n = match EnumConstructor.Map.find_opt cons cases with | Some es_n -> es_n | None -> - Message.error ~pos:(Expr.pos e) + Message.error ~pos:(Expr.pos e) "%a" Format.pp_print_text "sum type index error (should not happen if the term was \ well-typed)" in @@ -758,7 +761,7 @@ let rec evaluate_expr : | ELit (LBool true) -> evaluate_expr ctx lang etrue | ELit (LBool false) -> evaluate_expr ctx lang efalse | _ -> - Message.error ~pos:(Expr.pos cond) + Message.error ~pos:(Expr.pos cond) "%a" Format.pp_print_text "Expected a boolean literal for the result of this condition (should \ not happen if the term was well-typed)") | EArray es -> @@ -774,13 +777,13 @@ let rec evaluate_expr : (partially_evaluate_expr_for_assertion_failure_message ctx lang (Expr.skip_wrappers e')) | _ -> - Message.error ~pos:(Expr.pos e') + Message.error ~pos:(Expr.pos e') "%a" Format.pp_print_text "Expected a boolean literal for the result of this assertion (should \ not happen if the term was well-typed)") | EErrorOnEmpty e' -> ( match evaluate_expr ctx lang e' with | EEmptyError, _ -> - Message.error ~pos:(Expr.pos e') + Message.error ~pos:(Expr.pos e') "%a" Format.pp_print_text "This variable evaluated to an empty term (no rule that defined it \ applied in this situation)" | e -> e) @@ -794,7 +797,7 @@ let rec evaluate_expr : | ELit (LBool true) -> evaluate_expr ctx lang cons | ELit (LBool false) -> Mark.copy e EEmptyError | _ -> - Message.error ~pos:(Expr.pos e) + Message.error ~pos:(Expr.pos e) "%a" Format.pp_print_text "Default justification has not been reduced to a boolean at \ evaluation (should not happen if the term was well-typed") | 1 -> List.find (fun sub -> not (is_empty_error sub)) excepts @@ -912,7 +915,7 @@ let delcustom e = let interp_failure_message ~pos = function | NoValueProvided -> - Message.error ~pos + Message.error ~pos "%a" Format.pp_print_text "This variable evaluated to an empty term (no rule that defined it \ applied in this situation)" | ConflictError cpos -> @@ -921,14 +924,15 @@ let interp_failure_message ~pos = function (List.map (fun pos -> "This consequence has a valid justification:", pos) cpos) + "%a" Format.pp_print_text "There is a conflict between multiple valid consequences for assigning \ the same variable." | Crash -> (* This constructor seems to be never used *) - Message.error ~pos "Internal error, the interpreter crashed" + Message.error ~pos ~internal:true "The interpreter crashed" | EmptyError -> - Message.error ~pos - "Internal error, a variable without valid definition escaped" + Message.error ~pos ~internal:true + "A variable without valid definition escaped" let interpret_program_lcalc p s : (Uid.MarkedString.info * ('a, 'm) gexpr) list = @@ -981,12 +985,13 @@ let interpret_program_lcalc p s : (Uid.MarkedString.info * ('a, 'm) gexpr) list mark_e | _ -> Message.error ~pos:(Mark.get ty) - "This scope needs an input argument of type %a to be executed. \ - But the Catala built-in interpreter does not have a way to \ - retrieve input values from the command line, so it cannot \ - execute this scope. Please create another scope that provides \ - the input arguments to this one and execute it instead." - Print.typ_debug ty) + "This scope needs an input argument of type@ %a@ %a" + Print.typ_debug ty Format.pp_print_text + "to be executed. But the Catala built-in interpreter does not \ + have a way to retrieve input values from the command line, so \ + it cannot execute this scope. Please create another scope that \ + provides the input arguments to this one and execute it \ + instead.") taus in let to_interpret = @@ -1006,12 +1011,12 @@ let interpret_program_lcalc p s : (Uid.MarkedString.info * ('a, 'm) gexpr) list | exception CatalaException (except, pos) -> interp_failure_message ~pos except | _ -> - Message.error ~pos:(Expr.pos e) + Message.error ~pos:(Expr.pos e) "%a" Format.pp_print_text "The interpretation of a program should always yield a struct \ corresponding to the scope variables" end | _ -> - Message.error ~pos:(Expr.pos e) + Message.error ~pos:(Expr.pos e) "%a" Format.pp_print_text "The interpreter can only interpret terms starting with functions having \ thunked arguments" @@ -1038,7 +1043,7 @@ let interpret_program_dcalc p s : (Uid.MarkedString.info * ('a, 'm) gexpr) list (Bindlib.box EEmptyError, Expr.with_ty mark_e ty_out) ty_in (Expr.mark_pos mark_e) | _ -> - Message.error ~pos:(Mark.get ty) + Message.error ~pos:(Mark.get ty) "%a" Format.pp_print_text "This scope needs input arguments to be executed. But the Catala \ built-in interpreter does not have a way to retrieve input \ values from the command line, so it cannot execute this scope. \ @@ -1063,12 +1068,12 @@ let interpret_program_dcalc p s : (Uid.MarkedString.info * ('a, 'm) gexpr) list | exception CatalaException (except, pos) -> interp_failure_message ~pos except | _ -> - Message.error ~pos:(Expr.pos e) + Message.error ~pos:(Expr.pos e) "%a" Format.pp_print_text "The interpretation of a program should always yield a struct \ corresponding to the scope variables" end | _ -> - Message.error ~pos:(Expr.pos e) + Message.error ~pos:(Expr.pos e) "%a" Format.pp_print_text "The interpreter can only interpret terms starting with functions having \ thunked arguments" @@ -1091,7 +1096,7 @@ let load_runtime_modules prg = Message.error ~pos_msg:(fun ppf -> Format.pp_print_string ppf "Module defined here") ~pos:(Mark.get (ModuleName.get_info m)) - "Compiled OCaml object %a not found. Make sure it has been suitably \ + "Compiled OCaml object %a@ not@ found.@ Make sure it has been suitably \ compiled." File.format obj_file else diff --git a/compiler/shared_ast/typing.ml b/compiler/shared_ast/typing.ml index 492cde0c..611d2416 100644 --- a/compiler/shared_ast/typing.ml +++ b/compiler/shared_ast/typing.ml @@ -264,9 +264,9 @@ let handle_type_error ctx (A.AnyExpr e) t1 t2 = ] in Message.error ~fmt_pos - "@[Error during typechecking, incompatible types:@,\ + "Error during typechecking, incompatible types:@\n\ @[@{@<3>%s@} @[%a@]@,\ - @{@<3>%s@} @[%a@]@]@]" "┌─⯈" (format_typ ctx) t1 "└─⯈" + @{@<3>%s@} @[%a@]@]" "┌─⯈" (format_typ ctx) t1 "└─⯈" (format_typ ctx) t2 let lit_type (lit : A.lit) : naked_typ = @@ -607,7 +607,7 @@ and typecheck_expr_top_down : "", Expr.mark_pos context_mark; "Structure definition", Mark.get (A.StructName.get_info name); ] - "Field @{\"%s\"@} does not belong to structure \ + "Field@ @{\"%s\"@}@ does@ not@ belong@ to@ structure@ \ @{\"%a\"@}." field A.StructName.format name ~suggestion:(A.Ident.Map.keys ctx.ctx_struct_fields)) @@ -616,8 +616,8 @@ and typecheck_expr_top_down : with A.StructName.Map.Not_found _ -> Message.error ~pos:(Expr.mark_pos context_mark) - "@[Field @{\"%s\"@}@ does not belong to@ structure \ - @{\"%a\"@}@ (however, structure %a defines it)@]" + "Field@ @{\"%s\"@}@ does@ not@ belong@ to@ structure@ \ + @{\"%a\"@}@ (however, structure@ %a@ defines@ it)@]" field A.StructName.format name (Format.pp_print_list ~pp_sep:(fun ppf () -> Format.fprintf ppf "@ or@ ") diff --git a/compiler/surface/parser_driver.ml b/compiler/surface/parser_driver.ml index f77a12d0..985bd8cd 100644 --- a/compiler/surface/parser_driver.ml +++ b/compiler/surface/parser_driver.ml @@ -73,17 +73,13 @@ let raise_parser_error (token : string) (msg : Format.formatter -> unit) : 'a = Message.error ?suggestion - ~fmt_pos: - (((fun ppf -> Format.pp_print_string ppf "Error token:"), error_loc) - :: - (match last_good_loc with - | None -> [] - | Some last_good_loc -> - [ - ( (fun ppf -> Format.pp_print_string ppf "Last good token:"), - last_good_loc ); - ])) - "@[Syntax error at token %a@,%t@]" + ~extra_pos: + [ + (match last_good_loc with + | None -> "Error token", error_loc + | Some last_good_loc -> "Last good token", last_good_loc); + ] + "Syntax error at %a@\n%t" (fun ppf string -> Format.fprintf ppf "@{\"%s\"@}" string) token msg @@ -133,18 +129,15 @@ module ParserAux (LocalisedLexer : Lexer_common.LocalisedLexer) = struct (* The parser has suspended itself because of a syntax error. Stop. *) let custom_menhir_message ppf = (match Parser_errors.message (state env) with - | exception Not_found -> - Format.fprintf ppf "Message: @{unexpected token@}@,%t" + | exception Not_found -> Format.fprintf ppf "@{unexpected token@}" | msg -> - Format.fprintf ppf "Message: @{%s@}@,%t" - (String.trim (String.uncapitalize_ascii msg))) - (fun (ppf : Format.formatter) -> - Format.fprintf ppf "You could have written : "; - Format.pp_print_list - ~pp_sep:(fun ppf () -> Format.fprintf ppf ",@ or ") - (fun ppf string -> Format.fprintf ppf "@{\"%s\"@}" string) - ppf - (List.map (fun (s, _) -> s) acceptable_tokens)) + Format.fprintf ppf "@{@<1>»@} @[%a@]" Format.pp_print_text + (String.trim (String.uncapitalize_ascii msg))); + Format.fprintf ppf "@,@[Those are valid at this point:@ %a@]" + (Format.pp_print_list + ~pp_sep:(fun ppf () -> Format.fprintf ppf ",@ ") + (fun ppf string -> Format.fprintf ppf "@{\"%s\"@}" string)) + (List.map (fun (s, _) -> s) acceptable_tokens) in raise_parser_error ~suggestion:similar_acceptable_tokens (Pos.from_lpos (lexing_positions lexbuf)) @@ -303,8 +296,8 @@ and expand_includes (source_file : string) (commands : Ast.law_structure list) : "Module declaration", Mark.get id; ] "A file that declares a module cannot be used through the raw \ - '@{> Include@}' directive. You should use it as a \ - module with '@{> Use @{%s@}@}' instead." + '@{> Include@}'@ directive.@ You should use it as a \ + module with@ '@{> Use @{%s@}@}'@ instead." (Mark.remove id) in { @@ -406,9 +399,8 @@ let check_modname program source_file = (Global.FileName file | Global.Contents (_, file) | Global.Stdin file) ) when not File.(equal mname Filename.(remove_extension (basename file))) -> Message.error ~pos - "@[Module declared as@ @{%s@},@ which@ does@ not@ match@ the@ \ - file@ name@ %a.@ Rename the module to@ @{%s@}@ or@ the@ file@ to@ \ - %a.@]" + "Module declared as@ @{%s@},@ which@ does@ not@ match@ the@ file@ \ + name@ %a.@ Rename the module to@ @{%s@}@ or@ the@ file@ to@ %a." mname File.format file (String.capitalize_ascii Filename.(remove_extension (basename file))) File.format diff --git a/tests/arithmetic/bad/division_by_zero.catala_en b/tests/arithmetic/bad/division_by_zero.catala_en index 2d421bcc..9f5e85ec 100644 --- a/tests/arithmetic/bad/division_by_zero.catala_en +++ b/tests/arithmetic/bad/division_by_zero.catala_en @@ -33,8 +33,7 @@ scope Money: ```catala-test-inline $ catala Interpret -s Dec -[ERROR] -division by zero at runtime +[ERROR] division by zero at runtime The division operator: ┌─⯈ tests/arithmetic/bad/division_by_zero.catala_en:20.23-20.30: @@ -58,8 +57,7 @@ The null denominator: Fixme: the following should give the same result as above, but the optimisation pass propagates the position surrounding the `ErrorOnEmpty` and loses the position of the actual division expression which was in the `cons` of the default term. Unfortunately this is non-trivial due to the bindlib boxing tricks. ```catala-test-inline $ catala Interpret -O -s Dec -[ERROR] -division by zero at runtime +[ERROR] division by zero at runtime The division operator: ┌─⯈ tests/arithmetic/bad/division_by_zero.catala_en:17.10-17.11: @@ -81,8 +79,7 @@ The null denominator: ```catala-test-inline $ catala interpret -s Int -[ERROR] -division by zero at runtime +[ERROR] division by zero at runtime The division operator: ┌─⯈ tests/arithmetic/bad/division_by_zero.catala_en:10.23-10.28: @@ -104,8 +101,7 @@ The null denominator: ```catala-test-inline $ catala Interpret -s Money -[ERROR] -division by zero at runtime +[ERROR] division by zero at runtime The division operator: ┌─⯈ tests/arithmetic/bad/division_by_zero.catala_en:30.23-30.35: diff --git a/tests/arithmetic/bad/logical_prio.catala_en b/tests/arithmetic/bad/logical_prio.catala_en index 11bba650..d1ec1a5a 100644 --- a/tests/arithmetic/bad/logical_prio.catala_en +++ b/tests/arithmetic/bad/logical_prio.catala_en @@ -8,8 +8,8 @@ scope S1: ```catala-test-inline $ catala typecheck -[ERROR] -Please add parentheses to explicit which of these operators should be applied first +[ERROR] Please add parentheses to explicit which of these operators should be + applied first ┌─⯈ tests/arithmetic/bad/logical_prio.catala_en:6.28-6.31: └─┐ diff --git a/tests/array/bad/fold_error.catala_en b/tests/array/bad/fold_error.catala_en index 0213d158..3f886c0c 100644 --- a/tests/array/bad/fold_error.catala_en +++ b/tests/array/bad/fold_error.catala_en @@ -12,9 +12,7 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -I don't know how to apply operator >= on types integer and -money +[ERROR] I don't know how to apply operator >= on types integer and money ┌─⯈ tests/array/bad/fold_error.catala_en:10.78-10.85: └──┐ diff --git a/tests/bool/bad/bad_assert.catala_en b/tests/bool/bad/bad_assert.catala_en index f27dff34..161467df 100644 --- a/tests/bool/bad/bad_assert.catala_en +++ b/tests/bool/bad/bad_assert.catala_en @@ -12,10 +12,9 @@ scope Foo: ```catala-test-inline $ catala test-scope Foo -[ERROR] -Error during typechecking, incompatible types: -┌─⯈ integer -└─⯈ bool +[ERROR] Error during typechecking, incompatible types: + ┌─⯈ integer + └─⯈ bool While typechecking the following expression: ┌─⯈ tests/bool/bad/bad_assert.catala_en:9.13-9.14: diff --git a/tests/bool/bad/test_xor_with_int.catala_en b/tests/bool/bad/test_xor_with_int.catala_en index 718549c1..b2947663 100644 --- a/tests/bool/bad/test_xor_with_int.catala_en +++ b/tests/bool/bad/test_xor_with_int.catala_en @@ -10,10 +10,9 @@ scope TestXorWithInt: ```catala-test-inline $ catala Typecheck -[ERROR] -Error during typechecking, incompatible types: -┌─⯈ integer -└─⯈ bool +[ERROR] Error during typechecking, incompatible types: + ┌─⯈ integer + └─⯈ bool This expression has type integer: ┌─⯈ tests/bool/bad/test_xor_with_int.catala_en:8.30-8.32: diff --git a/tests/date/bad/rounding_option_conflict.catala_en b/tests/date/bad/rounding_option_conflict.catala_en index fa1ea355..139199cb 100644 --- a/tests/date/bad/rounding_option_conflict.catala_en +++ b/tests/date/bad/rounding_option_conflict.catala_en @@ -25,8 +25,7 @@ scope Test: ```catala-test-inline $ catala test-scope Test -[ERROR] -You cannot set multiple date rounding modes +[ERROR] You cannot set multiple date rounding modes ┌─⯈ tests/date/bad/rounding_option_conflict.catala_en:10.14-10.24: └──┐ diff --git a/tests/date/bad/substraction.catala_en b/tests/date/bad/substraction.catala_en index f35a1614..8e6c3243 100644 --- a/tests/date/bad/substraction.catala_en +++ b/tests/date/bad/substraction.catala_en @@ -8,9 +8,7 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -I don't know how to apply operator <= on types date and -duration +[ERROR] I don't know how to apply operator <= on types date and duration ┌─⯈ tests/date/bad/substraction.catala_en:6.23-6.52: └─┐ diff --git a/tests/date/bad/uncomparable_duration.catala_en b/tests/date/bad/uncomparable_duration.catala_en index 6da3ff74..b1a6afb3 100644 --- a/tests/date/bad/uncomparable_duration.catala_en +++ b/tests/date/bad/uncomparable_duration.catala_en @@ -42,8 +42,8 @@ scope Ge: ```catala-test-inline $ catala test-scope Ge -[ERROR] -Cannot compare together durations that cannot be converted to a precise number of days +[ERROR] Cannot compare together durations that cannot be converted to a + precise number of days ┌─⯈ tests/date/bad/uncomparable_duration.catala_en:40.23-40.30: └──┐ @@ -63,8 +63,8 @@ Cannot compare together durations that cannot be converted to a precise number o ```catala-test-inline $ catala test-scope Gt -[ERROR] -Cannot compare together durations that cannot be converted to a precise number of days +[ERROR] Cannot compare together durations that cannot be converted to a + precise number of days ┌─⯈ tests/date/bad/uncomparable_duration.catala_en:30.23-30.30: └──┐ @@ -84,8 +84,8 @@ Cannot compare together durations that cannot be converted to a precise number o ```catala-test-inline $ catala test-scope Le -[ERROR] -Cannot compare together durations that cannot be converted to a precise number of days +[ERROR] Cannot compare together durations that cannot be converted to a + precise number of days ┌─⯈ tests/date/bad/uncomparable_duration.catala_en:20.23-20.30: └──┐ @@ -105,8 +105,8 @@ Cannot compare together durations that cannot be converted to a precise number o ```catala-test-inline $ catala test-scope Lt -[ERROR] -Cannot compare together durations that cannot be converted to a precise number of days +[ERROR] Cannot compare together durations that cannot be converted to a + precise number of days ┌─⯈ tests/date/bad/uncomparable_duration.catala_en:10.23-10.30: └──┐ diff --git a/tests/default/bad/empty.catala_en b/tests/default/bad/empty.catala_en index d359fb78..e39a8890 100644 --- a/tests/default/bad/empty.catala_en +++ b/tests/default/bad/empty.catala_en @@ -11,15 +11,16 @@ scope A: ```catala-test-inline $ catala test-scope A -[WARNING] In scope "A", the variable "y" is declared but never defined; did you forget something? +[WARNING] In scope "A", the variable "y" is declared but never defined; + did you forget something? ┌─⯈ tests/default/bad/empty.catala_en:6.10-6.11: └─┐ 6 │ output y content boolean │ ‾ └─ Article -[ERROR] -This variable evaluated to an empty term (no rule that defined it applied in this situation) +[ERROR] This variable evaluated to an empty term (no rule that defined it + applied in this situation) ┌─⯈ tests/default/bad/empty.catala_en:6.10-6.11: └─┐ diff --git a/tests/default/bad/empty_with_rules.catala_en b/tests/default/bad/empty_with_rules.catala_en index 35aa99c1..5164ba65 100644 --- a/tests/default/bad/empty_with_rules.catala_en +++ b/tests/default/bad/empty_with_rules.catala_en @@ -14,8 +14,8 @@ scope A: ```catala-test-inline $ catala interpret -s A -[ERROR] -This variable evaluated to an empty term (no rule that defined it applied in this situation) +[ERROR] This variable evaluated to an empty term (no rule that defined it + applied in this situation) ┌─⯈ tests/default/bad/empty_with_rules.catala_en:5.10-5.11: └─┐ diff --git a/tests/default/bad/typing_or_logical_error.catala_en b/tests/default/bad/typing_or_logical_error.catala_en index fc0320c9..6c55bb2c 100644 --- a/tests/default/bad/typing_or_logical_error.catala_en +++ b/tests/default/bad/typing_or_logical_error.catala_en @@ -11,22 +11,13 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -Syntax error at token "=" -Message: expected 'under condition' followed by a condition, 'equals' followed by the definition body, or the rest of the variable qualified name -You could have written : "of", -or "state", -or "equals", -or "under condition", -or "." +[ERROR] Syntax error at "=" + » expected 'under condition' followed by a condition, 'equals' followed by + the definition body, or the rest of the variable qualified name + Those are valid at this point: "of", "state", "equals", "under condition", + "." -Error token: -┌─⯈ tests/default/bad/typing_or_logical_error.catala_en:8.30-8.31: -└─┐ -8 │ definition wrong_definition = 1 - │ ‾ - -Last good token: +Last good token ┌─⯈ tests/default/bad/typing_or_logical_error.catala_en:8.13-8.29: └─┐ 8 │ definition wrong_definition = 1 diff --git a/tests/default/good/mutliple_definitions.catala_en b/tests/default/good/mutliple_definitions.catala_en index 300a9c97..ac569c06 100644 --- a/tests/default/good/mutliple_definitions.catala_en +++ b/tests/default/good/mutliple_definitions.catala_en @@ -13,7 +13,8 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] These definitions have identical justifications and consequences; is it a mistake? +[WARNING] These definitions have identical justifications and consequences; + is it a mistake? ┌─⯈ tests/default/good/mutliple_definitions.catala_en:9.3-9.15: └─┐ @@ -30,7 +31,8 @@ $ catala Typecheck --check-invariants ```catala-test-inline $ catala test-scope A -[WARNING] These definitions have identical justifications and consequences; is it a mistake? +[WARNING] These definitions have identical justifications and consequences; + is it a mistake? ┌─⯈ tests/default/good/mutliple_definitions.catala_en:9.3-9.15: └─┐ diff --git a/tests/enum/bad/ambiguous_cases.catala_en b/tests/enum/bad/ambiguous_cases.catala_en index b18b8925..d8860ffa 100644 --- a/tests/enum/bad/ambiguous_cases.catala_en +++ b/tests/enum/bad/ambiguous_cases.catala_en @@ -16,8 +16,8 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -This constructor name is ambiguous, it can belong to E or F. Desambiguate it by prefixing it with the enum name. +[ERROR] This constructor name is ambiguous, it can belong to E or F. + Disambiguate it by prefixing it with the enum name. ┌─⯈ tests/enum/bad/ambiguous_cases.catala_en:14.23-14.28: └──┐ diff --git a/tests/enum/bad/ambiguous_wildcard.catala_en b/tests/enum/bad/ambiguous_wildcard.catala_en index bd00e0f6..f9005103 100644 --- a/tests/enum/bad/ambiguous_wildcard.catala_en +++ b/tests/enum/bad/ambiguous_wildcard.catala_en @@ -17,8 +17,8 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -Couldn't infer the enumeration name from lonely wildcard (wildcard cannot be used as single match case) +[ERROR] Couldn't infer the enumeration name from lonely wildcard (wildcard + cannot be used as single match case) ┌─⯈ tests/enum/bad/ambiguous_wildcard.catala_en:15.5-15.21: └──┐ diff --git a/tests/enum/bad/duplicate_case.catala_en b/tests/enum/bad/duplicate_case.catala_en index b0d4aa6e..348f9722 100644 --- a/tests/enum/bad/duplicate_case.catala_en +++ b/tests/enum/bad/duplicate_case.catala_en @@ -20,8 +20,7 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -The constructor Case3 has been matched twice: +[ERROR] The constructor Case3 has been matched twice: ┌─⯈ tests/enum/bad/duplicate_case.catala_en:18.16-18.20: └──┐ diff --git a/tests/enum/bad/empty.catala_en b/tests/enum/bad/empty.catala_en index 2b0cdeef..b52c0dde 100644 --- a/tests/enum/bad/empty.catala_en +++ b/tests/enum/bad/empty.catala_en @@ -9,8 +9,8 @@ declaration scope Bar: ```catala-test-inline $ catala Typecheck -[ERROR] -The enum Foo does not have any cases; give it some for Catala to be able to accept it. +[ERROR] The enum Foo does not have any cases; + give it some for Catala to be able to accept it. ┌─⯈ tests/enum/bad/empty.catala_en:4.25-4.28: └─┐ diff --git a/tests/enum/bad/missing_case.catala_en b/tests/enum/bad/missing_case.catala_en index 5da73abe..4e833029 100644 --- a/tests/enum/bad/missing_case.catala_en +++ b/tests/enum/bad/missing_case.catala_en @@ -18,15 +18,15 @@ scope A: ```catala-test-inline $ catala test-scope A -[WARNING] The constructor "Case3" of enumeration "E" is never used; maybe it's unnecessary? +[WARNING] The constructor "Case3" of enumeration "E" is never used; + maybe it's unnecessary? ┌─⯈ tests/enum/bad/missing_case.catala_en:7.6-7.11: └─┐ 7 │ -- Case3 │ ‾‾‾‾‾ └─ Article -[ERROR] -The constructor Case3 of enum E is missing from this pattern matching +[ERROR] The constructor Case3 of enum E is missing from this pattern matching ┌─⯈ tests/enum/bad/missing_case.catala_en:14.25-16.22: └──┐ diff --git a/tests/enum/bad/not_ending_wildcard.catala_en b/tests/enum/bad/not_ending_wildcard.catala_en index 66cb6f26..72b34e27 100644 --- a/tests/enum/bad/not_ending_wildcard.catala_en +++ b/tests/enum/bad/not_ending_wildcard.catala_en @@ -38,8 +38,7 @@ scope Middle_case: ```catala-test-inline $ catala test-scope First_case -[ERROR] -Wildcard must be the last match case +[ERROR] Wildcard must be the last match case Not ending wildcard: ┌─⯈ tests/enum/bad/not_ending_wildcard.catala_en:19.5-19.21: @@ -61,8 +60,7 @@ Next reachable case: ```catala-test-inline $ catala test-scope Middle_case -[ERROR] -Wildcard must be the last match case +[ERROR] Wildcard must be the last match case Not ending wildcard: ┌─⯈ tests/enum/bad/not_ending_wildcard.catala_en:19.5-19.21: diff --git a/tests/enum/bad/quick_pattern_2.catala_en b/tests/enum/bad/quick_pattern_2.catala_en index f8a19005..a449b913 100644 --- a/tests/enum/bad/quick_pattern_2.catala_en +++ b/tests/enum/bad/quick_pattern_2.catala_en @@ -30,10 +30,9 @@ scope B: ```catala-test-inline $ catala test-scope A -[ERROR] -Error during typechecking, incompatible types: -┌─⯈ E -└─⯈ F +[ERROR] Error during typechecking, incompatible types: + ┌─⯈ E + └─⯈ F While typechecking the following expression: ┌─⯈ tests/enum/bad/quick_pattern_2.catala_en:28.23-28.24: diff --git a/tests/enum/bad/quick_pattern_3.catala_en b/tests/enum/bad/quick_pattern_3.catala_en index 97b82c3f..19fcbd3f 100644 --- a/tests/enum/bad/quick_pattern_3.catala_en +++ b/tests/enum/bad/quick_pattern_3.catala_en @@ -20,10 +20,9 @@ definition y equals x with pattern Case3 ```catala-test-inline $ catala test-scope A -[ERROR] -Error during typechecking, incompatible types: -┌─⯈ E -└─⯈ F +[ERROR] Error during typechecking, incompatible types: + ┌─⯈ E + └─⯈ F While typechecking the following expression: ┌─⯈ tests/enum/bad/quick_pattern_3.catala_en:18.21-18.22: diff --git a/tests/enum/bad/quick_pattern_4.catala_en b/tests/enum/bad/quick_pattern_4.catala_en index ca235c99..cf03f4cd 100644 --- a/tests/enum/bad/quick_pattern_4.catala_en +++ b/tests/enum/bad/quick_pattern_4.catala_en @@ -19,10 +19,9 @@ definition y equals x with pattern Case3 ```catala-test-inline $ catala test-scope A -[ERROR] -Error during typechecking, incompatible types: -┌─⯈ E -└─⯈ F +[ERROR] Error during typechecking, incompatible types: + ┌─⯈ E + └─⯈ F While typechecking the following expression: ┌─⯈ tests/enum/bad/quick_pattern_4.catala_en:17.21-17.22: diff --git a/tests/enum/bad/quick_pattern_fail.catala_en b/tests/enum/bad/quick_pattern_fail.catala_en index 11e4899b..eb1e0df5 100644 --- a/tests/enum/bad/quick_pattern_fail.catala_en +++ b/tests/enum/bad/quick_pattern_fail.catala_en @@ -17,9 +17,8 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -The name of this constructor has not been defined before -(it's probably a typographical error). +[ERROR] The name of this constructor has not been defined before + (it's probably a typographical error). Here is your code : ┌─⯈ tests/enum/bad/quick_pattern_fail.catala_en:15.38-15.43: diff --git a/tests/enum/bad/too_many_cases.catala_en b/tests/enum/bad/too_many_cases.catala_en index 8609cbad..b940d21c 100644 --- a/tests/enum/bad/too_many_cases.catala_en +++ b/tests/enum/bad/too_many_cases.catala_en @@ -23,8 +23,8 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -This case matches a constructor of enumeration E but previous case were matching constructors of enumeration F +[ERROR] This case matches a constructor of enumeration E but previous cases + were matching constructors of enumeration F ┌─⯈ tests/enum/bad/too_many_cases.catala_en:21.8-21.13: └──┐ diff --git a/tests/enum/bad/useless_wildcard.catala_en b/tests/enum/bad/useless_wildcard.catala_en index e724db2a..50a001ac 100644 --- a/tests/enum/bad/useless_wildcard.catala_en +++ b/tests/enum/bad/useless_wildcard.catala_en @@ -19,7 +19,8 @@ scope A: ```catala-test-inline $ catala test-scope A -[WARNING] Unreachable match case, all constructors of the enumeration E are already specified +[WARNING] Unreachable match case, all constructors of the enumeration E are + already specified ┌─⯈ tests/enum/bad/useless_wildcard.catala_en:17.5-17.21: └──┐ diff --git a/tests/enum/bad/wrong_cons.catala_en b/tests/enum/bad/wrong_cons.catala_en index 1835636a..ee5d5abe 100644 --- a/tests/enum/bad/wrong_cons.catala_en +++ b/tests/enum/bad/wrong_cons.catala_en @@ -13,9 +13,8 @@ scope A: ```catala-test-inline $ catala Typecheck -[ERROR] -The name of this constructor has not been defined before -(it's probably a typographical error). +[ERROR] The name of this constructor has not been defined before + (it's probably a typographical error). Here is your code : ┌─⯈ tests/enum/bad/wrong_cons.catala_en:11.23-11.28: diff --git a/tests/exception/bad/ambiguous_unlabeled_exception.catala_en b/tests/exception/bad/ambiguous_unlabeled_exception.catala_en index 75b1dd42..3a8f423b 100644 --- a/tests/exception/bad/ambiguous_unlabeled_exception.catala_en +++ b/tests/exception/bad/ambiguous_unlabeled_exception.catala_en @@ -15,8 +15,8 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -This exception can refer to several definitions. Try using labels to disambiguate +[ERROR] This exception can refer to several definitions. Try using labels to + disambiguate Ambiguous exception ┌─⯈ tests/exception/bad/ambiguous_unlabeled_exception.catala_en:12.3-13.15: diff --git a/tests/exception/bad/dangling_exception.catala_en b/tests/exception/bad/dangling_exception.catala_en index 47d2827a..1ca7483b 100644 --- a/tests/exception/bad/dangling_exception.catala_en +++ b/tests/exception/bad/dangling_exception.catala_en @@ -15,8 +15,7 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -Unknown label for the scope variable x: "base_y" +[ERROR] Unknown label for the scope variable x: "base_y" ┌─⯈ tests/exception/bad/dangling_exception.catala_en:12.13-12.19: └──┐ diff --git a/tests/exception/bad/exceptions_cycle.catala_en b/tests/exception/bad/exceptions_cycle.catala_en index 87dcc6ac..3cb3d758 100644 --- a/tests/exception/bad/exceptions_cycle.catala_en +++ b/tests/exception/bad/exceptions_cycle.catala_en @@ -20,8 +20,9 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -Exception cycle detected when defining x: each of these 3 exceptions applies over the previous one, and the first applies over the last +[ERROR] Exception cycle detected when defining x: + each of these 3 exceptions applies over the previous one, and the first + applies over the last ┌─⯈ tests/exception/bad/exceptions_cycle.catala_en:8.3-10.15: └──┐ diff --git a/tests/exception/bad/missing_unlabeled_definition.catala_en b/tests/exception/bad/missing_unlabeled_definition.catala_en index 235364b8..fd9159ea 100644 --- a/tests/exception/bad/missing_unlabeled_definition.catala_en +++ b/tests/exception/bad/missing_unlabeled_definition.catala_en @@ -11,8 +11,7 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -This exception does not have a corresponding definition +[ERROR] This exception does not have a corresponding definition ┌─⯈ tests/exception/bad/missing_unlabeled_definition.catala_en:8.3-9.15: └─┐ diff --git a/tests/exception/bad/one_ambiguous_exception.catala_en b/tests/exception/bad/one_ambiguous_exception.catala_en index a75baff5..868db469 100644 --- a/tests/exception/bad/one_ambiguous_exception.catala_en +++ b/tests/exception/bad/one_ambiguous_exception.catala_en @@ -21,8 +21,8 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -This exception can refer to several definitions. Try using labels to disambiguate +[ERROR] This exception can refer to several definitions. Try using labels to + disambiguate Ambiguous exception ┌─⯈ tests/exception/bad/one_ambiguous_exception.catala_en:18.3-19.15: diff --git a/tests/exception/bad/self_exception.catala_en b/tests/exception/bad/self_exception.catala_en index 4ff4f3c8..b3eb556e 100644 --- a/tests/exception/bad/self_exception.catala_en +++ b/tests/exception/bad/self_exception.catala_en @@ -12,8 +12,7 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -Cannot define rule as an exception to itself +[ERROR] Cannot define rule as an exception to itself ┌─⯈ tests/exception/bad/self_exception.catala_en:9.13-9.19: └─┐ diff --git a/tests/exception/bad/two_exceptions.catala_en b/tests/exception/bad/two_exceptions.catala_en index f620cb80..b5cc8a57 100644 --- a/tests/exception/bad/two_exceptions.catala_en +++ b/tests/exception/bad/two_exceptions.catala_en @@ -19,8 +19,8 @@ Note: ideally this could use test-scope but some positions are lost during trans ```catala-test-inline $ catala interpret -s A -[ERROR] -There is a conflict between multiple valid consequences for assigning the same variable. +[ERROR] There is a conflict between multiple valid consequences for assigning + the same variable. This consequence has a valid justification: ┌─⯈ tests/exception/bad/two_exceptions.catala_en:12.23-12.24: diff --git a/tests/exception/good/double_definition.catala_en b/tests/exception/good/double_definition.catala_en index a0c11fd7..94f5f532 100644 --- a/tests/exception/good/double_definition.catala_en +++ b/tests/exception/good/double_definition.catala_en @@ -14,7 +14,8 @@ scope Foo: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] These definitions have identical justifications and consequences; is it a mistake? +[WARNING] These definitions have identical justifications and consequences; + is it a mistake? ┌─⯈ tests/exception/good/double_definition.catala_en:9.3-9.15: └─┐ @@ -33,7 +34,8 @@ $ catala Typecheck --check-invariants ```catala-test-inline $ catala Scopelang -s Foo -[WARNING] These definitions have identical justifications and consequences; is it a mistake? +[WARNING] These definitions have identical justifications and consequences; + is it a mistake? ┌─⯈ tests/exception/good/double_definition.catala_en:9.3-9.15: └─┐ @@ -58,7 +60,8 @@ Dcalc translation below. ```catala-test-inline $ catala Dcalc -s Foo -[WARNING] These definitions have identical justifications and consequences; is it a mistake? +[WARNING] These definitions have identical justifications and consequences; + is it a mistake? ┌─⯈ tests/exception/good/double_definition.catala_en:9.3-9.15: └─┐ diff --git a/tests/func/bad/bad_func.catala_en b/tests/func/bad/bad_func.catala_en index 3fc26789..2099ab66 100644 --- a/tests/func/bad/bad_func.catala_en +++ b/tests/func/bad/bad_func.catala_en @@ -31,8 +31,8 @@ Note: ideally this could use test-scope but some positions are lost during trans ```catala-test-inline $ catala interpret -s S -[ERROR] -There is a conflict between multiple valid consequences for assigning the same variable. +[ERROR] There is a conflict between multiple valid consequences for assigning + the same variable. This consequence has a valid justification: ┌─⯈ tests/func/bad/bad_func.catala_en:14.65-14.70: diff --git a/tests/func/bad/param_inconsistency.catala_en b/tests/func/bad/param_inconsistency.catala_en index 992f4aa3..707ba3e6 100644 --- a/tests/func/bad/param_inconsistency.catala_en +++ b/tests/func/bad/param_inconsistency.catala_en @@ -14,8 +14,8 @@ scope S: ```catala-test-inline $ catala typecheck -[ERROR] -Function argument name mismatch between declaration ('x') and definition ('y') +[ERROR] Function argument name mismatch between declaration ('x') and + definition ('y') Argument declared here: ┌─⯈ tests/func/bad/param_inconsistency.catala_en:4.42-4.43: diff --git a/tests/func/bad/param_inconsistency2.catala_en b/tests/func/bad/param_inconsistency2.catala_en index 32c1b78c..60875e2a 100644 --- a/tests/func/bad/param_inconsistency2.catala_en +++ b/tests/func/bad/param_inconsistency2.catala_en @@ -13,8 +13,8 @@ scope S: ```catala-test-inline $ catala typecheck -[ERROR] -Function argument name mismatch between declaration ('x') and definition ('y') +[ERROR] Function argument name mismatch between declaration ('x') and + definition ('y') Argument declared here: ┌─⯈ tests/func/bad/param_inconsistency2.catala_en:4.42-4.43: diff --git a/tests/func/bad/param_inconsistency3.catala_en b/tests/func/bad/param_inconsistency3.catala_en index 510740e2..8d29d975 100644 --- a/tests/func/bad/param_inconsistency3.catala_en +++ b/tests/func/bad/param_inconsistency3.catala_en @@ -13,8 +13,8 @@ scope S: ```catala-test-inline $ catala typecheck -[ERROR] -Function argument name mismatch between declaration ('x') and definition ('y') +[ERROR] Function argument name mismatch between declaration ('x') and + definition ('y') Argument declared here: ┌─⯈ tests/func/bad/param_inconsistency3.catala_en:4.42-4.43: diff --git a/tests/func/bad/recursive.catala_en b/tests/func/bad/recursive.catala_en index 4c8ac371..cd2f0444 100644 --- a/tests/func/bad/recursive.catala_en +++ b/tests/func/bad/recursive.catala_en @@ -10,8 +10,8 @@ scope RecursiveFunc: ```catala-test-inline $ catala test-scope RecursiveFunc -[ERROR] -The variable f is used in one of its definitions, but recursion is forbidden in Catala +[ERROR] The variable f is used in one of its definitions + (Catala doesn't support recursion) ┌─⯈ tests/func/bad/recursive.catala_en:8.28-8.29: └─┐ diff --git a/tests/func/good/context_func.catala_en b/tests/func/good/context_func.catala_en index ee7f4e1c..a04517bc 100644 --- a/tests/func/good/context_func.catala_en +++ b/tests/func/good/context_func.catala_en @@ -19,7 +19,8 @@ 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? +[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: └─┐ @@ -32,7 +33,8 @@ $ catala Typecheck --check-invariants ```catala-test-inline $ catala Scopelang -s B -[WARNING] Unused varible: a does not contribute to computing any of scope B outputs. Did you forget something? +[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: └─┐ @@ -46,7 +48,8 @@ let scope B (b: bool|input) (a: A {f: integer → integer}|internal) = ```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? +[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: └─┐ @@ -68,7 +71,8 @@ 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? +[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: └─┐ diff --git a/tests/io/bad/forgot_input.catala_en b/tests/io/bad/forgot_input.catala_en index 565f266c..97b5d8aa 100644 --- a/tests/io/bad/forgot_input.catala_en +++ b/tests/io/bad/forgot_input.catala_en @@ -16,8 +16,8 @@ scope B: ``` ```catala-test-inline $ catala Typecheck -[ERROR] -This subscope variable is a mandatory input but no definition was provided. +[ERROR] This subscope variable is a mandatory input but no definition was + provided. Incriminated subscope: ┌─⯈ tests/io/bad/forgot_input.catala_en:9.3-9.4: diff --git a/tests/io/bad/inputing_to_not_input.catala_en b/tests/io/bad/inputing_to_not_input.catala_en index ae99fa6a..357d3a9a 100644 --- a/tests/io/bad/inputing_to_not_input.catala_en +++ b/tests/io/bad/inputing_to_not_input.catala_en @@ -16,8 +16,8 @@ scope B: ``` ```catala-test-inline $ catala Typecheck -[ERROR] -Invalid assignment to a subscope variable that is not tagged as input or context. +[ERROR] 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: diff --git a/tests/io/bad/redefining_input.catala_en b/tests/io/bad/redefining_input.catala_en index 84b6a6b0..ff0234b2 100644 --- a/tests/io/bad/redefining_input.catala_en +++ b/tests/io/bad/redefining_input.catala_en @@ -9,8 +9,7 @@ scope A: ``` ```catala-test-inline $ catala Typecheck -[ERROR] -It is impossible to give a definition to a scope variable tagged as input. +[ERROR] There cannot be a definition for a scope variable tagged as input. Incriminated variable: ┌─⯈ tests/io/bad/redefining_input.catala_en:5.16-5.17: diff --git a/tests/io/bad/using_non_output.catala_en b/tests/io/bad/using_non_output.catala_en index 8f658513..d9bb5f50 100644 --- a/tests/io/bad/using_non_output.catala_en +++ b/tests/io/bad/using_non_output.catala_en @@ -15,8 +15,7 @@ scope B: ``` ```catala-test-inline $ catala Typecheck -[ERROR] -Variable a is not a declared output of scope A. +[ERROR] Variable a is not a declared output of scope A. a is used here as an output ┌─⯈ tests/io/bad/using_non_output.catala_en:14.13-14.16: diff --git a/tests/modules/bad/mod_bad_include.catala_en b/tests/modules/bad/mod_bad_include.catala_en index 34f8778e..6d49b1d8 100644 --- a/tests/modules/bad/mod_bad_include.catala_en +++ b/tests/modules/bad/mod_bad_include.catala_en @@ -3,8 +3,9 @@ ```catala-test-inline $ catala typecheck -[ERROR] -A file that declares a module cannot be used through the raw '> Include' directive. You should use it as a module with '> Use This_is_not_the_file_name' instead. +[ERROR] A file that declares a module cannot be used through the raw '> Include' + directive. You should use it as a module with + '> Use This_is_not_the_file_name' instead. File include ┌─⯈ tests/modules/bad/mod_bad_include.catala_en:1.3-1.33: diff --git a/tests/modules/bad/mod_badname.catala_en b/tests/modules/bad/mod_badname.catala_en index d943729d..f8c4aaff 100644 --- a/tests/modules/bad/mod_badname.catala_en +++ b/tests/modules/bad/mod_badname.catala_en @@ -3,11 +3,10 @@ ```catala-test-inline $ catala typecheck -[ERROR] -Module declared as This_is_not_the_file_name, which does not match the file -name "tests/modules/bad/mod_badname.catala_en". Rename the module to -Mod_badname or the file to -"tests/modules/bad/This_is_not_the_file_name.catala_en". +[ERROR] Module declared as This_is_not_the_file_name, which does not match + the file name "tests/modules/bad/mod_badname.catala_en". + Rename the module to Mod_badname or the file to + "tests/modules/bad/This_is_not_the_file_name.catala_en". ┌─⯈ tests/modules/bad/mod_badname.catala_en:1.10-1.35: └─┐ diff --git a/tests/money/bad/no_mingle.catala_en b/tests/money/bad/no_mingle.catala_en index 7d5686ea..7ea1a5d3 100644 --- a/tests/money/bad/no_mingle.catala_en +++ b/tests/money/bad/no_mingle.catala_en @@ -14,9 +14,7 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -I don't know how to apply operator * on types money and -money +[ERROR] I don't know how to apply operator * on types money and money ┌─⯈ tests/money/bad/no_mingle.catala_en:12.24-12.29: └──┐ diff --git a/tests/name_resolution/bad/toplevel_defs.catala_en b/tests/name_resolution/bad/toplevel_defs.catala_en index 15fde244..cda78acf 100644 --- a/tests/name_resolution/bad/toplevel_defs.catala_en +++ b/tests/name_resolution/bad/toplevel_defs.catala_en @@ -13,8 +13,7 @@ declaration glob5 content decimal ```catala-test-inline $ catala typecheck -[ERROR] -Scope calls are not allowed outside of a scope +[ERROR] Scope calls are not allowed outside of a scope ┌─⯈ tests/name_resolution/bad/toplevel_defs.catala_en:11.11-11.23: └──┐ diff --git a/tests/name_resolution/good/let_in.catala_en b/tests/name_resolution/good/let_in.catala_en index b1a9bb8f..fd560ebc 100644 --- a/tests/name_resolution/good/let_in.catala_en +++ b/tests/name_resolution/good/let_in.catala_en @@ -55,7 +55,8 @@ 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? +[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: └──┐ diff --git a/tests/proof/bad/dates_get_year-empty.catala_en b/tests/proof/bad/dates_get_year-empty.catala_en index 9d50589f..96314679 100644 --- a/tests/proof/bad/dates_get_year-empty.catala_en +++ b/tests/proof/bad/dates_get_year-empty.catala_en @@ -15,8 +15,7 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[ERROR] -It is impossible to give a definition to a scope variable tagged as input. +[ERROR] There cannot be a definition for a scope variable tagged as input. Incriminated variable: ┌─⯈ tests/proof/bad/dates_get_year-empty.catala_en:5.9-5.10: diff --git a/tests/proof/bad/enums-empty.catala_en b/tests/proof/bad/enums-empty.catala_en index 68ff98f9..1e297a2d 100644 --- a/tests/proof/bad/enums-empty.catala_en +++ b/tests/proof/bad/enums-empty.catala_en @@ -23,7 +23,8 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary? +[WARNING] The constructor "C" of enumeration "T" is never used; + maybe it's unnecessary? ┌─⯈ tests/proof/bad/enums-empty.catala_en:7.7-7.8: └─┐ diff --git a/tests/proof/bad/enums-nonbool-empty.catala_en b/tests/proof/bad/enums-nonbool-empty.catala_en index 54411e1f..96870b75 100644 --- a/tests/proof/bad/enums-nonbool-empty.catala_en +++ b/tests/proof/bad/enums-nonbool-empty.catala_en @@ -21,7 +21,8 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary? +[WARNING] The constructor "C" of enumeration "T" is never used; + maybe it's unnecessary? ┌─⯈ tests/proof/bad/enums-nonbool-empty.catala_en:5.7-5.8: └─┐ diff --git a/tests/proof/bad/enums-nonbool-overlap.catala_en b/tests/proof/bad/enums-nonbool-overlap.catala_en index 27fde5e2..25e9fdb8 100644 --- a/tests/proof/bad/enums-nonbool-overlap.catala_en +++ b/tests/proof/bad/enums-nonbool-overlap.catala_en @@ -21,7 +21,8 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary? +[WARNING] The constructor "C" of enumeration "T" is never used; + maybe it's unnecessary? ┌─⯈ tests/proof/bad/enums-nonbool-overlap.catala_en:5.7-5.8: └─┐ diff --git a/tests/proof/bad/enums-overlap.catala_en b/tests/proof/bad/enums-overlap.catala_en index db8a6db2..ad4f78e1 100644 --- a/tests/proof/bad/enums-overlap.catala_en +++ b/tests/proof/bad/enums-overlap.catala_en @@ -23,7 +23,8 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary? +[WARNING] The constructor "C" of enumeration "T" is never used; + maybe it's unnecessary? ┌─⯈ tests/proof/bad/enums-overlap.catala_en:7.7-7.8: └─┐ diff --git a/tests/proof/bad/enums_inj-empty.catala_en b/tests/proof/bad/enums_inj-empty.catala_en index 73099a08..f922a195 100644 --- a/tests/proof/bad/enums_inj-empty.catala_en +++ b/tests/proof/bad/enums_inj-empty.catala_en @@ -16,7 +16,8 @@ scope A: ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C2" of enumeration "E" is never used; maybe it's unnecessary? +[WARNING] The constructor "C2" of enumeration "E" is never used; + maybe it's unnecessary? ┌─⯈ tests/proof/bad/enums_inj-empty.catala_en:6.6-6.8: └─┐ diff --git a/tests/proof/bad/prolala_motivating_example.catala_en b/tests/proof/bad/prolala_motivating_example.catala_en index bfb14387..19f4148f 100644 --- a/tests/proof/bad/prolala_motivating_example.catala_en +++ b/tests/proof/bad/prolala_motivating_example.catala_en @@ -123,8 +123,8 @@ scope Amount: ```catala-test-inline $ catala Proof --disable-counterexamples -[ERROR] -Invalid assignment to a subscope variable that is not tagged as input or context. +[ERROR] 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: diff --git a/tests/proof/good/enums-arith.catala_en b/tests/proof/good/enums-arith.catala_en index 9019ccf5..34e2d9fb 100644 --- a/tests/proof/good/enums-arith.catala_en +++ b/tests/proof/good/enums-arith.catala_en @@ -23,7 +23,8 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary? +[WARNING] The constructor "C" of enumeration "T" is never used; + maybe it's unnecessary? ┌─⯈ tests/proof/good/enums-arith.catala_en:5.7-5.8: └─┐ @@ -36,7 +37,8 @@ $ catala Typecheck --check-invariants ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary? +[WARNING] The constructor "C" of enumeration "T" is never used; + maybe it's unnecessary? ┌─⯈ tests/proof/good/enums-arith.catala_en:5.7-5.8: └─┐ diff --git a/tests/proof/good/enums-nonbool.catala_en b/tests/proof/good/enums-nonbool.catala_en index 57484ed9..a7c44895 100644 --- a/tests/proof/good/enums-nonbool.catala_en +++ b/tests/proof/good/enums-nonbool.catala_en @@ -23,7 +23,8 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary? +[WARNING] The constructor "C" of enumeration "T" is never used; + maybe it's unnecessary? ┌─⯈ tests/proof/good/enums-nonbool.catala_en:5.7-5.8: └─┐ @@ -36,7 +37,8 @@ $ catala Typecheck --check-invariants ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary? +[WARNING] The constructor "C" of enumeration "T" is never used; + maybe it's unnecessary? ┌─⯈ tests/proof/good/enums-nonbool.catala_en:5.7-5.8: └─┐ diff --git a/tests/proof/good/enums.catala_en b/tests/proof/good/enums.catala_en index 385e3126..3cda97a7 100644 --- a/tests/proof/good/enums.catala_en +++ b/tests/proof/good/enums.catala_en @@ -22,7 +22,8 @@ scope A: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary? +[WARNING] The constructor "C" of enumeration "T" is never used; + maybe it's unnecessary? ┌─⯈ tests/proof/good/enums.catala_en:5.7-5.8: └─┐ @@ -35,7 +36,8 @@ $ catala Typecheck --check-invariants ```catala-test-inline $ catala Proof --disable-counterexamples -[WARNING] The constructor "C" of enumeration "T" is never used; maybe it's unnecessary? +[WARNING] The constructor "C" of enumeration "T" is never used; + maybe it's unnecessary? ┌─⯈ tests/proof/good/enums.catala_en:5.7-5.8: └─┐ diff --git a/tests/scope/bad/cycle_in_scope.catala_en b/tests/scope/bad/cycle_in_scope.catala_en index 5a40dede..471c3817 100644 --- a/tests/scope/bad/cycle_in_scope.catala_en +++ b/tests/scope/bad/cycle_in_scope.catala_en @@ -16,8 +16,7 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -Cyclic dependency detected between the following variables of scope A: +[ERROR] Cyclic dependency detected between the following variables of scope A: z → x → y → z z is used here in the definition of x: diff --git a/tests/scope/bad/cyclic_scope_calls.catala_en b/tests/scope/bad/cyclic_scope_calls.catala_en index 81c94de9..75c4a273 100644 --- a/tests/scope/bad/cyclic_scope_calls.catala_en +++ b/tests/scope/bad/cyclic_scope_calls.catala_en @@ -28,8 +28,7 @@ scope S4: ```catala-test-inline $ catala typecheck -[ERROR] -Cyclic dependency detected between the following scopes: +[ERROR] Cyclic dependency detected between the following scopes: S4 → S3 → S2 → S4 S4 is used here in the definition of S3: diff --git a/tests/scope/bad/cyclic_scopes.catala_en b/tests/scope/bad/cyclic_scopes.catala_en index 41ff50be..efb316c6 100644 --- a/tests/scope/bad/cyclic_scopes.catala_en +++ b/tests/scope/bad/cyclic_scopes.catala_en @@ -18,8 +18,8 @@ scope B: ```catala-test-inline $ catala test-scope A -[ERROR] -Cyclic dependency detected between the following scopes: B → A → B +[ERROR] Cyclic dependency detected between the following scopes: + B → A → B B is used here in the definition of A: ┌─⯈ tests/scope/bad/cyclic_scopes.catala_en:5.3-5.4: diff --git a/tests/scope/bad/scope.catala_en b/tests/scope/bad/scope.catala_en index e5892362..a77e3a8c 100644 --- a/tests/scope/bad/scope.catala_en +++ b/tests/scope/bad/scope.catala_en @@ -18,8 +18,8 @@ Note: ideally this could use test-scope but some positions are lost during trans ```catala-test-inline $ catala interpret -s A -[ERROR] -There is a conflict between multiple valid consequences for assigning the same variable. +[ERROR] There is a conflict between multiple valid consequences for assigning + the same variable. This consequence has a valid justification: ┌─⯈ tests/scope/bad/scope.catala_en:13.57-13.61: diff --git a/tests/scope/bad/scope_call_duplicate.catala_en b/tests/scope/bad/scope_call_duplicate.catala_en index 4ec802e6..900ca3c4 100644 --- a/tests/scope/bad/scope_call_duplicate.catala_en +++ b/tests/scope/bad/scope_call_duplicate.catala_en @@ -16,8 +16,7 @@ scope Titi: ```catala-test-inline $ catala dcalc -s Titi -[ERROR] -Duplicate definition of scope input variable 'bar' +[ERROR] Duplicate definition of scope input variable 'bar' ┌─⯈ tests/scope/bad/scope_call_duplicate.catala_en:14.70-14.73: └──┐ diff --git a/tests/scope/bad/scope_call_extra.catala_en b/tests/scope/bad/scope_call_extra.catala_en index 41356e9d..8ecfdb93 100644 --- a/tests/scope/bad/scope_call_extra.catala_en +++ b/tests/scope/bad/scope_call_extra.catala_en @@ -16,8 +16,7 @@ scope Titi: ```catala-test-inline $ catala dcalc -s Titi -[ERROR] -Scope Toto has no input variable biz +[ERROR] Scope Toto has no input variable biz ┌─⯈ tests/scope/bad/scope_call_extra.catala_en:14.49-14.52: └──┐ diff --git a/tests/scope/bad/scope_call_missing.catala_en b/tests/scope/bad/scope_call_missing.catala_en index f156962e..ae0d7156 100644 --- a/tests/scope/bad/scope_call_missing.catala_en +++ b/tests/scope/bad/scope_call_missing.catala_en @@ -16,8 +16,7 @@ scope Titi: ```catala-test-inline $ catala dcalc -s Titi -[ERROR] -Definition of input variable 'baz' missing in this scope call +[ERROR] Definition of input variable 'baz' missing in this scope call ┌─⯈ tests/scope/bad/scope_call_missing.catala_en:14.26-14.57: └──┐ diff --git a/tests/scope/bad/sub_vars_in_sub_var.catala_en b/tests/scope/bad/sub_vars_in_sub_var.catala_en index 8d59ef92..a1e6f55d 100644 --- a/tests/scope/bad/sub_vars_in_sub_var.catala_en +++ b/tests/scope/bad/sub_vars_in_sub_var.catala_en @@ -15,8 +15,8 @@ scope B: ```catala-test-inline $ catala test-scope A -[ERROR] -The subscope a is used in the definition of its own input a.y, but recursion is forbidden in Catala +[ERROR] The subscope a is used in the definition of its own input a.y + (Catala doesn't support recursion) ┌─⯈ tests/scope/bad/sub_vars_in_sub_var.catala_en:13.28-13.29: └──┐ diff --git a/tests/scope/good/local-capture-subscope.catala_en b/tests/scope/good/local-capture-subscope.catala_en index a0e27007..f74a2ea7 100644 --- a/tests/scope/good/local-capture-subscope.catala_en +++ b/tests/scope/good/local-capture-subscope.catala_en @@ -20,7 +20,8 @@ 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? +[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: └─┐ diff --git a/tests/scope/good/nothing.catala_en b/tests/scope/good/nothing.catala_en index eea35a49..ebc10356 100644 --- a/tests/scope/good/nothing.catala_en +++ b/tests/scope/good/nothing.catala_en @@ -9,7 +9,8 @@ declaration scope Foo2: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] In scope "Foo2", the variable "bar" is declared but never defined; did you forget something? +[WARNING] In scope "Foo2", the variable "bar" is declared but never defined; + did you forget something? ┌─⯈ tests/scope/good/nothing.catala_en:5.10-5.13: └─┐ @@ -22,7 +23,8 @@ $ catala Typecheck --check-invariants ```catala-test-inline $ catala Scalc -s Foo2 -O -t -[WARNING] In scope "Foo2", the variable "bar" is declared but never defined; did you forget something? +[WARNING] In scope "Foo2", the variable "bar" is declared but never defined; + did you forget something? ┌─⯈ tests/scope/good/nothing.catala_en:5.10-5.13: └─┐ diff --git a/tests/scope/good/scope_call2.catala_en b/tests/scope/good/scope_call2.catala_en index a8e43338..e92150b3 100644 --- a/tests/scope/good/scope_call2.catala_en +++ b/tests/scope/good/scope_call2.catala_en @@ -22,7 +22,8 @@ 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? +[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: └──┐ @@ -34,7 +35,8 @@ $ catala Typecheck --check-invariants ```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? +[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: └──┐ diff --git a/tests/scope/good/sub_sub_scope.catala_en b/tests/scope/good/sub_sub_scope.catala_en index 66b8df99..f9dacf51 100644 --- a/tests/scope/good/sub_sub_scope.catala_en +++ b/tests/scope/good/sub_sub_scope.catala_en @@ -34,14 +34,16 @@ 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? +[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? +[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: └──┐ @@ -54,14 +56,16 @@ $ catala Typecheck --check-invariants ```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? +[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? +[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: └──┐ @@ -75,14 +79,16 @@ $ 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? +[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? +[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: └──┐ @@ -95,14 +101,16 @@ $ catala test-scope B ```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? +[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? +[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: └──┐ diff --git a/tests/struct/bad/bug_107.catala_en b/tests/struct/bad/bug_107.catala_en index b46e67d4..8b04b6af 100644 --- a/tests/struct/bad/bug_107.catala_en +++ b/tests/struct/bad/bug_107.catala_en @@ -18,8 +18,7 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -struct name "S" already defined +[ERROR] struct name "S" already defined First definition: ┌─⯈ tests/struct/bad/bug_107.catala_en:4.23-4.24: diff --git a/tests/struct/bad/empty_struct.catala_en b/tests/struct/bad/empty_struct.catala_en index 94be9b08..de21db3e 100644 --- a/tests/struct/bad/empty_struct.catala_en +++ b/tests/struct/bad/empty_struct.catala_en @@ -9,8 +9,8 @@ declaration scope Bar: ```catala-test-inline $ catala Typecheck -[ERROR] -The struct Foo does not have any fields; give it some for Catala to be able to accept it. +[ERROR] The struct Foo does not have any fields; + give it some for Catala to be able to accept it. ┌─⯈ tests/struct/bad/empty_struct.catala_en:4.23-4.26: └─┐ diff --git a/tests/struct/bad/nested.catala_en b/tests/struct/bad/nested.catala_en index 2c169ea5..f0bebd38 100644 --- a/tests/struct/bad/nested.catala_en +++ b/tests/struct/bad/nested.catala_en @@ -14,15 +14,16 @@ scope A: ```catala-test-inline $ catala test-scope A -[WARNING] The constructor "Rec" of enumeration "E" is never used; maybe it's unnecessary? +[WARNING] The constructor "Rec" of enumeration "E" is never used; + maybe it's unnecessary? ┌─⯈ tests/struct/bad/nested.catala_en:6.6-6.9: └─┐ 6 │ -- Rec content E │ ‾‾‾ └─ Article -[ERROR] -The type E is defined using itself, which is forbidden since Catala does not provide recursive types +[ERROR] The type E is defined using itself, which is not supported + (Catala does not allow recursive types) ┌─⯈ tests/struct/bad/nested.catala_en:6.18-6.19: └─┐ diff --git a/tests/struct/bad/nested2.catala_en b/tests/struct/bad/nested2.catala_en index d54f2afd..d765a7ab 100644 --- a/tests/struct/bad/nested2.catala_en +++ b/tests/struct/bad/nested2.catala_en @@ -15,7 +15,8 @@ declaration scope A: ```catala-test-inline $ catala test-scope A -[WARNING] In scope "A", the variable "x" is declared but never defined; did you forget something? +[WARNING] In scope "A", the variable "x" is declared but never defined; + did you forget something? ┌─⯈ tests/struct/bad/nested2.catala_en:13.10-13.11: └──┐ @@ -36,8 +37,7 @@ $ catala test-scope A 8 │ declaration enumeration E: │ ‾ └─ Article -[ERROR] -Cyclic dependency detected between types! +[ERROR] Cyclic dependency detected between types! Cycle type S, declared: ┌─⯈ tests/struct/bad/nested2.catala_en:4.23-4.24: diff --git a/tests/struct/bad/nonexisting_struct.catala_en b/tests/struct/bad/nonexisting_struct.catala_en index e2d76085..223e2969 100644 --- a/tests/struct/bad/nonexisting_struct.catala_en +++ b/tests/struct/bad/nonexisting_struct.catala_en @@ -15,8 +15,7 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -No struct named Fo found +[ERROR] No struct named Fo found ┌─⯈ tests/struct/bad/nonexisting_struct.catala_en:13.25-13.27: └──┐ diff --git a/tests/struct/bad/wrong_qualified_field.catala_en b/tests/struct/bad/wrong_qualified_field.catala_en index e79fdd4b..c1dc455b 100644 --- a/tests/struct/bad/wrong_qualified_field.catala_en +++ b/tests/struct/bad/wrong_qualified_field.catala_en @@ -19,10 +19,8 @@ scope A: ```catala-test-inline $ catala test-scope A -[ERROR] -Field "g" does not belong to structure "Foo" -(however, structure "Bar" defines it) - +[ERROR] 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: └──┐ 17 │ definition y equals x.Foo.g diff --git a/tests/typing/bad/err1.catala_en b/tests/typing/bad/err1.catala_en index 9514727f..64fe1fff 100644 --- a/tests/typing/bad/err1.catala_en +++ b/tests/typing/bad/err1.catala_en @@ -12,10 +12,9 @@ scope S: ```catala-test-inline $ catala Typecheck -[ERROR] -Error during typechecking, incompatible types: -┌─⯈ decimal -└─⯈ integer +[ERROR] Error during typechecking, incompatible types: + ┌─⯈ decimal + └─⯈ integer This expression has type decimal: ┌─⯈ tests/typing/bad/err1.catala_en:7.23-7.26: diff --git a/tests/typing/bad/err2.catala_en b/tests/typing/bad/err2.catala_en index ebf67fa3..3411a686 100644 --- a/tests/typing/bad/err2.catala_en +++ b/tests/typing/bad/err2.catala_en @@ -12,10 +12,9 @@ scope S: ```catala-test-inline $ catala Typecheck -[ERROR] -Error during typechecking, incompatible types: -┌─⯈ decimal -└─⯈ list +[ERROR] Error during typechecking, incompatible types: + ┌─⯈ decimal + └─⯈ list This expression has type decimal: ┌─⯈ tests/typing/bad/err2.catala_en:10.39-10.42: diff --git a/tests/typing/bad/err3.catala_en b/tests/typing/bad/err3.catala_en index e4787707..00db4e14 100644 --- a/tests/typing/bad/err3.catala_en +++ b/tests/typing/bad/err3.catala_en @@ -12,16 +12,16 @@ scope S: ```catala-test-inline $ catala Typecheck -[WARNING] The constructor "Dec" of enumeration "Enum" is never used; maybe it's unnecessary? +[WARNING] The constructor "Dec" of enumeration "Enum" is never used; + maybe it's unnecessary? ┌─⯈ tests/typing/bad/common.catala_en:4.6-4.9: └─┐ 4 │ -- Dec content decimal │ ‾‾‾ -[ERROR] -Error during typechecking, incompatible types: -┌─⯈ integer -└─⯈ decimal +[ERROR] Error during typechecking, incompatible types: + ┌─⯈ integer + └─⯈ decimal This expression has type integer: ┌─⯈ tests/typing/bad/err3.catala_en:10.23-10.45: @@ -41,16 +41,16 @@ Re-putting the same check again, to ensure that the `Typecheck` and `ocaml` subc ```catala-test-inline $ catala ocaml -[WARNING] The constructor "Dec" of enumeration "Enum" is never used; maybe it's unnecessary? +[WARNING] The constructor "Dec" of enumeration "Enum" is never used; + maybe it's unnecessary? ┌─⯈ tests/typing/bad/common.catala_en:4.6-4.9: └─┐ 4 │ -- Dec content decimal │ ‾‾‾ -[ERROR] -Error during typechecking, incompatible types: -┌─⯈ integer -└─⯈ decimal +[ERROR] Error during typechecking, incompatible types: + ┌─⯈ integer + └─⯈ decimal This expression has type integer: ┌─⯈ tests/typing/bad/err3.catala_en:10.23-10.45: diff --git a/tests/typing/bad/err4.catala_en b/tests/typing/bad/err4.catala_en index 17522a6d..b3f29ebd 100644 --- a/tests/typing/bad/err4.catala_en +++ b/tests/typing/bad/err4.catala_en @@ -16,22 +16,23 @@ $ catala ocaml └─┐ 7 │ declaration structure Structure: │ ‾‾‾‾‾‾‾‾‾ -[WARNING] The constructor "Dec" of enumeration "Enum" is never used; maybe it's unnecessary? +[WARNING] The constructor "Dec" of enumeration "Enum" is never used; + maybe it's unnecessary? ┌─⯈ tests/typing/bad/common.catala_en:4.6-4.9: └─┐ 4 │ -- Dec content decimal │ ‾‾‾ -[WARNING] The constructor "Dat" of enumeration "Enum" is never used; maybe it's unnecessary? +[WARNING] The constructor "Dat" of enumeration "Enum" is never used; + maybe it's unnecessary? ┌─⯈ tests/typing/bad/common.catala_en:5.6-5.9: └─┐ 5 │ -- Dat content date │ ‾‾‾ -[ERROR] -Error during typechecking, incompatible types: -┌─⯈ Enum -└─⯈ Structure +[ERROR] Error during typechecking, incompatible types: + ┌─⯈ Enum + └─⯈ Structure This expression has type Enum: ┌─⯈ tests/typing/bad/err4.catala_en:5.25-5.38: diff --git a/tests/typing/bad/err5.catala_en b/tests/typing/bad/err5.catala_en index aad5c3d7..add1e9fa 100644 --- a/tests/typing/bad/err5.catala_en +++ b/tests/typing/bad/err5.catala_en @@ -12,10 +12,9 @@ scope S: ```catala-test-inline $ catala Typecheck -[ERROR] -Error during typechecking, incompatible types: -┌─⯈ integer -└─⯈ Structure +[ERROR] Error during typechecking, incompatible types: + ┌─⯈ integer + └─⯈ Structure This expression has type integer: ┌─⯈ tests/typing/bad/err5.catala_en:8.5-8.9: diff --git a/tests/typing/bad/err6.catala_en b/tests/typing/bad/err6.catala_en index db5500ed..f68121fc 100644 --- a/tests/typing/bad/err6.catala_en +++ b/tests/typing/bad/err6.catala_en @@ -28,10 +28,9 @@ Should be "catala Typecheck", see test err3 ```catala-test-inline $ catala ocaml -[ERROR] -Error during typechecking, incompatible types: -┌─⯈ decimal -└─⯈ integer +[ERROR] Error during typechecking, incompatible types: + ┌─⯈ decimal + └─⯈ integer This expression has type decimal: ┌─⯈ tests/typing/bad/err6.catala_en:20.27-20.30: diff --git a/tests/typing/good/common.catala_en b/tests/typing/good/common.catala_en index 004d46ce..defa1e3a 100644 --- a/tests/typing/good/common.catala_en +++ b/tests/typing/good/common.catala_en @@ -19,19 +19,22 @@ declaration scope S: ```catala-test-inline $ catala Typecheck --check-invariants -[WARNING] In scope "S", the variable "z" is declared but never defined; did you forget something? +[WARNING] In scope "S", the variable "z" is declared but never defined; + did you forget something? ┌─⯈ tests/typing/good/common.catala_en:14.10-14.11: └──┐ 14 │ output z content list of Structure │ ‾ -[WARNING] In scope "S", the variable "a" is declared but never defined; did you forget something? +[WARNING] In scope "S", the variable "a" is declared but never defined; + did you forget something? ┌─⯈ tests/typing/good/common.catala_en:15.10-15.11: └──┐ 15 │ output a content decimal │ ‾ -[WARNING] Unused varible: x 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: └──┐ diff --git a/tests/variable_state/bad/def_no_state.catala_en b/tests/variable_state/bad/def_no_state.catala_en index 54645c84..22c5fc33 100644 --- a/tests/variable_state/bad/def_no_state.catala_en +++ b/tests/variable_state/bad/def_no_state.catala_en @@ -12,8 +12,8 @@ scope A: ```catala-test-inline $ catala Typecheck -[ERROR] -This definition does not indicate which state has to be considered for variable foo. +[ERROR] This definition does not indicate which state has to be considered + for variable foo. ┌─⯈ tests/variable_state/bad/def_no_state.catala_en:10.14-10.17: └──┐ diff --git a/tests/variable_state/bad/double_same_state.catala_en b/tests/variable_state/bad/double_same_state.catala_en index fea97dd1..8492354a 100644 --- a/tests/variable_state/bad/double_same_state.catala_en +++ b/tests/variable_state/bad/double_same_state.catala_en @@ -12,8 +12,8 @@ scope A: ```catala-test-inline $ catala Typecheck -[ERROR] -There are two states with the same name for the same variable: this is ambiguous. Please change the name of either states. +[ERROR] There are two states with the same name for the same variable: this + is ambiguous. Please change the name of either states. First instance of state "bar": ┌─⯈ tests/variable_state/bad/double_same_state.catala_en:6.11-6.14: diff --git a/tests/variable_state/bad/no_cross_exceptions.catala_en b/tests/variable_state/bad/no_cross_exceptions.catala_en index 6b426d0a..338285da 100644 --- a/tests/variable_state/bad/no_cross_exceptions.catala_en +++ b/tests/variable_state/bad/no_cross_exceptions.catala_en @@ -16,8 +16,7 @@ scope A: ```catala-test-inline $ catala Typecheck -[ERROR] -Unknown label for the scope variable foo@baz: "thing" +[ERROR] Unknown label for the scope variable foo@baz: "thing" ┌─⯈ tests/variable_state/bad/no_cross_exceptions.catala_en:14.13-14.18: └──┐ diff --git a/tests/variable_state/bad/self_reference_first_state.catala_en b/tests/variable_state/bad/self_reference_first_state.catala_en index d9a99993..9b0bde65 100644 --- a/tests/variable_state/bad/self_reference_first_state.catala_en +++ b/tests/variable_state/bad/self_reference_first_state.catala_en @@ -14,8 +14,8 @@ scope A: ```catala-test-inline $ catala Typecheck -[ERROR] -It is impossible to refer to the variable you are defining when defining its first state. +[ERROR] The definition of the initial state of this variable refers to + itself. ┌─⯈ tests/variable_state/bad/self_reference_first_state.catala_en:10.35-10.38: └──┐ diff --git a/tests/variable_state/bad/state_cycle.catala_en b/tests/variable_state/bad/state_cycle.catala_en index 10572f16..d4118589 100644 --- a/tests/variable_state/bad/state_cycle.catala_en +++ b/tests/variable_state/bad/state_cycle.catala_en @@ -21,8 +21,7 @@ scope A: ```catala-test-inline $ catala Typecheck -[ERROR] -Cyclic dependency detected between the following variables of scope A: +[ERROR] Cyclic dependency detected between the following variables of scope A: foofoo@bar → foofoo@baz → foo@bar → foo@baz → foofoo@bar foofoo@bar is used here in the definition of foofoo@baz: diff --git a/tests/variable_state/bad/unknown_state.catala_en b/tests/variable_state/bad/unknown_state.catala_en index 4b209b8a..b9f9ec02 100644 --- a/tests/variable_state/bad/unknown_state.catala_en +++ b/tests/variable_state/bad/unknown_state.catala_en @@ -14,8 +14,7 @@ scope A: ```catala-test-inline $ catala Typecheck -[ERROR] -This identifier is not a state declared for variable foo. +[ERROR] This identifier is not a state declared for variable foo. ┌─⯈ tests/variable_state/bad/unknown_state.catala_en:12.24-12.28: └──┐