// IfNode analyzes condition and run all children (ActionNodes). func (exec Execute) IfNode(i *ast.IfNode) { if exec.ResolveComparisonNode(i.Conditions()) { for _, actionNode := range i.Stack() { exec.ActionNode(actionNode) } } else if i.ElseNode() != nil { exec.IfNode(i.ElseNode()) } }
// IfNode analyzes condition and run all children (ActionNodes). func (tc Typechecker) IfNode(i *ast.IfNode) { tc.execute.(ast.Comparator).ResolveComparisonNode(i.Conditions()) for _, actionNode := range i.Stack() { tc.ActionNode(actionNode) } if i.ElseNode() != nil { tc.IfNode(i.ElseNode()) } }