From e88ed97b06565bdf369684f1611b38b461a1b597 Mon Sep 17 00:00:00 2001 From: greg Date: Tue, 30 Oct 2018 18:39:25 -0700 Subject: [PATCH] Add subpattern struct --- schala-lang/language/src/reduced_ast.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/schala-lang/language/src/reduced_ast.rs b/schala-lang/language/src/reduced_ast.rs index 8c404ba..f6e4d26 100644 --- a/schala-lang/language/src/reduced_ast.rs +++ b/schala-lang/language/src/reduced_ast.rs @@ -59,7 +59,7 @@ pub enum Expr { #[derive(Debug, Clone)] pub struct Alternative { pub tag: Option, - pub subpatterns: Vec, + pub subpatterns: Vec>, pub guard: Option, pub bound_vars: Vec>>, //remember that order matters here pub item: Vec, @@ -71,6 +71,14 @@ impl Alternative { } } +#[derive(Debug, Clone)] +pub struct Subpattern { + pub tag: Option, + pub subpatterns: Vec, + pub bound_vars: Vec>>, + pub guard: Option, +} + #[derive(Debug, Clone)] pub enum Lit { Nat(u64),