コード例 #1
0
ファイル: SourceMapper.cs プロジェクト: gpduck/ScriptMap
    public System.Object VisitThrowStatement(System.Management.Automation.Language.ThrowStatementAst throwStatementAst)
    {
        IScriptExtent mappedExtent = MapExtent(throwStatementAst.Extent);

        PipelineBaseAst mappedPipeline = _VisitPipelineBase(throwStatementAst.Pipeline);

        return(new ThrowStatementAst(mappedExtent, mappedPipeline));
    }
コード例 #2
0
ファイル: AstVisitor.cs プロジェクト: 40a/PowerShell
 public override AstVisitAction VisitThrowStatement(ThrowStatementAst ast) { return CheckParent(ast); }
コード例 #3
0
 public object VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     return(false);
 }
コード例 #4
0
 public object VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     throw PSTraceSource.NewArgumentException("ast");
 }
コード例 #5
0
 public override AstVisitAction VisitThrowStatement(ThrowStatementAst ast)
 {
     return(Check(ast));
 }
コード例 #6
0
 public object VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     this.ControlFlowStatement(throwStatementAst.Pipeline);
     return(null);
 }
コード例 #7
0
ファイル: ExecutionVisitor.cs プロジェクト: JayBazuzi/Pash
 public override AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     throw new NotImplementedException(); //VisitThrowStatement(throwStatementAst);
 }
コード例 #8
0
ファイル: ExecutionVisitor.cs プロジェクト: stangelandcl/Pash
        public override AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst)
        {
            object targetObject = GetTargetObject(throwStatementAst);
            if (targetObject is Exception)
            {
                throw (Exception)targetObject;
            }

            string errorMessage = GetErrorMessageForThrowStatement(targetObject);
            throw new RuntimeException(errorMessage);
        }
コード例 #9
0
ファイル: AstSearcher.cs プロジェクト: nickchal/pash
 public override AstVisitAction VisitThrowStatement(ThrowStatementAst ast)
 {
     return this.Check(ast);
 }
コード例 #10
0
 public override AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     this.ReportError(throwStatementAst, () => ParserStrings.FlowControlStatementNotSupportedInDataSection, new object[0]);
     return(AstVisitAction.Continue);
 }
コード例 #11
0
 public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { throw new UnexpectedElementException(); }
コード例 #12
0
 /// <summary/>
 public virtual AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst) => DefaultVisit(throwStatementAst);
コード例 #13
0
ファイル: Compiler.cs プロジェクト: nickchal/pash
 public object VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     Expression expr = throwStatementAst.IsRethrow ? _currentExceptionBeingHandled : ((throwStatementAst.Pipeline == null) ? ExpressionCache.NullConstant : this.CaptureStatementResults(throwStatementAst.Pipeline, CaptureAstContext.Assignment, null));
     return Expression.Block(this.UpdatePosition(throwStatementAst), Expression.Throw(Expression.Call(CachedReflectionInfo.ExceptionHandlingOps_ConvertToException, expr.Convert(typeof(object)), Expression.Constant(throwStatementAst.Extent))));
 }
コード例 #14
0
ファイル: AstVisitor.cs プロジェクト: 40a/PowerShell
 /// <summary/>
 public virtual object VisitThrowStatement(ThrowStatementAst throwStatementAst) { return null; }
コード例 #15
0
 /// <summary/>
 public virtual object VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     return _decorated.VisitThrowStatement(throwStatementAst);
 }
コード例 #16
0
ファイル: ConstantValues.cs プロジェクト: 40a/PowerShell
 public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { return AutomationNull.Value; }
コード例 #17
0
ファイル: SafeValues.cs プロジェクト: 40a/PowerShell
 public object VisitThrowStatement(ThrowStatementAst throwStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
コード例 #18
0
ファイル: ExecutionVisitor.cs プロジェクト: stangelandcl/Pash
 private object GetTargetObject(ThrowStatementAst throwStatementAst)
 {
     if (throwStatementAst.Pipeline != null)
     {
         object targetObject = EvaluateAst(throwStatementAst.Pipeline, false);
         if (targetObject is PSObject)
         {
             return ((PSObject)targetObject).BaseObject;
         }
         return targetObject;
     }
     return null;
 }
コード例 #19
0
ファイル: Compiler.cs プロジェクト: 40a/PowerShell
        public object VisitThrowStatement(ThrowStatementAst throwStatementAst)
        {
            // We should not preserve the partial output if exception is thrown when evaluating throwStmt.pipeline.
            Expression throwExpr = throwStatementAst.IsRethrow
                                       ? s_currentExceptionBeingHandled
                                       : (throwStatementAst.Pipeline == null)
                                             ? ExpressionCache.NullConstant
                                             : CaptureStatementResults(throwStatementAst.Pipeline,
                                                                       CaptureAstContext.AssignmentWithoutResultPreservation);

            return Expression.Block(
                UpdatePosition(throwStatementAst),
                Expression.Throw(Expression.Call(CachedReflectionInfo.ExceptionHandlingOps_ConvertToException,
                                                 throwExpr.Convert(typeof(object)),
                                                 Expression.Constant(throwStatementAst.Extent))));
        }
コード例 #20
0
ファイル: AstVisitor.cs プロジェクト: JamesTryand/Pash2
 public virtual AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     return AstVisitAction.Continue;
 }
コード例 #21
0
ファイル: VariableAnalysis.cs プロジェクト: 40a/PowerShell
 public object VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     // Even if we are in try-catch, we still can safely assume that flow can go to exit from here.
     // Additional exit point would not affect correctness of analysis: we handle throwing of any statement inside try-body in VisitTryStatement.
     ControlFlowStatement(throwStatementAst.Pipeline)._throws = true;
     return null;
 }
コード例 #22
0
 /// <summary/>
 public virtual object VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     return(null);
 }
コード例 #23
0
 public override AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     this.ReportError(throwStatementAst, () => ParserStrings.FlowControlStatementNotSupportedInDataSection, new object[0]);
     return AstVisitAction.Continue;
 }
コード例 #24
0
 public object VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     return false;
 }
コード例 #25
0
ファイル: VariableAnalysis.cs プロジェクト: nickchal/pash
 public object VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     this.ControlFlowStatement(throwStatementAst.Pipeline);
     return null;
 }
コード例 #26
0
 /// <summary/>
 public virtual AstVisitAction VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     return(AstVisitAction.Continue);
 }
コード例 #27
0
        /// <summary>
        /// Visit throw statement
        /// </summary>
        /// <param name="throwStatementAst"></param>
        /// <returns></returns>
        public object VisitThrowStatement(ThrowStatementAst throwStatementAst)
        {
            if (throwStatementAst == null) return null;

            ControlFlowStatement(throwStatementAst.Pipeline)._throws = true;
            return null;
        }
コード例 #28
0
 public object VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     return(AutomationNull.Value);
 }
コード例 #29
0
 public object VisitThrowStatement(ThrowStatementAst throwStatementAst)
 {
     throw new NotImplementedException();
 }