Message formatting: final touches

This commit is contained in:
Louis Gesbert 2024-05-03 15:04:56 +02:00
parent da89411189
commit 56b456d137
92 changed files with 27 additions and 140 deletions

View File

@ -394,5 +394,6 @@ let make
let debug = make ~level:Debug ~cont:emit
let log = make ~level:Log ~cont:emit
let result = make ~level:Result ~cont:emit
let results r = emit (List.flatten (List.map of_result r)) Result
let warning = make ~level:Warning ~cont:emit
let error = make ~level:Error ~cont:(fun m _ -> raise (CompilerError m))

View File

@ -99,3 +99,4 @@ val debug : ('a, unit) emitter
val result : ('a, unit) emitter
val warning : ('a, unit) emitter
val error : ('a, 'b) emitter
val results : Content.message list -> unit

View File

@ -129,7 +129,7 @@ let format_loc_text_parts (pos : t) =
None )
else
let pr_head ppf =
Format.fprintf ppf "@{<blue>─➤ %s:@}@," (to_string_short pos)
Format.fprintf ppf "@{<blue>─➤ @{<bold>%s:@}@}@," (to_string_short pos)
in
let pr_context, pr_legal =
try

View File

@ -92,7 +92,7 @@ let print_exceptions_graph
Ast.ScopeDef.format var ScopeName.format scope;
Dependency.ExceptionsDependencies.iter_vertex
(fun ex ->
Message.result "@[<v>Definitions with label \"%a\":@]" LabelName.format
Message.result "Definitions with label@ \"%a\":" LabelName.format
ex.Dependency.ExceptionVertex.label
~extra_pos:
(List.map

View File

@ -691,9 +691,9 @@ module Commands = struct
let language =
Cli.file_lang (Global.input_src_file options.Global.input_src)
in
Message.result "Computation successful!%s"
(if List.length results > 0 then " Results:" else "")
~outcome:
if results = [] then Message.result "Computation successful!"
else
Message.results
(List.map
(fun ((var, _), result) ppf ->
Format.fprintf ppf "@[<hov 2>%s@ =@ %a@]" var

View File

@ -27,7 +27,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│w = 0
│x = 4
│y = 4

View File

@ -47,7 +47,6 @@ scope A:
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│o = false
└─
```

View File

@ -21,7 +21,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│w = 6
└─
```

View File

@ -38,7 +38,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = [$0.00; $9.00; $5.20]
└─
```
@ -46,7 +45,6 @@ $ catala test-scope A
```catala-test-inline
$ catala test-scope B
┌─[RESULT]─
│Computation successful! Results:
│max = $18.00
│min = $5.00
│y = $17.20

View File

@ -44,7 +44,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x =
│ [
│ S { -- id: 0 -- income: $0.00 }; S { -- id: 1 -- income: $9.00 };
@ -56,7 +55,6 @@ $ catala test-scope A
```catala-test-inline
$ catala test-scope B
┌─[RESULT]─
│Computation successful! Results:
│argmax = S { -- id: 1 -- income: $9.00 }
│argmin = S { -- id: 0 -- income: $0.00 }
└─

View File

@ -95,7 +95,6 @@ let scope S (x: integer|internal|output) =
```catala-test-inline
$ catala test-scope S
┌─[RESULT]─
│Computation successful! Results:
│x = 0
└─
```

View File

@ -25,7 +25,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = [0; 1; 2; 3; 4; 5; 6]
│y = [0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10]
└─

View File

@ -31,7 +31,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = [$0.00; $9.00; $5.20]
└─
```
@ -39,7 +38,6 @@ $ catala test-scope A
```catala-test-inline
$ catala test-scope B
┌─[RESULT]─
│Computation successful! Results:
│y = [$9.00; $5.20]
└─
```

View File

@ -32,7 +32,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = [$0.00; $9.00; $5.20]
└─
```
@ -40,7 +39,6 @@ $ catala test-scope A
```catala-test-inline
$ catala test-scope B
┌─[RESULT]─
│Computation successful! Results:
│y = [$9.00; $5.20]
│z = [false; true; true]
└─

View File

@ -44,7 +44,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x =
│ [
│ S { -- id: 0 -- income: $0.00 }; S { -- id: 1 -- income: $9.00 };
@ -56,7 +55,6 @@ $ catala test-scope A
```catala-test-inline
$ catala test-scope B
┌─[RESULT]─
│Computation successful! Results:
│argmax = S { -- id: 1 -- income: $9.00 }
│argmin = S { -- id: 0 -- income: $0.00 }
└─

View File

@ -25,7 +25,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope B
┌─[RESULT]─
│Computation successful! Results:
│x = [$4.00; $8.00]
│z = [false; true]
└─

View File

@ -36,7 +36,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = [0; 9; 64]
└─
```
@ -44,7 +43,6 @@ $ catala test-scope A
```catala-test-inline
$ catala test-scope B
┌─[RESULT]─
│Computation successful! Results:
│v = 3
│w = true
│y = true

View File

@ -25,7 +25,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│w = false
│x = [0; 9; 64]
└─

View File

@ -23,7 +23,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = [0; 4; 8]
└─
```

View File

@ -48,7 +48,6 @@ TestBool
```catala-test-inline
$ catala test-scope TestBool
┌─[RESULT]─
│Computation successful! Results:
│bar = 1
│foo = true
└─

View File

@ -23,7 +23,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope TestBool
┌─[RESULT]─
│Computation successful! Results:
│foo = true
└─
```

View File

@ -29,7 +29,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope TestXor
┌─[RESULT]─
│Computation successful! Results:
│f_xor_f = false
│f_xor_t = true
│t_xor_f = true

View File

@ -38,7 +38,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│m = [11874 days]
│m2 = [6 months]
│x = 2019-01-01

View File

@ -37,7 +37,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope Test
┌─[RESULT]─
│Computation successful! Results:
│r = true
└─
```

View File

@ -37,7 +37,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope Test
┌─[RESULT]─
│Computation successful! Results:
│r = vrai
└─
```

View File

@ -27,7 +27,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = 2019-01-01
│y = 2002-09-30
│z = [5937 days]

View File

@ -29,7 +29,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│a =
│ -0.000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,078,695,580,959,228,473,468…
│x = 84.648,665,652,656,896,23

View File

@ -29,7 +29,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = 84.648,665
│x1 = 85.0
│y = 4.368,297

View File

@ -29,7 +29,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│k = 0.333,333,333,333,333,333,33…
│x = 84.648,665
│y = 4.368,297

View File

@ -26,7 +26,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = 4.0
│y = 1.04
└─

View File

@ -54,7 +54,6 @@ $ catala test-scope A
│ │ ‾‾‾‾‾‾‾‾‾‾‾‾
└─
┌─[RESULT]─
│Computation successful! Results:
│w = 3
└─
```

View File

@ -30,7 +30,6 @@ $ catala test-scope A
│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Useless wildcard
┌─[RESULT]─
│Computation successful! Results:
│x = Case1 ()
│y = 42
└─

View File

@ -36,7 +36,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│e = Case1 ()
│f = Case1 2
│x = 2

View File

@ -31,7 +31,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = Case1 2
│y = true
│z = false

View File

@ -31,7 +31,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = Case1 2
│y = 42
└─

View File

@ -51,7 +51,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope Simple_case_2
┌─[RESULT]─
│Computation successful! Results:
│x = Case3 ()
│y = 31
└─
@ -60,7 +59,6 @@ $ catala test-scope Simple_case_2
```catala-test-inline
$ catala test-scope Simple_case
┌─[RESULT]─
│Computation successful! Results:
│x = Case1 2
│y = 31
└─

View File

@ -33,7 +33,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = 0
│y = 0
└─

View File

@ -27,7 +27,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = 1
└─
```

View File

@ -31,7 +31,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = 2
└─
```

View File

@ -61,7 +61,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope Benefit
┌─[RESULT]─
│Computation successful! Results:
│benefit = $2,000.00
│person = Person { -- age: 26 -- disabled: true }
└─

View File

@ -55,7 +55,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope Test
┌─[RESULT]─
│Computation successful! Results:
│x = 2
└─
```

View File

@ -34,7 +34,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = 0
│y = 1
│z = 0

View File

@ -29,7 +29,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = 1
└─
```

View File

@ -35,7 +35,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = 0
└─
```

View File

@ -32,7 +32,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = 1
│y = 3
└─

View File

@ -26,7 +26,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = 1
└─
```

View File

@ -32,7 +32,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = 1
│y = 2
└─

View File

@ -24,7 +24,6 @@ scope R:
```catala-test-inline
$ catala test-scope R
┌─[RESULT]─
│Computation successful! Results:
│r = 30
└─
```

View File

@ -47,7 +47,6 @@ let scope T (T_in: T_in): T {y: integer} =
```catala-test-inline
$ catala Interpret --lcalc -s T --avoid-exceptions -O --closure-conversion
┌─[RESULT]─
│Computation successful! Results:
│y = -2
└─
```

View File

@ -36,7 +36,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope R
┌─[RESULT]─
│Computation successful! Results:
│r = 30
└─
```

View File

@ -48,7 +48,6 @@ scope T1:
```catala-test-inline
$ catala test-scope T1
┌─[RESULT]─
│Computation successful! Results:
│o1 = 20.0
│o2 = 5.0
└─
@ -76,7 +75,6 @@ scope T2:
```catala-test-inline
$ catala test-scope T2
┌─[RESULT]─
│Computation successful! Results:
│o = 40.0
└─
```

View File

@ -164,7 +164,6 @@ let scope Foo
```catala-test-inline
$ catala Interpret --lcalc -s Foo --avoid-exceptions -O --closure-conversion
┌─[RESULT]─
│Computation successful! Results:
│z = 11
└─
```

View File

@ -44,7 +44,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│literate_parsing_is_ok = true
└─
```
@ -52,7 +51,6 @@ $ catala test-scope A
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│literate_parsing_is_ok = true
└─
```
@ -110,7 +108,6 @@ $ catala Typecheck --check-invariants
\begin{verbatim}
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│literate_parsing_is_ok = true
└─
\end{verbatim}
@ -118,7 +115,6 @@ $ catala test-scope A
\begin{verbatim}
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│literate_parsing_is_ok = true
└─
\end{verbatim}

View File

@ -42,7 +42,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│literate_parsing_is_ok = vrai
└─
```

View File

@ -30,7 +30,6 @@ int main(void) { return 0; }
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│literate_parsing_is_ok = prawda
└─
```

View File

@ -43,7 +43,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope S2
┌─[RESULT]─
│Computation successful! Results:
│b = B ()
└─
```
@ -51,7 +50,6 @@ $ catala test-scope S2
```catala-test-inline
$ catala test-scope S
┌─[RESULT]─
│Computation successful! Results:
│a = A ()
└─
```

View File

@ -19,7 +19,6 @@ scope S:
```catala-test-inline
$ catala test-scope S
┌─[RESULT]─
│Computation successful! Results:
│result1 = [$3.33; $0.83; $0.83; $3.33; $0.83; $0.85]
│result2 = [$3.33; $0.83; $0.83; $3.34; $0.84; $0.83]
└─

View File

@ -71,7 +71,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope Stest
┌─[RESULT]─
│Computation successful! Results:
│o1 = S { -- ci: 0 -- cm: $0.00 -- cfun1: <function> -- cfun2: <function> }
│o2 = S { -- ci: 1 -- cm: $1.00 -- cfun1: <function> -- cfun2: <function> }
│x11 = 12.0
@ -102,7 +101,6 @@ scope TestSubDefault:
```catala-test-inline
$ catala test-scope TestSubDefault
┌─[RESULT]─
│Computation successful! Results:
│ci = 0
│cm = $0.00
│x11 = 12.0
@ -132,7 +130,6 @@ scope TestSubOverride:
```catala-test-inline
$ catala test-scope TestSubOverride
┌─[RESULT]─
│Computation successful! Results:
│ci = 1
│cm = $1.00
│x21 = 8.0

View File

@ -38,7 +38,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope T2
┌─[RESULT]─
│Computation successful! Results:
│o1 = No ()
│o2 = Maybe ()
│o3 = $1,000.00

View File

@ -30,7 +30,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope T
┌─[RESULT]─
│Computation successful! Results:
│o1 = Mod_def.S { -- sr: $1,000.00 -- e1: Maybe () }
│o2 = $2,500.00
│o3 = $132.00
@ -44,7 +43,6 @@ The following tests multiple inclusion of the same module (Mod_def is used throu
```catala-test-inline
$ catala test-scope T2
┌─[RESULT]─
│Computation successful! Results:
│o1 = No ()
│o2 = Maybe ()
│o3 = $1,000.00

View File

@ -34,7 +34,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope T
┌─[RESULT]─
│Computation successful! Results:
│o1 = Mod_def.S { -- sr: $1,000.00 -- e1: Maybe () }
│o2 = $2,500.00
│o3 = $132.00

View File

@ -55,7 +55,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope TestCall
┌─[RESULT]─
│Computation successful! Results:
│o_default =
│ Mod_def_context.S {
│ -- ci: 0
@ -99,7 +98,6 @@ scope TestSubDefault:
```catala-test-inline
$ catala test-scope TestSubDefault
┌─[RESULT]─
│Computation successful! Results:
│ci = 0
│cm = $0.00
│x11 = 12.0
@ -129,7 +127,6 @@ scope TestSubOverride:
```catala-test-inline
$ catala test-scope TestSubOverride
┌─[RESULT]─
│Computation successful! Results:
│ci = 1
│cm = $1.00
│x21 = 8.0

View File

@ -47,7 +47,6 @@ $ catala typecheck --check-invariants
```catala-test-inline
$ catala test-scope S
┌─[RESULT]─
│Computation successful! Results:
│result =
│ [
│ HouseholdMemberTaxed {

View File

@ -26,7 +26,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = $0.30
│y = -$0.30
└─

View File

@ -27,7 +27,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = $123.54
│y = $8,548,650.96
│z = $7.23

View File

@ -40,7 +40,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope S
┌─[RESULT]─
│Computation successful! Results:
│a = A { -- x: -2.0 -- y: B { -- y: false -- z: -1.0 } }
│b = B { -- y: true -- z: 42.0 }
└─
@ -66,13 +65,12 @@ $ catala test-scope S2
│ 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:53.4-53.5:
├─➤ tests/name_resolution/good/let_in.catala_en:52.4-52.5:
│ │
│ 53 │ x scope S
│ 52 │ x scope S
│ │ ‾
└─ Check scope of let-in vs scope variable
┌─[RESULT]─
│Computation successful! Results:
│y = 1
└─
```

View File

@ -28,7 +28,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope S
┌─[RESULT]─
│Computation successful! Results:
│a = true
└─
```

View File

@ -33,7 +33,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope S
┌─[RESULT]─
│Computation successful! Results:
│a = A { -- x: 0 -- y: B { -- y: true -- z: 0.0 } }
│b = B { -- y: true -- z: 0.0 }
└─

View File

@ -34,7 +34,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope S
┌─[RESULT]─
│Computation successful! Results:
│a = 1,946.574,4
│b = A { -- y: true -- z: 2,091.0 }
└─
@ -57,7 +56,6 @@ scope S2:
```catala-test-inline
$ catala test-scope S2
┌─[RESULT]─
│Computation successful! Results:
│a = 154.0
└─
```
@ -79,7 +77,6 @@ scope S3:
```catala-test-inline
$ catala test-scope S3
┌─[RESULT]─
│Computation successful! Results:
│a = 2,480.0
└─
```
@ -104,7 +101,6 @@ scope S4:
```catala-test-inline
$ catala test-scope S4
┌─[RESULT]─
│Computation successful! Results:
│a = 6,001.0
└─
```
@ -438,8 +434,8 @@ def s2(s2_in:S2In):
return (glob3(money_of_cents_string("4400")) +
decimal_of_string("100."))
return handle_default(SourcePosition(filename="tests/name_resolution/good/toplevel_defs.catala_en",
start_line=54, start_column=24,
end_line=54, end_column=43,
start_line=53, start_column=24,
end_line=53, end_column=43,
law_headings=["Test toplevel function defs"]), [],
temp_a_1, temp_a_2)
def temp_a_3(_:Unit):
@ -447,15 +443,15 @@ def s2(s2_in:S2In):
def temp_a_4(_:Unit):
raise Empty
temp_a_5 = handle_default(SourcePosition(filename="tests/name_resolution/good/toplevel_defs.catala_en",
start_line=51, start_column=10,
end_line=51, end_column=11,
start_line=50, start_column=10,
end_line=50, end_column=11,
law_headings=["Test toplevel function defs"]), [temp_a],
temp_a_3, temp_a_4)
except Empty:
raise NoValue(SourcePosition(
filename="tests/name_resolution/good/toplevel_defs.catala_en",
start_line=51, start_column=10,
end_line=51, end_column=11,
start_line=50, start_column=10,
end_line=50, end_column=11,
law_headings=["Test toplevel function defs"]))
a = temp_a_5
return S2(a = a)
@ -470,8 +466,8 @@ def s3(s3_in:S3In):
glob4(money_of_cents_string("4400"),
decimal_of_string("55.")))
return handle_default(SourcePosition(filename="tests/name_resolution/good/toplevel_defs.catala_en",
start_line=76, start_column=24,
end_line=76, end_column=47,
start_line=74, start_column=24,
end_line=74, end_column=47,
law_headings=["Test function def with two args"]), [],
temp_a_7, temp_a_8)
def temp_a_9(_:Unit):
@ -479,15 +475,15 @@ def s3(s3_in:S3In):
def temp_a_10(_:Unit):
raise Empty
temp_a_11 = handle_default(SourcePosition(filename="tests/name_resolution/good/toplevel_defs.catala_en",
start_line=73, start_column=10,
end_line=73, end_column=11,
start_line=71, start_column=10,
end_line=71, end_column=11,
law_headings=["Test function def with two args"]), [temp_a_6],
temp_a_9, temp_a_10)
except Empty:
raise NoValue(SourcePosition(
filename="tests/name_resolution/good/toplevel_defs.catala_en",
start_line=73, start_column=10,
end_line=73, end_column=11,
start_line=71, start_column=10,
end_line=71, end_column=11,
law_headings=["Test function def with two args"]))
a_1 = temp_a_11
return S3(a = a_1)
@ -500,8 +496,8 @@ def s4(s4_in:S4In):
def temp_a_14(_:Unit):
return (glob5 + decimal_of_string("1."))
return handle_default(SourcePosition(filename="tests/name_resolution/good/toplevel_defs.catala_en",
start_line=101, start_column=24,
end_line=101, end_column=34,
start_line=98, start_column=24,
end_line=98, end_column=34,
law_headings=["Test inline defs in toplevel defs"]), [],
temp_a_13, temp_a_14)
def temp_a_15(_:Unit):
@ -509,15 +505,15 @@ def s4(s4_in:S4In):
def temp_a_16(_:Unit):
raise Empty
temp_a_17 = handle_default(SourcePosition(filename="tests/name_resolution/good/toplevel_defs.catala_en",
start_line=98, start_column=10,
end_line=98, end_column=11,
start_line=95, start_column=10,
end_line=95, end_column=11,
law_headings=["Test inline defs in toplevel defs"]), [temp_a_12],
temp_a_15, temp_a_16)
except Empty:
raise NoValue(SourcePosition(
filename="tests/name_resolution/good/toplevel_defs.catala_en",
start_line=98, start_column=10,
end_line=98, end_column=11,
start_line=95, start_column=10,
end_line=95, end_column=11,
law_headings=["Test inline defs in toplevel defs"]))
a_2 = temp_a_17
return S4(a = a_2)

View File

@ -25,7 +25,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope S
┌─[RESULT]─
│Computation successful! Results:
│a = true
└─
```

View File

@ -44,7 +44,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│x = 0
└─
```
@ -52,7 +51,6 @@ $ catala test-scope A
```catala-test-inline
$ catala test-scope B
┌─[RESULT]─
│Computation successful! Results:
│y1 = 1
│y2 = 1
└─
@ -61,7 +59,6 @@ $ catala test-scope B
```catala-test-inline
$ catala test-scope C
┌─[RESULT]─
│Computation successful! Results:
│z1 = 2
│z2 = 2
└─

View File

@ -31,7 +31,6 @@ $ catala test-scope S
│ │ ‾
└─
┌─[RESULT]─
│Computation successful! Results:
│so = 42
└─
```

View File

@ -22,7 +22,6 @@ scope B:
```catala-test-inline
$ catala test-scope B
┌─[RESULT]─
│Computation successful! Results:
│a = A { -- o: 99 -- io: 100 }
│b = 99
└─

View File

@ -35,7 +35,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope Foo
┌─[RESULT]─
│Computation successful! Results:
│example = -7
└─
```

View File

@ -53,7 +53,6 @@ $ catala test-scope Titi
│ │ ‾‾‾‾
└─
┌─[RESULT]─
│Computation successful! Results:
│fizz = Toto { -- foo: 1,213 }
│fuzz = Toto { -- foo: 1,323 }
└─

View File

@ -91,7 +91,6 @@ $ catala Interpret -t -s HousingComputation --debug
[LOG] ≔ HousingComputation.result: 3
[DEBUG] End of interpretation
┌─[RESULT]─
│Computation successful! Results:
│f = λ (x: integer) →
│ error_empty
│ ⟨ ⟨true

View File

@ -52,7 +52,6 @@ $ catala interpret -s RentComputation --debug
[DEBUG] Starting interpretation...
[DEBUG] End of interpretation
┌─[RESULT]─
│Computation successful! Results:
│f1 = λ (x: integer) →
│ error_empty
│ ⟨ ⟨true
@ -90,7 +89,6 @@ $ catala Interpret --lcalc -s RentComputation --avoid-exceptions --optimize --de
[DEBUG] Starting interpretation...
[DEBUG] End of interpretation
┌─[RESULT]─
│Computation successful! Results:
│f1 = λ (x: integer) → let x1 : integer = x + 1 in
│ ((x1 + 1))
│f2 = λ (x: integer) → let x1 : integer = x + 1 in

View File

@ -36,7 +36,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope Foo
┌─[RESULT]─
│Computation successful! Results:
│example = SubFoo { -- z1: 4 -- z2: 0 }
└─
```

View File

@ -38,7 +38,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│a = -1
│a_base = 1
│b = false
@ -48,7 +47,6 @@ $ catala test-scope A
```catala-test-inline
$ catala test-scope B
┌─[RESULT]─
│Computation successful! Results:
│a = 42
│b = true
└─

View File

@ -85,7 +85,6 @@ $ catala test-scope A
│ │ ‾
└─ Article
┌─[RESULT]─
│Computation successful! Results:
│u = true
│x = 0
└─
@ -114,7 +113,6 @@ $ catala test-scope B
│ │ ‾
└─ Article
┌─[RESULT]─
│Computation successful! Results:
│y = 1
└─
```
@ -142,7 +140,6 @@ $ catala test-scope C
│ │ ‾
└─ Article
┌─[RESULT]─
│Computation successful! Results:
│z = 2
└─
```

View File

@ -32,7 +32,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope Caller
┌─[RESULT]─
│Computation successful! Results:
│y = 1
└─
```

View File

@ -49,7 +49,6 @@ $ catala test-scope A
│ │ ‾‾‾
└─ Article
┌─[RESULT]─
│Computation successful! Results:
│y = 1
└─
```

View File

@ -49,7 +49,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│t = T { -- a: S { -- x: 0 -- y: false } -- b: S { -- x: 1 -- y: true } }
└─
```
@ -57,7 +56,6 @@ $ catala test-scope A
```catala-test-inline
$ catala test-scope B
┌─[RESULT]─
│Computation successful! Results:
│out = 1
│t = T { -- a: S { -- x: 0 -- y: false } -- b: S { -- x: 1 -- y: true } }
└─

View File

@ -49,7 +49,6 @@ $ catala test-scope A
│ │ ‾‾‾
└─ Article
┌─[RESULT]─
│Computation successful! Results:
│x = Foo { -- f: 1 }
│y = 1
└─

View File

@ -32,7 +32,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│s = S { -- x: 1 -- y: 2 }
│z = 3
└─

View File

@ -42,7 +42,6 @@ $ catala test-scope S
│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─
┌─[RESULT]─
│Computation successful! Results:
│s1 = Str { -- fld1: 99 -- fld2: $1.00 -- fld3: 2003-01-01 }
│s2 = Str { -- fld1: 0 -- fld2: $99.00 -- fld3: 2003-01-01 }
│s3 = Str { -- fld1: 99 -- fld2: $99.00 -- fld3: 2099-01-01 }

View File

@ -44,7 +44,6 @@ $ catala typecheck --check-invariants
```catala-test-inline
$ catala test-scope Test
┌─[RESULT]─
│Computation successful! Results:
│o = (2001-01-03, 6.0)
└─
```

View File

@ -51,7 +51,6 @@ $ catala typecheck
```catala-test-inline
$ catala test-scope S
┌─[RESULT]─
│Computation successful! Results:
│r1 =
│ [
│ ($120.00, 0.5); ($13.00, 0.005); ($1,400.00, 10.0);

View File

@ -72,7 +72,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope S
┌─[RESULT]─
│Computation successful! Results:
│o_b = true
│o_d = [-13 days]
│o_i = -5

View File

@ -30,7 +30,6 @@ $ catala Typecheck --check-invariants
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│foo = 3
└─
```

View File

@ -26,7 +26,6 @@ scope A:
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│Computation successful! Results:
│bar = 5
│foo = 6
└─

View File

@ -57,7 +57,6 @@ let scope A (foo_bar: ⟨integer⟩|context) (foo_baz: integer|internal)
```catala-test-inline
$ catala test-scope B
┌─[RESULT]─
│Computation successful! Results:
│foofoo = 4
│foofoofoo = 6
└─