示例#1
0
    public System.Object VisitExitStatement(System.Management.Automation.Language.ExitStatementAst exitStatementAst)
    {
        IScriptExtent mappedExtent = MapExtent(exitStatementAst.Extent);

        PipelineBaseAst mappedPipeline = _VisitPipelineBase(exitStatementAst.Pipeline);

        return(new ExitStatementAst(mappedExtent, mappedPipeline));
    }
示例#2
0
 public override AstVisitAction VisitExitStatement(ExitStatementAst ast) { return CheckParent(ast); }
示例#3
0
 public object VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     return(false);
 }
示例#4
0
 public object VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     throw PSTraceSource.NewArgumentException("ast");
 }
示例#5
0
 public override AstVisitAction VisitExitStatement(ExitStatementAst ast)
 {
     return(Check(ast));
 }
示例#6
0
 public object VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     this.ControlFlowStatement(exitStatementAst.Pipeline);
     return(null);
 }
示例#7
0
 public override AstVisitAction VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     throw new NotImplementedException(); //VisitExitStatement(exitStatementAst);
 }
示例#8
0
 public override AstVisitAction VisitExitStatement(ExitStatementAst ast)
 {
     return this.Check(ast);
 }
 public object VisitExitStatement(ExitStatementAst exitStatementAst) { throw new UnexpectedElementException(); }
 public override AstVisitAction VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     this.ReportError(exitStatementAst, () => ParserStrings.FlowControlStatementNotSupportedInDataSection, new object[0]);
     return(AstVisitAction.Continue);
 }
示例#11
0
 /// <summary/>
 public virtual AstVisitAction VisitExitStatement(ExitStatementAst exitStatementAst) => DefaultVisit(exitStatementAst);
示例#12
0
文件: Compiler.cs 项目: nickchal/pash
 public object VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     Expression expr = (exitStatementAst.Pipeline != null) ? this.CaptureStatementResults(exitStatementAst.Pipeline, CaptureAstContext.Assignment, null) : ExpressionCache.Constant(0);
     return Expression.Block(this.UpdatePosition(exitStatementAst), Expression.Throw(Expression.Call(CachedReflectionInfo.PipelineOps_GetExitException, expr.Convert(typeof(object))), typeof(void)));
 }
示例#13
0
 /// <summary/>
 public virtual object VisitExitStatement(ExitStatementAst exitStatementAst) { return null; }
 /// <summary/>
 public virtual object VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     return _decorated.VisitExitStatement(exitStatementAst);
 }
示例#15
0
 public object VisitExitStatement(ExitStatementAst exitStatementAst) { return AutomationNull.Value; }
示例#16
0
 public override AstVisitAction VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     object arg = exitStatementAst.Pipeline == null ? null : EvaluateAst(exitStatementAst.Pipeline, false);
     throw new ExitException(arg);
 }
示例#17
0
 public object VisitExitStatement(ExitStatementAst exitStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
示例#18
0
        public override AstVisitAction VisitExitStatement(ExitStatementAst exitStatementAst)
        {
            if (exitStatementAst.Pipeline == null) throw new ReturnException();

            throw new NotImplementedException(); //VisitExitStatement(exitStatementAst);
        }
示例#19
0
        public object VisitExitStatement(ExitStatementAst exitStatementAst)
        {
            // We should not preserve the partial output if exception is thrown when evaluating exitStmt.pipeline.
            Expression exitCode = exitStatementAst.Pipeline != null
                                      ? CaptureStatementResults(exitStatementAst.Pipeline, CaptureAstContext.AssignmentWithoutResultPreservation)
                                      : ExpressionCache.Constant(0);

            return Expression.Block(
                UpdatePosition(exitStatementAst),
                Expression.Throw(Expression.Call(CachedReflectionInfo.PipelineOps_GetExitException,
                                                 exitCode.Convert(typeof(object))),
                                 typeof(void)));
        }
示例#20
0
 // TODO: public virtual AstVisitAction VisitErrorExpression(ErrorExpressionAst errorExpressionAst){return  AstVisitAction.Continue; }
 // TODO: public virtual AstVisitAction VisitErrorStatement(ErrorStatementAst errorStatementAst){return  AstVisitAction.Continue; }
 public virtual AstVisitAction VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     return AstVisitAction.Continue;
 }
示例#21
0
 public override AstVisitAction VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     this.ReportError(exitStatementAst, () => ParserStrings.FlowControlStatementNotSupportedInDataSection, new object[0]);
     return AstVisitAction.Continue;
 }
示例#22
0
 /// <summary/>
 public virtual object VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     return(null);
 }
示例#23
0
 public override AstVisitAction VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     int exitCode = 0;
     if (exitStatementAst.Pipeline != null)
     {
         var value = EvaluateAst(exitStatementAst.Pipeline, false);
         // Default PS behavior: either convert value to int or it's 0 (see above)
         LanguagePrimitives.TryConvertTo<int>(value, out exitCode);
     }
     throw new ExitException(exitCode);
 }
示例#24
0
 public object VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     return false;
 }
示例#25
0
 public object VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     this.ControlFlowStatement(exitStatementAst.Pipeline);
     return null;
 }
示例#26
0
 /// <summary/>
 public virtual AstVisitAction VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     return(AstVisitAction.Continue);
 }
        /// <summary>
        /// Visit exit statement
        /// </summary>
        /// <param name="exitStatementAst"></param>
        /// <returns></returns>
        public object VisitExitStatement(ExitStatementAst exitStatementAst)
        {
            if (exitStatementAst == null) return null;

            ControlFlowStatement(exitStatementAst.Pipeline)._throws = true;
            return null;
        }
示例#28
0
 public object VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     return(AutomationNull.Value);
 }
 public object VisitExitStatement(ExitStatementAst exitStatementAst)
 {
     throw new NotImplementedException();
 }