public object VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
        {
            var condition = VisitAst(doUntilStatementAst.Condition);
            var body      = VisitAst(doUntilStatementAst.Body);

            return(new DoUntilStatementAst(doUntilStatementAst.Extent, doUntilStatementAst.Label, condition, body));
        }
 public virtual StatementAst VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
 {
     return(new DoUntilStatementAst(
                doUntilStatementAst.Extent,
                doUntilStatementAst.Label,
                doUntilStatementAst.Condition.Rewrite(this),
                doUntilStatementAst.Body.Rewrite(this)));
 }
    public virtual object VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
    {
        var newCondition = VisitElement(doUntilStatementAst.Condition);
        var newBody      = VisitElement(doUntilStatementAst.Body);

        return(new DoUntilStatementAst(doUntilStatementAst.Extent, doUntilStatementAst.Label,
                                       newCondition, newBody));
    }
Exemple #4
0
 public override object VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
 {
     script_.Write("do{");
     VisitElement(doUntilStatementAst.Body);
     script_.Write("}until(");
     VisitElement(doUntilStatementAst.Condition);
     script_.Write(")");
     return(doUntilStatementAst);
 }
 public static DoUntilStatementAst Update(
     this DoUntilStatementAst ast,
     string label = null,
     PipelineBaseAst condition             = null,
     IEnumerable <StatementAst> statements = null)
 {
     return(new DoUntilStatementAst(
                ast.Extent,
                label ?? ast.Label,
                condition?.Clone() ?? ast.Condition.Clone(),
                ast.Body.Update(statements)));
 }
Exemple #6
0
        public override AstVisitAction VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
        {
            explanations.Add(
                new Explanation()
            {
                CommandName     = "do-until statement",
                HelpResult      = HelpTableQuery("about_do"),
                Description     = $"A loop that runs until '{doUntilStatementAst.Condition.Extent.Text}' evaluates to true",
                TextToHighlight = "until"
            }.AddDefaults(doUntilStatementAst, explanations));

            return(base.VisitDoUntilStatement(doUntilStatementAst));
        }
 public object VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst) => null;
Exemple #8
0
 /// <summary/>
 public virtual AstVisitAction VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst) => DefaultVisit(doUntilStatementAst);
 public object VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
 {
     throw PSTraceSource.NewArgumentException("ast");
 }
Exemple #10
0
 public override AstVisitAction VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
 {
     throw new NotImplementedException(); //VisitDoUntilStatement(doUntilStatementAst);
 }
Exemple #11
0
 public override StatementAst VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
 => VisitStatement(base.VisitDoUntilStatement(doUntilStatementAst));
 object ICustomAstVisitor.VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
 => ProcessRewriter(VisitDoUntilStatement, doUntilStatementAst);
Exemple #13
0
 public override AstVisitAction VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
 {
     Console.WriteLine("Visited an DoUntilStatementAst.");
     Console.WriteLine("    " + doUntilStatementAst.ToString().Replace(Environment.NewLine, Environment.NewLine + "    "));
     return(AstVisitAction.Continue);
 }
 public object VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
 {
     return(false);
 }
Exemple #15
0
 public override AstVisitAction VisitDoUntilStatement(DoUntilStatementAst ast)
 {
     return(AstVisitAction.Continue);
 }
Exemple #16
0
 public object VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
 {
     throw new NotImplementedException();
 }
Exemple #17
0
 public object VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
 {
     throw new UnexpectedElementException();
 }
 object ICustomAstVisitor.VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst) => VisitDoUntilStatement(doUntilStatementAst);
Exemple #19
0
 // DoUntilStatementAst Extension Methods
 // New Methods Available:
 // - CreateNodeFromAST(NodeDepth, NodePosition) => Creates a Node
 // - CreateChildNodes ($item in $collection) {} => Creates Child Nodes
 public static DoUntilNode CreateNodeFromAst(this DoUntilStatementAst _ast, int _depth, int _position, Node _parent, Tree _tree)
 {
     return(new DoUntilNode(_ast, _depth, _position, _parent, _tree));
 }
Exemple #20
0
 public object VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
 {
     Console.WriteLine("Visited an DoUntilStatementAst.");
     return(doUntilStatementAst);
 }
 public override AstVisitAction VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
 {
     return(Visit(doUntilStatementAst));
 }
Exemple #22
0
 public virtual object VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
 {
     VisitElement(doUntilStatementAst.Condition);
     VisitElement(doUntilStatementAst.Body);
     return(doUntilStatementAst);
 }
 public virtual TResult VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst) => default(TResult);
Exemple #24
0
 public override AstVisitAction VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst)
 {
     return(AstVisitAction.SkipChildren);
 }
Exemple #25
0
 public override AstVisitAction VisitDoUntilStatement(DoUntilStatementAst ast)
 {
     return(DoNextAction(ast));
 }
Exemple #26
0
 public static IEnumerable <Ast> GetChildAst(this DoUntilStatementAst _ast)
 {
     return(_ast.Body.FindAll(Args => Args is Ast && Args.Parent == _ast.Body, false));
 }
Exemple #27
0
 public override AstVisitAction VisitDoUntilStatement(DoUntilStatementAst doUntilStatementAst) => VisitAst(doUntilStatementAst);