public void Visit(WhenBooleanStatement statement) { var arg = VisitChild(statement.Expression, new CodeDomArg() { Scope = _codeStack.Peek().Scope }); if (arg.Tag != null) _codeStack.Peek().Tag = arg.Tag; var condition = new CodeConditionStatement(); condition.Condition = arg.CodeExpression; var then = VisitChild(statement.Then, new CodeDomArg() { Scope = _codeStack.Peek().Scope }); condition.TrueStatements.Add(new CodeMethodReturnStatement(then.CodeExpression)); if (arg.Tag != null) _codeStack.Peek().Tag = arg.Tag; _codeStack.Peek().ParentStatements.Add(condition); }
public void Visit(WhenBooleanStatement statement, CommonTree tree) { SetLine(statement, tree); Parent(tree).Children.Add(statement); VisitChildren(tree); }