mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-20 00:41:05 +03:00
39 lines
641 B
Plaintext
39 lines
641 B
Plaintext
## Article
|
|
|
|
```catala
|
|
declaration enumeration E:
|
|
-- Case1 content integer
|
|
-- Case2
|
|
|
|
declaration scope A:
|
|
context output x content E
|
|
context output y content boolean
|
|
context output z content boolean
|
|
|
|
scope A:
|
|
definition x equals Case1 content 2
|
|
definition y equals x with pattern Case1
|
|
definition z equals x with pattern Case2
|
|
```
|
|
|
|
|
|
|
|
```catala-test-inline
|
|
$ catala Typecheck --check-invariants
|
|
┌─[RESULT]─
|
|
│ All invariant checks passed
|
|
└─
|
|
┌─[RESULT]─
|
|
│ Typechecking successful!
|
|
└─
|
|
```
|
|
|
|
```catala-test-inline
|
|
$ catala test-scope A
|
|
┌─[RESULT]─
|
|
│ x = Case1 2
|
|
│ y = true
|
|
│ z = false
|
|
└─
|
|
```
|