public System.Object VisitReturnStatement(System.Management.Automation.Language.ReturnStatementAst returnStatementAst) { IScriptExtent mappedExtent = MapExtent(returnStatementAst.Extent); PipelineBaseAst mappedPipeline = returnStatementAst.Pipeline != null?_VisitPipelineBase(returnStatementAst.Pipeline) : null; return(new ReturnStatementAst(mappedExtent, mappedPipeline)); }
public object VisitReturnStatement(ReturnStatementAst returnStatementAst) { return(false); }
public object VisitReturnStatement(ReturnStatementAst returnStatementAst) { throw PSTraceSource.NewArgumentException("ast"); }
public override AstVisitAction VisitReturnStatement(ReturnStatementAst ast) { return(Check(ast)); }
public override AstVisitAction VisitReturnStatement(ReturnStatementAst returnStatementAst) { this.CheckForFlowOutOfFinally(returnStatementAst, null); return(AstVisitAction.Continue); }
public virtual AstVisitAction VisitReturnStatement(ReturnStatementAst returnStatementAst) { return AstVisitAction.Continue; }
public object VisitReturnStatement(ReturnStatementAst returnStatementAst) { throw new UnexpectedElementException(); }
/// <summary/> public virtual object VisitReturnStatement(ReturnStatementAst returnStatementAst) { return _decorated.VisitReturnStatement(returnStatementAst); }
private void CheckForReturnStatement(ReturnStatementAst ast) { var functionMemberAst = _memberScopeStack.Peek() as FunctionMemberAst; if (functionMemberAst == null) { return; } if (ast.Pipeline != null) { if (functionMemberAst.IsReturnTypeVoid()) { _parser.ReportError(ast.Extent, () => ParserStrings.VoidMethodHasReturn); } } else { if (!functionMemberAst.IsReturnTypeVoid()) { _parser.ReportError(ast.Extent, () => ParserStrings.NonVoidMethodMissingReturnValue); } } }
public override AstVisitAction VisitReturnStatement(ReturnStatementAst returnStatementAst) { CheckForFlowOutOfFinally(returnStatementAst, null); CheckForReturnStatement(returnStatementAst); return AstVisitAction.Continue; }
/// <summary/> public virtual AstVisitAction VisitReturnStatement(ReturnStatementAst returnStatementAst) => DefaultVisit(returnStatementAst);
public object VisitReturnStatement(ReturnStatementAst returnStatementAst) { Expression expression; if (this._compilingTrap) { expression = Expression.Throw(Expression.New(CachedReflectionInfo.ReturnException_ctor, new Expression[] { Expression.Constant(ExpressionCache.AutomationNullConstant) })); } else { expression = Expression.Return(this._returnTarget, this._returnTarget.Type.Equals(typeof(object)) ? ExpressionCache.AutomationNullConstant : ExpressionCache.Empty); } if (returnStatementAst.Pipeline != null) { PipelineBaseAst pipeline = returnStatementAst.Pipeline; AssignmentStatementAst assignmentStatementAst = pipeline as AssignmentStatementAst; Expression expression2 = (assignmentStatementAst != null) ? this.CallAddPipe(this.CompileAssignment(assignmentStatementAst, null), _getCurrentPipe) : this.Compile(pipeline); return Expression.Block(expression2, expression); } return expression; }
/// <summary/> public virtual object VisitReturnStatement(ReturnStatementAst returnStatementAst) { return null; }
public override AstVisitAction VisitReturnStatement(ReturnStatementAst ast) { return CheckParent(ast); }
public override AstVisitAction VisitReturnStatement(ReturnStatementAst returnStatementAst) { this.ReportError(returnStatementAst, () => ParserStrings.FlowControlStatementNotSupportedInDataSection, new object[0]); return(AstVisitAction.Continue); }
/// <summary> /// Visit return statement /// </summary> /// <param name="returnStatementAst"></param> /// <returns></returns> public object VisitReturnStatement(ReturnStatementAst returnStatementAst) { if (returnStatementAst == null) return null; ControlFlowStatement(returnStatementAst.Pipeline)._returns = true; return null; }
public override AstVisitAction VisitReturnStatement(ReturnStatementAst ast) { return this.Check(ast); }
public override AstVisitAction VisitReturnStatement(ReturnStatementAst returnStatementAst) { object value = null; if (returnStatementAst.Pipeline != null) { value = EvaluateAst(returnStatementAst.Pipeline, false); } throw new ReturnException(value); }
public override AstVisitAction VisitReturnStatement(ReturnStatementAst returnStatementAst) { throw new NotImplementedException(); //VisitReturnStatement(returnStatementAst); }
public override AstVisitAction VisitReturnStatement(ReturnStatementAst returnStatementAst) { if (returnStatementAst.Pipeline == null) throw new ReturnException(); throw new NotImplementedException(); //VisitReturnStatement(returnStatementAst); }
public object VisitReturnStatement(ReturnStatementAst returnStatementAst) { return AutomationNull.Value; }
public object VisitReturnStatement(ReturnStatementAst returnStatementAst) { this.ControlFlowStatement(returnStatementAst.Pipeline); return(null); }
/// <summary/> public virtual object VisitReturnStatement(ReturnStatementAst returnStatementAst) { return(null); }
public object VisitReturnStatement(ReturnStatementAst returnStatementAst) { // If we're returning from a trap, we must raise an exception because the trap is a distinct method, but we want // to return from the function containing the trap, not just the trap itself. Expression returnExpr; if (_compilingTrap) { returnExpr = Expression.Throw(Expression.New(CachedReflectionInfo.ReturnException_ctor, ExpressionCache.AutomationNullConstant)); } else { returnExpr = Expression.Return(_returnTarget, _returnTarget.Type == typeof(object) ? ExpressionCache.AutomationNullConstant : ExpressionCache.Empty); } if (returnStatementAst.Pipeline != null) { var pipe = returnStatementAst.Pipeline; var assignmentStatementAst = pipe as AssignmentStatementAst; Expression returnValue; if (CompilingMemberFunction) { // We used a null pipe for the function body, but for the return statement, // we need to write to the pipe passed to our dynamic method so InvokeAsMemberFunction // can get the return value to return it. returnValue = CaptureStatementResults(returnStatementAst.Pipeline, CaptureAstContext.AssignmentWithoutResultPreservation); if (MemberFunctionReturnType != typeof(void)) { // Write directly to the pipe - don't use the dynamic site (CallAddPipe) as that could enumerate. returnValue = Expression.Call(_returnPipe, CachedReflectionInfo.Pipe_Add, returnValue.Convert(MemberFunctionReturnType).Cast(typeof(object))); } return Expression.Block(UpdatePosition(returnStatementAst.Pipeline), Expression.Assign(s_getCurrentPipe, _returnPipe), returnValue, returnExpr); } returnValue = assignmentStatementAst != null ? CallAddPipe(CompileAssignment(assignmentStatementAst), s_getCurrentPipe) : Compile(pipe); return Expression.Block(returnValue, returnExpr); } return returnExpr; }
public object VisitReturnStatement(ReturnStatementAst returnStatementAst) { return false; }
public override AstVisitAction VisitReturnStatement(ReturnStatementAst returnStatementAst) { this.ReportError(returnStatementAst, () => ParserStrings.FlowControlStatementNotSupportedInDataSection, new object[0]); return AstVisitAction.Continue; }
/// <summary/> public virtual AstVisitAction VisitReturnStatement(ReturnStatementAst returnStatementAst) { return(AstVisitAction.Continue); }
public object VisitReturnStatement(ReturnStatementAst returnStatementAst) { this.ControlFlowStatement(returnStatementAst.Pipeline); return null; }
public object VisitReturnStatement(ReturnStatementAst returnStatementAst) { return(AutomationNull.Value); }
public object VisitReturnStatement(ReturnStatementAst returnStatementAst) { throw new NotImplementedException(); }