mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-14 13:58:40 +03:00
0ab7a0f9ce
Done using ```bash process() { FILE=$1; awk 'match($0, /^```catala-test *{ *id *= *"(.*)" *}/, a) {print "```catala-test-inline"; f="'"$(dirname $FILE)/output/$(basename $FILE)"'." a[1]; getline; print "$ " $0; while ((getline<f) > 0) print; next} {print}' $FILE >$FILE.new; mv $FILE.new $FILE; } for f in tests/test_*/*/*.catala_* examples/**/*.catala_*; do process $f; git add $f; done for d in $(find -name output -type d); do git rm -r $d; done ```
21 lines
462 B
Plaintext
21 lines
462 B
Plaintext
## Article
|
|
|
|
```catala
|
|
declaration scope RecursiveFunc:
|
|
context f content integer depends on integer
|
|
|
|
scope RecursiveFunc:
|
|
definition f of x equals f of x + 1
|
|
```
|
|
|
|
```catala-test-inline
|
|
$ catala Interpret -s RecursiveFunc
|
|
[ERROR] The variable f is used in one of its definitions, but recursion is forbidden in Catala
|
|
|
|
--> tests/test_func/bad/recursive.catala_en
|
|
|
|
|
8 | definition f of x equals f of x + 1
|
|
| ^
|
|
+ Article
|
|
```
|