diff options
| author | tslil <tslil@posteo.de> | 2026-04-30 16:53:14 +0100 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-04-30 17:30:22 +0100 |
| commit | 0f7efe7518b925d9688dad4c6f6e87f84015e2c1 (patch) | |
| tree | f4cdfa08c7d3e7a69860570f3f7826119f3bcdef /src/ast.rs | |
| parent | d57f1d3c845220c741db73c1fada017a75b11992 (diff) | |
wip case for instances
Diffstat (limited to 'src/ast.rs')
| -rw-r--r-- | src/ast.rs | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -143,6 +143,14 @@ pub struct InstAssign { } #[derive(Clone, PartialEq, Display, Debug)] +#[display(".{tag} {bound} => {body}")] +pub struct InstCaseArm { + pub tag: String, + pub bound: String, + pub body: Instance, +} + +#[derive(Clone, PartialEq, Display, Debug)] pub enum Instance { #[display("({_0} :: Set)")] SetCoerce(Box<Set>), @@ -167,6 +175,12 @@ pub enum Instance { instance: Box<Instance>, field: String, }, + + #[display("case {} of {{ {} }}", scrutinee, arms.iter().map(|a| a.to_string()).collect::<Vec<_>>().join(" | "))] + Case { + scrutinee: Box<Element>, + arms: Vec<InstCaseArm>, + }, } // Declarations |
