mirror of
https://github.com/anoma/juvix.git
synced 2025-01-07 08:08:44 +03:00
d08bf942b6
- Syntax for #2804. - ⚠️ Depends on #2869. This pr introduces: 1. front-end support (parsing, printing, typechecking) for boolean side conditions for branches of case expressions. 2. Now `if` is a reserved keyword. 3. Multiway `if` is allowed to have only the `else` branch. I've also refactored the parser to be simpler. Example: ``` multiCaseBr : Nat := case 1 of | zero | if 0 < 0 := 3 | else := 4 | suc (suc n) | if 0 < 0 := 3 | else := n | suc n if 0 < 0 := 3; ``` The side if branches must satisfy the following. 1. There must be at least one `if` branch. 4. The `else` branch is optional. If present, it must be the last. Future work: 1. Translate side if conditions to Core and extend the exhaustiveness algorithm. 5. Add side if conditions to function clauses. |
||
---|---|---|
.. | ||
Anoma/Compilation | ||
Asm | ||
benchmark | ||
Casm | ||
Compilation | ||
Core | ||
examplesExpected | ||
Geb/positive | ||
Internal | ||
negative | ||
nockma/positive | ||
positive | ||
Reg/positive | ||
runtime/positive | ||
Rust/Compilation/positive | ||
smoke/Commands | ||
Tree | ||
VampIR | ||
WithoutPackageFile | ||
.gitattributes |