aboutsummaryrefslogtreecommitdiff
path: root/src/ast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast.rs')
-rw-r--r--src/ast.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ast.rs b/src/ast.rs
index d13b2a8..24d5b9b 100644
--- a/src/ast.rs
+++ b/src/ast.rs
@@ -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