From 5afdc16f2e43095fb14609a1a1581e5947bfaf38 Mon Sep 17 00:00:00 2001 From: greg Date: Tue, 15 Oct 2019 03:51:36 -0700 Subject: [PATCH] Still more visitor work --- schala-lang/language/src/ast/walker.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/schala-lang/language/src/ast/walker.rs b/schala-lang/language/src/ast/walker.rs index 6298110..df370b9 100644 --- a/schala-lang/language/src/ast/walker.rs +++ b/schala-lang/language/src/ast/walker.rs @@ -187,7 +187,23 @@ fn if_expression_body(v: &mut V, body: &IfExpressionBody) { } fn condition_arm(v: &mut V, arm: &ConditionArm) { + use Condition::*; v.condition_arm(arm); + match arm.condition { + Pattern(ref pat) => { + v.pattern(pat); + walk_pattern(v, pat); + }, + TruncatedOp(ref _binop, ref expr) => { + v.expression(expr); + expression(v, expr); + }, + Expression(ref expr) => { + v.expression(expr); + expression(v, expr); + }, + _ => () + } } fn walk_pattern(v: &mut V, pat: &Pattern) {