1
1
mirror of https://github.com/anoma/juvix.git synced 2024-07-07 04:36:19 +03:00
juvix/tests
Jan Mas Rovira d08bf942b6
Add front-end support for case expressions boolean side conditions (#2852)
- 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.
2024-07-04 01:16:30 +02:00
..
Anoma/Compilation Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
Asm Remove copy propagation from the native/WASM and Rust pipelines (#2846) 2024-06-20 12:44:15 +02:00
benchmark Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
Casm Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
Compilation Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
Core Adapt Anoma builtins to new Anoma Node API (#2861) 2024-07-01 18:44:02 +01:00
examplesExpected Add a test suite for milestone examples (#1920) 2023-03-24 13:16:26 +00:00
Geb/positive Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
Internal Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
negative Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
nockma/positive Fix bugs in the Nockma prettyprinter and parser (#2632) 2024-02-09 14:59:42 +01:00
positive Add front-end support for case expressions boolean side conditions (#2852) 2024-07-04 01:16:30 +02:00
Reg/positive Copy propagation in JuvixReg (#2828) 2024-06-18 21:38:02 +02:00
runtime/positive Add an if instruction to JuvixReg (#2855) 2024-06-26 19:08:33 +02:00
Rust/Compilation/positive Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
smoke/Commands Release 0.6.3 (#2870) 2024-07-02 12:37:45 +01:00
Tree Adapt Anoma builtins to new Anoma Node API (#2861) 2024-07-01 18:44:02 +01:00
VampIR Merge if -> ite renaming from stdlib (#2869) 2024-07-02 10:03:06 +02:00
WithoutPackageFile Fix #2510 (#2512) 2023-11-17 16:10:38 +01:00
.gitattributes Juvix C runtime (#1580) 2022-11-03 09:38:09 +01:00