mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-19 16:28:12 +03:00
Last changes
This commit is contained in:
parent
6479c3c10b
commit
ecccb5fb91
@ -23,7 +23,7 @@ type exception_tree =
|
||||
|
||||
open Format
|
||||
|
||||
(* Credits for this printing code: Jean-Christophe Filiâtre, *)
|
||||
(* Original credits for this printing code: Jean-Christophe Filiâtre *)
|
||||
let format_exception_tree (fmt : Format.formatter) (t : exception_tree) =
|
||||
let blue s =
|
||||
Format.asprintf "%a" (Cli.format_with_style [ANSITerminal.blue]) s
|
||||
@ -60,6 +60,8 @@ let format_exception_tree (fmt : Format.formatter) (t : exception_tree) =
|
||||
pp_print_string fmt (blue start);
|
||||
print_node (pref ^ "| ") s;
|
||||
pp_force_newline fmt ();
|
||||
pp_print_string fmt (blue (pref ^ " │"));
|
||||
pp_force_newline fmt ();
|
||||
pp_print_string fmt (blue pref);
|
||||
print_sons pref "├──" sons
|
||||
in
|
||||
|
@ -44,3 +44,44 @@ let scope Foo (y: integer|input) (x: integer|internal|output) =
|
||||
⊢ ⟨ ⟨y = 2 ⊢ 2⟩, ⟨y = 3 ⊢ 3⟩ | false ⊢ ∅ ⟩ ⟩
|
||||
| true ⊢ ⟨ ⟨y = 0 ⊢ 0⟩, ⟨y = 1 ⊢ 1⟩ | false ⊢ ∅ ⟩ ⟩
|
||||
```
|
||||
|
||||
```catala-test-inline
|
||||
$ catala Exceptions -s Foo -v x
|
||||
[RESULT] Printing the tree of exceptions for the definitions of variable "x" of scope "Foo".
|
||||
[RESULT] Group of definitions with label "base":
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:9.2-25:
|
||||
└─┐
|
||||
9 │ label base definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:13.2-25:
|
||||
└──┐
|
||||
13 │ label base definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
[RESULT] Group of definitions with label "intermediate":
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:17.2-48:
|
||||
└──┐
|
||||
17 │ label intermediate exception base definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:21.2-48:
|
||||
└──┐
|
||||
21 │ label intermediate exception base definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
[RESULT] Group of definitions with label "exception_to_intermediate":
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:25.2-37:
|
||||
└──┐
|
||||
25 │ exception intermediate definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
┌─⯈ tests/test_exception/good/groups_of_exceptions.catala_en:29.2-37:
|
||||
└──┐
|
||||
29 │ exception intermediate definition x under condition
|
||||
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
└─ Test
|
||||
[RESULT] The exception tree structure is as follows:
|
||||
|
||||
"base"───"intermediate"───"exception_to_intermediate"
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user