From e52d0bf515eac7f64533a2e7176c8c361bdb78e6 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Tue, 26 Oct 2021 01:03:06 -0700 Subject: [PATCH] Fix AST visitor --- schala-lang/language/src/ast/visitor.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/schala-lang/language/src/ast/visitor.rs b/schala-lang/language/src/ast/visitor.rs index c633ec7..b5c6744 100644 --- a/schala-lang/language/src/ast/visitor.rs +++ b/schala-lang/language/src/ast/visitor.rs @@ -178,8 +178,12 @@ fn walk_if_expr_body(v: &mut V, body: &IfExpressionBody) { Condition::Expression(ref expr) => { walk_expression(v, expr); } - _ => (), + Condition::Else => (), } + if let Some(ref guard) = arm.guard { + walk_expression(v, &guard); + } + walk_block(v, &arm.body); } } }