mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-20 08:47:14 +03:00
4d4dac6727
Normally I would make sure this is not by default, or at leat disableable; but here the code we print may contain utf8 anyway, so the terminal really needs to support it. Anyway, it's just a little fancier, doesn't add much.
70 lines
1.8 KiB
Plaintext
70 lines
1.8 KiB
Plaintext
## Article
|
|
|
|
```catala
|
|
declaration scope A:
|
|
context x content integer
|
|
context y content integer
|
|
context z content integer
|
|
|
|
scope A:
|
|
definition y under condition x < 0 consequence equals - x
|
|
definition y under condition x >= 0 consequence equals x
|
|
definition z under condition y >= 1 consequence equals 10 / y
|
|
definition z under condition y < 1 consequence equals y
|
|
definition x equals z
|
|
```
|
|
|
|
```catala-test-inline
|
|
$ catala Interpret -s A
|
|
[ERROR] Cyclic dependency detected between variables of scope A!
|
|
|
|
Cycle variable z, declared:
|
|
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:7.10-11
|
|
└─┐
|
|
│
|
|
7 │ context z content integer
|
|
│ ‾
|
|
└─ Article
|
|
|
|
Used here in the definition of another cycle variable x:
|
|
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:14.22-23
|
|
└──┐
|
|
│
|
|
14 │ definition x equals z
|
|
│ ‾
|
|
└─ Article
|
|
|
|
Cycle variable y, declared:
|
|
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:6.10-11
|
|
└─┐
|
|
│
|
|
6 │ context y content integer
|
|
│ ‾
|
|
└─ Article
|
|
|
|
Used here in the definition of another cycle variable z:
|
|
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:13.31-32
|
|
└──┐
|
|
│
|
|
13 │ definition z under condition y < 1 consequence equals y
|
|
│ ‾
|
|
└─ Article
|
|
|
|
Cycle variable x, declared:
|
|
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:5.10-11
|
|
└─┐
|
|
│
|
|
5 │ context x content integer
|
|
│ ‾
|
|
└─ Article
|
|
|
|
Used here in the definition of another cycle variable y:
|
|
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:11.31-32
|
|
└──┐
|
|
│
|
|
11 │ definition y under condition x >= 0 consequence equals x
|
|
│ ‾
|
|
└─ Article
|
|
#return code 255#
|
|
```
|