diff options
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 |
