diff --git a/compiler/catala_utils/messages.ml b/compiler/catala_utils/messages.ml index 2bd251f3..7ae6596f 100644 --- a/compiler/catala_utils/messages.ml +++ b/compiler/catala_utils/messages.ml @@ -101,7 +101,8 @@ let pp_marker target ppf () = (**{2 Printers}*) -(** Prints the argument after the correct marker and to the correct channel *) +(** Prints the argument after the correct marker and to the correct channel + (inside a vbox) *) let format target format = let ppf = get_ppf target in Format.pp_open_vbox ppf 0; @@ -137,7 +138,7 @@ let to_internal_error (content : Content.t) : Content.t = content with message = (fun ppf -> - Format.fprintf ppf "%s@\n%t" internal_error_prefix content.message); + Format.fprintf ppf "%s@,%t" internal_error_prefix content.message); } let emit_content (content : Content.t) (target : content_type) : unit = diff --git a/examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en b/examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en index 5c2e2463..c2972880 100644 --- a/examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en +++ b/examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en @@ -29,8 +29,8 @@ scope Test1: ```catala-test-inline $ catala Interpret -s Test1 [ERROR] Syntax error at token "scope" -Message: expected either 'condition', or 'content' followed by the expected variable type -Autosuggestion: did you mean "content", or maybe "condition"? + Message: expected either 'condition', or 'content' followed by the expected variable type + Autosuggestion: did you mean "content", or maybe "condition"? Error token: ┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.21-11.26: @@ -73,8 +73,8 @@ scope Test2: ```catala-test-inline $ catala Interpret -s Test2 [ERROR] Syntax error at token "scope" -Message: expected either 'condition', or 'content' followed by the expected variable type -Autosuggestion: did you mean "content", or maybe "condition"? + Message: expected either 'condition', or 'content' followed by the expected variable type + Autosuggestion: did you mean "content", or maybe "condition"? Error token: ┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.21-11.26: @@ -117,8 +117,8 @@ scope Test3: ```catala-test-inline $ catala Interpret -s Test3 [ERROR] Syntax error at token "scope" -Message: expected either 'condition', or 'content' followed by the expected variable type -Autosuggestion: did you mean "content", or maybe "condition"? + Message: expected either 'condition', or 'content' followed by the expected variable type + Autosuggestion: did you mean "content", or maybe "condition"? Error token: ┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.21-11.26: @@ -163,8 +163,8 @@ scope Test4: ```catala-test-inline $ catala Interpret -s Test4 [ERROR] Syntax error at token "scope" -Message: expected either 'condition', or 'content' followed by the expected variable type -Autosuggestion: did you mean "content", or maybe "condition"? + Message: expected either 'condition', or 'content' followed by the expected variable type + Autosuggestion: did you mean "content", or maybe "condition"? Error token: ┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.21-11.26: diff --git a/tests/test_array/bad/fold_error.catala_en b/tests/test_array/bad/fold_error.catala_en index 9c399559..9755a2cf 100644 --- a/tests/test_array/bad/fold_error.catala_en +++ b/tests/test_array/bad/fold_error.catala_en @@ -12,8 +12,7 @@ scope A: ```catala-test-inline $ catala Interpret -s 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/test_array/bad/fold_error.catala_en:10.50-10.52: └──┐ diff --git a/tests/test_array/good/aggregation_2.catala_en b/tests/test_array/good/aggregation_2.catala_en index 13686fd3..f2883507 100644 --- a/tests/test_array/good/aggregation_2.catala_en +++ b/tests/test_array/good/aggregation_2.catala_en @@ -33,9 +33,9 @@ scope B: $ catala Interpret -s A [RESULT] Computation successful! Results: [RESULT] x = - [ { S id = 0; income = $0.00; }; - { S id = 1; income = $9.00; }; - { S id = 2; income = $5.20; } ] + [ { S id = 0; income = $0.00; }; + { S id = 1; income = $9.00; }; + { S id = 2; income = $5.20; } ] ``` ```catala-test-inline @@ -48,10 +48,10 @@ $ catala Interpret -s B $ catala Interpret_Lcalc -s A --avoid_exceptions --optimize [RESULT] Computation successful! Results: [RESULT] x = - ESome - [ ESome { S id = ESome 0; income = ESome $0.00; }; - ESome { S id = ESome 1; income = ESome $9.00; }; - ESome { S id = ESome 2; income = ESome $5.20; } ] + ESome + [ ESome { S id = ESome 0; income = ESome $0.00; }; + ESome { S id = ESome 1; income = ESome $9.00; }; + ESome { S id = ESome 2; income = ESome $5.20; } ] ``` ```catala-test-inline $ catala Interpret_Lcalc -s B --avoid_exceptions --optimize diff --git a/tests/test_array/good/concatenation.catala_en b/tests/test_array/good/concatenation.catala_en index 12e187ec..b784a07f 100644 --- a/tests/test_array/good/concatenation.catala_en +++ b/tests/test_array/good/concatenation.catala_en @@ -19,18 +19,20 @@ $ catala Interpret -s A ```catala-test-inline $ catala Interpret_Lcalc -s A --avoid_exceptions --optimize [RESULT] Computation successful! Results: -[RESULT] x = ESome [ ESome 0; ESome 1; ESome 2; ESome 3; ESome 4; ESome 5; ESome 6 ] +[RESULT] x = + ESome + [ ESome 0; ESome 1; ESome 2; ESome 3; ESome 4; ESome 5; ESome 6 ] [RESULT] y = - ESome - [ ESome 0; - ESome 1; - ESome 2; - ESome 3; - ESome 4; - ESome 5; - ESome 6; - ESome 7; - ESome 8; - ESome 9; - ESome 10 ] + ESome + [ ESome 0; + ESome 1; + ESome 2; + ESome 3; + ESome 4; + ESome 5; + ESome 6; + ESome 7; + ESome 8; + ESome 9; + ESome 10 ] ``` diff --git a/tests/test_array/good/fold.catala_en b/tests/test_array/good/fold.catala_en index 13686fd3..f2883507 100644 --- a/tests/test_array/good/fold.catala_en +++ b/tests/test_array/good/fold.catala_en @@ -33,9 +33,9 @@ scope B: $ catala Interpret -s A [RESULT] Computation successful! Results: [RESULT] x = - [ { S id = 0; income = $0.00; }; - { S id = 1; income = $9.00; }; - { S id = 2; income = $5.20; } ] + [ { S id = 0; income = $0.00; }; + { S id = 1; income = $9.00; }; + { S id = 2; income = $5.20; } ] ``` ```catala-test-inline @@ -48,10 +48,10 @@ $ catala Interpret -s B $ catala Interpret_Lcalc -s A --avoid_exceptions --optimize [RESULT] Computation successful! Results: [RESULT] x = - ESome - [ ESome { S id = ESome 0; income = ESome $0.00; }; - ESome { S id = ESome 1; income = ESome $9.00; }; - ESome { S id = ESome 2; income = ESome $5.20; } ] + ESome + [ ESome { S id = ESome 0; income = ESome $0.00; }; + ESome { S id = ESome 1; income = ESome $9.00; }; + ESome { S id = ESome 2; income = ESome $5.20; } ] ``` ```catala-test-inline $ catala Interpret_Lcalc -s B --avoid_exceptions --optimize diff --git a/tests/test_bool/bad/bad_assert.catala_en b/tests/test_bool/bad/bad_assert.catala_en index fe95049d..8bb4eb4d 100644 --- a/tests/test_bool/bad/bad_assert.catala_en +++ b/tests/test_bool/bad/bad_assert.catala_en @@ -13,8 +13,8 @@ scope Foo: ```catala-test-inline $ catala Interpret -s Foo [ERROR] Error during typechecking, incompatible types: ---> integer ---> bool + --> integer + --> bool Error coming from typechecking the following expression: ┌─⯈ tests/test_bool/bad/bad_assert.catala_en:9.13-9.14: diff --git a/tests/test_bool/bad/test_xor_with_int.catala_en b/tests/test_bool/bad/test_xor_with_int.catala_en index 99816caf..8cf7e0da 100644 --- a/tests/test_bool/bad/test_xor_with_int.catala_en +++ b/tests/test_bool/bad/test_xor_with_int.catala_en @@ -11,8 +11,8 @@ scope TestXorWithInt: ```catala-test-inline $ catala Typecheck [ERROR] Error during typechecking, incompatible types: ---> integer ---> bool + --> integer + --> bool Error coming from typechecking the following expression: ┌─⯈ tests/test_bool/bad/test_xor_with_int.catala_en:8.30-8.32: diff --git a/tests/test_dec/good/infinite_precision.catala_en b/tests/test_dec/good/infinite_precision.catala_en index c73ea8b0..c5b3b32c 100644 --- a/tests/test_dec/good/infinite_precision.catala_en +++ b/tests/test_dec/good/infinite_precision.catala_en @@ -18,7 +18,7 @@ scope A: $ catala Interpret -s A [RESULT] Computation successful! Results: [RESULT] a = - -0.000000000000000000000000000000000000000000000000000000000078695580959228473468… + -0.000000000000000000000000000000000000000000000000000000000078695580959228473468… [RESULT] x = 84.64866565265689623 [RESULT] y = -4.3682977870532065498 [RESULT] z = 654265429805103220650980650.570540510654 @@ -27,8 +27,8 @@ $ catala Interpret -s A $ catala Interpret_Lcalc -s A --avoid_exceptions --optimize [RESULT] Computation successful! Results: [RESULT] a = - ESome - -0.000000000000000000000000000000000000000000000000000000000078695580959228473468… + ESome + -0.000000000000000000000000000000000000000000000000000000000078695580959228473468… [RESULT] x = ESome 84.64866565265689623 [RESULT] y = ESome -4.3682977870532065498 [RESULT] z = ESome 654265429805103220650980650.570540510654 diff --git a/tests/test_enum/bad/quick_pattern_2.catala_en b/tests/test_enum/bad/quick_pattern_2.catala_en index 967df6ce..cd61ebab 100644 --- a/tests/test_enum/bad/quick_pattern_2.catala_en +++ b/tests/test_enum/bad/quick_pattern_2.catala_en @@ -31,8 +31,8 @@ scope B: ```catala-test-inline $ catala Interpret -s A [ERROR] Error during typechecking, incompatible types: ---> E ---> F + --> E + --> F Error coming from typechecking the following expression: ┌─⯈ tests/test_enum/bad/quick_pattern_2.catala_en:28.23-28.24: diff --git a/tests/test_enum/bad/quick_pattern_3.catala_en b/tests/test_enum/bad/quick_pattern_3.catala_en index d5b2f13f..b7f5a54a 100644 --- a/tests/test_enum/bad/quick_pattern_3.catala_en +++ b/tests/test_enum/bad/quick_pattern_3.catala_en @@ -21,8 +21,8 @@ definition y equals x with pattern Case3 ```catala-test-inline $ catala Interpret -s A [ERROR] Error during typechecking, incompatible types: ---> E ---> F + --> E + --> F Error coming from typechecking the following expression: ┌─⯈ tests/test_enum/bad/quick_pattern_3.catala_en:18.21-18.22: diff --git a/tests/test_enum/bad/quick_pattern_4.catala_en b/tests/test_enum/bad/quick_pattern_4.catala_en index 689ac8f0..40789fc3 100644 --- a/tests/test_enum/bad/quick_pattern_4.catala_en +++ b/tests/test_enum/bad/quick_pattern_4.catala_en @@ -20,8 +20,8 @@ definition y equals x with pattern Case3 ```catala-test-inline $ catala Interpret -s A [ERROR] Error during typechecking, incompatible types: ---> E ---> F + --> E + --> F Error coming from typechecking the following expression: ┌─⯈ tests/test_enum/bad/quick_pattern_4.catala_en:17.21-17.22: diff --git a/tests/test_exception/good/groups_of_exceptions.catala_en b/tests/test_exception/good/groups_of_exceptions.catala_en index 830e3a3c..7ad2557c 100644 --- a/tests/test_exception/good/groups_of_exceptions.catala_en +++ b/tests/test_exception/good/groups_of_exceptions.catala_en @@ -48,38 +48,38 @@ let scope Foo (y: integer|input) (x: integer|internal|output) = $ catala Exceptions -s Foo -v x [RESULT] Printing the tree of exceptions for the definitions of variable "x" of scope "Foo". [RESULT] Definitions with label "base": -┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:9.3-9.26: -└─┐ -9 │ label base definition x under condition - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test -┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:13.3-13.26: -└──┐ -13 │ label base definition x under condition - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test + ┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:9.3-9.26: + └─┐ + 9 │ label base definition x under condition + │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + └─ Test + ┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:13.3-13.26: + └──┐ + 13 │ label base definition x under condition + │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + └─ Test [RESULT] Definitions with label "intermediate": -┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:17.3-17.49: -└──┐ -17 │ label intermediate exception base definition x under condition - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test -┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:21.3-21.49: -└──┐ -21 │ label intermediate exception base definition x under condition - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test + ┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:17.3-17.49: + └──┐ + 17 │ label intermediate exception base definition x under condition + │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + └─ Test + ┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:21.3-21.49: + └──┐ + 21 │ label intermediate exception base definition x under condition + │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + └─ Test [RESULT] Definitions with label "exception_to_intermediate": -┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:25.3-25.38: -└──┐ -25 │ exception intermediate definition x under condition - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test -┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:29.3-29.38: -└──┐ -29 │ exception intermediate definition x under condition - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - └─ Test + ┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:25.3-25.38: + └──┐ + 25 │ exception intermediate definition x under condition + │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + └─ Test + ┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:29.3-29.38: + └──┐ + 29 │ exception intermediate definition x under condition + │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + └─ Test [RESULT] The exception tree structure is as follows: "base"───"intermediate"───"exception_to_intermediate" diff --git a/tests/test_money/bad/no_mingle.catala_en b/tests/test_money/bad/no_mingle.catala_en index 776f6ef7..f24c5cb5 100644 --- a/tests/test_money/bad/no_mingle.catala_en +++ b/tests/test_money/bad/no_mingle.catala_en @@ -14,8 +14,7 @@ scope A: ```catala-test-inline $ catala Interpret -s 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/test_money/bad/no_mingle.catala_en:12.26-12.27: └──┐ diff --git a/tests/test_name_resolution/good/let_in.catala_en b/tests/test_name_resolution/good/let_in.catala_en index 04282d27..a62f107b 100644 --- a/tests/test_name_resolution/good/let_in.catala_en +++ b/tests/test_name_resolution/good/let_in.catala_en @@ -54,7 +54,11 @@ $ catala Interpret -s S2 $ catala Interpret_Lcalc -s S --avoid_exceptions --optimize [RESULT] Computation successful! Results: [RESULT] a = - ESome { A x = ESome -2.; y = ESome { B y = ESome false; z = ESome -1.; }; } + ESome + { A + x = ESome -2.; + y = ESome { B y = ESome false; z = ESome -1.; }; + } [RESULT] b = ESome { B y = ESome true; z = ESome 42.; } ``` ```catala-test-inline diff --git a/tests/test_name_resolution/good/out_of_order.catala_en b/tests/test_name_resolution/good/out_of_order.catala_en index 17a4e3a1..94fdead6 100644 --- a/tests/test_name_resolution/good/out_of_order.catala_en +++ b/tests/test_name_resolution/good/out_of_order.catala_en @@ -27,6 +27,11 @@ $ catala Interpret -s S ```catala-test-inline $ catala Interpret_Lcalc -s S --avoid_exceptions --optimize [RESULT] Computation successful! Results: -[RESULT] a = ESome { A x = ESome 0; y = ESome { B y = ESome true; z = ESome 0.; }; } +[RESULT] a = + ESome + { A + x = ESome 0; + y = ESome { B y = ESome true; z = ESome 0.; }; + } [RESULT] b = ESome { B y = ESome true; z = ESome 0.; } ``` diff --git a/tests/test_scope/bad/cycle_in_scope.catala_en b/tests/test_scope/bad/cycle_in_scope.catala_en index 423116b8..00b4119a 100644 --- a/tests/test_scope/bad/cycle_in_scope.catala_en +++ b/tests/test_scope/bad/cycle_in_scope.catala_en @@ -17,7 +17,7 @@ scope A: ```catala-test-inline $ catala Interpret -s A [ERROR] Cyclic dependency detected between the following variables of scope A: - z → x → y → z + z → x → y → z z is used here in the definition of x: ┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:14.23-14.24: diff --git a/tests/test_scope/bad/cyclic_scope_calls.catala_en b/tests/test_scope/bad/cyclic_scope_calls.catala_en index 50391b75..073a6c07 100644 --- a/tests/test_scope/bad/cyclic_scope_calls.catala_en +++ b/tests/test_scope/bad/cyclic_scope_calls.catala_en @@ -29,7 +29,7 @@ scope S4: ```catala-test-inline $ catala typecheck [ERROR] Cyclic dependency detected between the following scopes: - S4 → S3 → S2 → S4 + S4 → S3 → S2 → S4 S4 is used here in the definition of S3: ┌─⯈ tests/test_scope/bad/cyclic_scope_calls.catala_en:21.24-21.36: diff --git a/tests/test_scope/bad/cyclic_scopes.catala_en b/tests/test_scope/bad/cyclic_scopes.catala_en index 32f258fa..e4eff437 100644 --- a/tests/test_scope/bad/cyclic_scopes.catala_en +++ b/tests/test_scope/bad/cyclic_scopes.catala_en @@ -18,7 +18,8 @@ scope B: ```catala-test-inline $ catala Interpret -s 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/test_scope/bad/cyclic_scopes.catala_en:5.3-5.4: diff --git a/tests/test_scope/good/scope_call3.catala_en b/tests/test_scope/good/scope_call3.catala_en index 36f86f8a..03e25a9e 100644 --- a/tests/test_scope/good/scope_call3.catala_en +++ b/tests/test_scope/good/scope_call3.catala_en @@ -20,47 +20,47 @@ scope RentComputation: $ catala Interpret -t -s HousingComputation [LOG] ≔ HousingComputation.f: [LOG] ☛ Definition applied: - ┌─⯈ tests/test_scope/good/scope_call3.catala_en:8.14-8.20: - └─┐ - 8 │ definition result equals f of 1 - │ ‾‾‾‾‾‾ - + ┌─⯈ tests/test_scope/good/scope_call3.catala_en:8.14-8.20: + └─┐ + 8 │ definition result equals f of 1 + │ ‾‾‾‾‾‾ + [LOG] → HousingComputation.f [LOG] ≔ HousingComputation.f.input0: 1 [LOG] ☛ Definition applied: - ┌─⯈ tests/test_scope/good/scope_call3.catala_en:7.14-7.15: - └─┐ - 7 │ definition f of x equals (output of RentComputation).f of x - │ ‾ - + ┌─⯈ tests/test_scope/good/scope_call3.catala_en:7.14-7.15: + └─┐ + 7 │ definition f of x equals (output of RentComputation).f of x + │ ‾ + [LOG] → RentComputation.direct [LOG] ≔ RentComputation.direct.input: {RentComputation_in} [LOG] ≔ RentComputation.g: [LOG] ≔ RentComputation.f: [LOG] ☛ Definition applied: - ┌─⯈ tests/test_scope/good/scope_call3.catala_en:7.29-7.54: - └─┐ - 7 │ definition f of x equals (output of RentComputation).f of x - │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ - + ┌─⯈ tests/test_scope/good/scope_call3.catala_en:7.29-7.54: + └─┐ + 7 │ definition f of x equals (output of RentComputation).f of x + │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + [LOG] ≔ RentComputation.direct.output: { RentComputation f = ; } [LOG] ← RentComputation.direct [LOG] → RentComputation.f [LOG] ≔ RentComputation.f.input0: 1 [LOG] ☛ Definition applied: - ┌─⯈ tests/test_scope/good/scope_call3.catala_en:16.14-16.15: - └──┐ - 16 │ definition f of x equals g of (x + 1) - │ ‾ - + ┌─⯈ tests/test_scope/good/scope_call3.catala_en:16.14-16.15: + └──┐ + 16 │ definition f of x equals g of (x + 1) + │ ‾ + [LOG] → RentComputation.g [LOG] ≔ RentComputation.g.input0: 2 [LOG] ☛ Definition applied: - ┌─⯈ tests/test_scope/good/scope_call3.catala_en:15.14-15.15: - └──┐ - 15 │ definition g of x equals x + 1 - │ ‾ - + ┌─⯈ tests/test_scope/good/scope_call3.catala_en:15.14-15.15: + └──┐ + 15 │ definition g of x equals x + 1 + │ ‾ + [LOG] ≔ RentComputation.g.output: 3 [LOG] ← RentComputation.g [LOG] ≔ RentComputation.f.output: 3 @@ -70,26 +70,28 @@ $ catala Interpret -t -s HousingComputation [LOG] ≔ HousingComputation.result: 3 [RESULT] Computation successful! Results: [RESULT] f = λ (x: integer) → - error_empty - ⟨true - ⊢ (let result : RentComputation = - (λ (RentComputation_in: RentComputation_in) → - let g : integer → integer = - λ (x1: integer) → - error_empty ⟨true ⊢ x1 + 1⟩ - in - let f : integer → integer = - λ (x1: integer) → - error_empty ⟨true ⊢ g (x1 + 1)⟩ - in - { RentComputation f = f; }) - {RentComputation_in} - in - let result1 : RentComputation = - { RentComputation f = λ (param0: integer) → result.f param0; } - in - if true then result1 else result1). - f - x⟩ + error_empty + ⟨true + ⊢ (let result : RentComputation = + (λ (RentComputation_in: RentComputation_in) → + let g : integer → integer = + λ (x1: integer) → + error_empty ⟨true ⊢ x1 + 1⟩ + in + let f : integer → integer = + λ (x1: integer) → + error_empty ⟨true ⊢ g (x1 + 1)⟩ + in + { RentComputation f = f; }) + {RentComputation_in} + in + let result1 : RentComputation = + { RentComputation + f = λ (param0: integer) → result.f param0; + } + in + if true then result1 else result1). + f + x⟩ [RESULT] result = 3 ``` diff --git a/tests/test_scope/good/scope_call4.catala_en b/tests/test_scope/good/scope_call4.catala_en index 695a8fe7..d9f97c02 100644 --- a/tests/test_scope/good/scope_call4.catala_en +++ b/tests/test_scope/good/scope_call4.catala_en @@ -26,36 +26,38 @@ scope RentComputation: $ catala Interpret -s RentComputation [RESULT] Computation successful! Results: [RESULT] f1 = λ (x: integer) → - error_empty ⟨true ⊢ let x1 : integer = x + 1 in - error_empty ⟨true ⊢ x1 + 1⟩⟩ + error_empty + ⟨true ⊢ let x1 : integer = x + 1 in + error_empty ⟨true ⊢ x1 + 1⟩⟩ [RESULT] f2 = λ (x: integer) → - error_empty ⟨true ⊢ let x1 : integer = x + 1 in - error_empty ⟨true ⊢ x1 + 1⟩⟩ + error_empty + ⟨true ⊢ let x1 : integer = x + 1 in + error_empty ⟨true ⊢ x1 + 1⟩⟩ ``` ```catala-test-inline $ catala Interpret_Lcalc -s RentComputation --avoid_exceptions --optimize [RESULT] Computation successful! Results: [RESULT] f1 = - ESome - (λ (x: integer) → - ESome - match - (match (ESome (λ (x1: integer) → ESome (x1 + 1))) with - | ENone _ → ENone _ - | ESome f1 → f1 (x + 1)) - with - | ENone f1 → raise NoValueProvided - | ESome x1 → x1) + ESome + (λ (x: integer) → + ESome + match + (match (ESome (λ (x1: integer) → ESome (x1 + 1))) with + | ENone _ → ENone _ + | ESome f1 → f1 (x + 1)) + with + | ENone f1 → raise NoValueProvided + | ESome x1 → x1) [RESULT] f2 = - ESome - (λ (x: integer) → - ESome - match - (match (ESome (λ (x1: integer) → ESome (x1 + 1))) with - | ENone _ → ENone _ - | ESome f2 → f2 (x + 1)) - with - | ENone f2 → raise NoValueProvided - | ESome x1 → x1) + ESome + (λ (x: integer) → + ESome + match + (match (ESome (λ (x1: integer) → ESome (x1 + 1))) with + | ENone _ → ENone _ + | ESome f2 → f2 (x + 1)) + with + | ENone f2 → raise NoValueProvided + | ESome x1 → x1) ``` diff --git a/tests/test_struct/good/nested3.catala_en b/tests/test_struct/good/nested3.catala_en index 13f4f7a8..fd87218f 100644 --- a/tests/test_struct/good/nested3.catala_en +++ b/tests/test_struct/good/nested3.catala_en @@ -50,20 +50,20 @@ $ catala Interpret -s B $ catala Interpret_Lcalc -s A --avoid_exceptions --optimize [RESULT] Computation successful! Results: [RESULT] t = - ESome - { T - a = ESome { S x = ESome 0; y = ESome false; }; - b = ESome { S x = ESome 1; y = ESome true; }; - } + ESome + { T + a = ESome { S x = ESome 0; y = ESome false; }; + b = ESome { S x = ESome 1; y = ESome true; }; + } ``` ```catala-test-inline $ catala Interpret_Lcalc -s B --avoid_exceptions --optimize [RESULT] Computation successful! Results: [RESULT] out = ESome 1 [RESULT] t = - ESome - { T - a = ESome { S x = ESome 0; y = ESome false; }; - b = ESome { S x = ESome 1; y = ESome true; }; - } + ESome + { T + a = ESome { S x = ESome 0; y = ESome false; }; + b = ESome { S x = ESome 1; y = ESome true; }; + } ``` diff --git a/tests/test_typing/bad/err1.catala_en b/tests/test_typing/bad/err1.catala_en index 231881d4..701b64d3 100644 --- a/tests/test_typing/bad/err1.catala_en +++ b/tests/test_typing/bad/err1.catala_en @@ -13,8 +13,8 @@ scope S: ```catala-test-inline $ catala Typecheck [ERROR] Error during typechecking, incompatible types: ---> decimal ---> integer + --> decimal + --> integer Error coming from typechecking the following expression: ┌─⯈ tests/test_typing/bad/err1.catala_en:7.23-7.26: diff --git a/tests/test_typing/bad/err2.catala_en b/tests/test_typing/bad/err2.catala_en index e1f4fa92..2a0a2e70 100644 --- a/tests/test_typing/bad/err2.catala_en +++ b/tests/test_typing/bad/err2.catala_en @@ -13,8 +13,8 @@ scope S: ```catala-test-inline $ catala Typecheck [ERROR] Error during typechecking, incompatible types: ---> decimal ---> collection + --> decimal + --> collection Error coming from typechecking the following expression: ┌─⯈ tests/test_typing/bad/err2.catala_en:10.39-10.42: diff --git a/tests/test_typing/bad/err3.catala_en b/tests/test_typing/bad/err3.catala_en index a93dcae7..faf420a2 100644 --- a/tests/test_typing/bad/err3.catala_en +++ b/tests/test_typing/bad/err3.catala_en @@ -20,8 +20,8 @@ $ catala Typecheck │ ‾‾‾ [ERROR] Error during typechecking, incompatible types: ---> integer ---> decimal + --> integer + --> decimal Error coming from typechecking the following expression: ┌─⯈ tests/test_typing/bad/err3.catala_en:10.42-10.43: @@ -58,8 +58,8 @@ $ catala ocaml │ ‾‾‾ [ERROR] Error during typechecking, incompatible types: ---> integer ---> decimal + --> integer + --> decimal Error coming from typechecking the following expression: ┌─⯈ tests/test_typing/bad/err3.catala_en:10.42-10.43: diff --git a/tests/test_typing/bad/err4.catala_en b/tests/test_typing/bad/err4.catala_en index 26d33243..935612c7 100644 --- a/tests/test_typing/bad/err4.catala_en +++ b/tests/test_typing/bad/err4.catala_en @@ -32,8 +32,8 @@ $ catala ocaml │ ‾‾‾ [ERROR] Error during typechecking, incompatible types: ---> Enum ---> Structure + --> Enum + --> Structure Error coming from typechecking the following expression: ┌─⯈ tests/test_typing/bad/err4.catala_en:5.25-5.38: diff --git a/tests/test_typing/bad/err5.catala_en b/tests/test_typing/bad/err5.catala_en index 5bbafb91..c7baf456 100644 --- a/tests/test_typing/bad/err5.catala_en +++ b/tests/test_typing/bad/err5.catala_en @@ -13,8 +13,8 @@ scope S: ```catala-test-inline $ catala Typecheck [ERROR] Error during typechecking, incompatible types: ---> integer ---> Structure + --> integer + --> Structure Error coming from typechecking the following expression: ┌─⯈ tests/test_typing/bad/err5.catala_en:8.5-8.9: diff --git a/tests/test_typing/bad/err6.catala_en b/tests/test_typing/bad/err6.catala_en index 69ea3669..f072d57d 100644 --- a/tests/test_typing/bad/err6.catala_en +++ b/tests/test_typing/bad/err6.catala_en @@ -29,8 +29,8 @@ Should be "catala Typecheck", see test err3 ```catala-test-inline $ catala ocaml [ERROR] Error during typechecking, incompatible types: ---> decimal ---> integer + --> decimal + --> integer Error coming from typechecking the following expression: ┌─⯈ tests/test_typing/bad/err6.catala_en:20.27-20.30: diff --git a/tests/test_variable_state/bad/state_cycle.catala_en b/tests/test_variable_state/bad/state_cycle.catala_en index bc399a49..9d491093 100644 --- a/tests/test_variable_state/bad/state_cycle.catala_en +++ b/tests/test_variable_state/bad/state_cycle.catala_en @@ -22,7 +22,7 @@ scope A: ```catala-test-inline $ catala Typecheck [ERROR] Cyclic dependency detected between the following variables of scope A: - foofoo@bar → foofoo@baz → foo@bar → foo@baz → foofoo@bar + foofoo@bar → foofoo@baz → foo@bar → foo@baz → foofoo@bar foofoo@bar is used here in the definition of foofoo@baz: ┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:19.38-19.44: