From dc9e493fa1d8cc16ebc40382966b54579dc09396 Mon Sep 17 00:00:00 2001 From: greg Date: Tue, 16 Oct 2018 17:18:03 -0700 Subject: [PATCH] Handle more patterns at reduce_ast level --- schala-lang/src/reduced_ast.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/schala-lang/src/reduced_ast.rs b/schala-lang/src/reduced_ast.rs index abbc997..f761a01 100644 --- a/schala-lang/src/reduced_ast.rs +++ b/schala-lang/src/reduced_ast.rs @@ -239,11 +239,16 @@ impl Pattern { } }, PatternLiteral::StringPattern(_s) => unimplemented!(), - PatternLiteral::BoolPattern(_b) => unimplemented!(), + PatternLiteral::BoolPattern(b) => { + unimplemented!() + }, PatternLiteral::VarPattern(var) => match symbol_table.lookup_by_name(var) { Some(symbol) => handle_symbol(symbol, &vec![], item), - None => { - unimplemented!() + None => Alternative { + tag: None, + guard: None, + bound_vars: vec![Some(var.clone())], + item } } },