예제 #1
0
// 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())
	}
}
예제 #2
0
파일: draw.go 프로젝트: javachengwc/many-ql
// IfNode skips any condition evaluation and draw all children (ActionNodes).
func (d Draw) IfNode(i *ast.IfNode) {
	d.nest++
	for _, actionNode := range i.Stack() {
		d.ActionNode(actionNode)
	}
	if i.ElseNode() != nil {
		d.IfNode(i.ElseNode())
	}
	d.nest--
}
예제 #3
0
// 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())
	}
}