private static IEnumerable <ExpressionAst> GetAssignmentTargets(ExpressionAst expressionAst) { ParenExpressionAst iteratorVariable0 = expressionAst as ParenExpressionAst; if (iteratorVariable0 != null) { foreach (ExpressionAst iteratorVariable1 in GetAssignmentTargets(iteratorVariable0.Pipeline.GetPureExpression())) { yield return(iteratorVariable1); } } else { ArrayLiteralAst iteratorVariable2 = expressionAst as ArrayLiteralAst; if (iteratorVariable2 != null) { foreach (ExpressionAst iteratorVariable3 in iteratorVariable2.Elements.SelectMany <ExpressionAst, ExpressionAst>(new Func <ExpressionAst, IEnumerable <ExpressionAst> >(VariableAnalysis.GetAssignmentTargets))) { yield return(iteratorVariable3); } } else { yield return(expressionAst); } } }
public System.Object VisitParenExpression(System.Management.Automation.Language.ParenExpressionAst parenExpressionAst) { IScriptExtent mappedExtent = MapExtent(parenExpressionAst.Extent); PipelineBaseAst mappedPipeline = _VisitPipelineBase(parenExpressionAst.Pipeline); return(new ParenExpressionAst(mappedExtent, mappedPipeline)); }
/// <summary/> public virtual object VisitParenExpression(ParenExpressionAst parenExpressionAst) { return _decorated.VisitParenExpression(parenExpressionAst); }
/// <summary/> public virtual object VisitParenExpression(ParenExpressionAst parenExpressionAst) { return null; }
public object VisitParenExpression(ParenExpressionAst parenExpressionAst) { return(parenExpressionAst.Pipeline.Accept(this)); }
public object VisitParenExpression(ParenExpressionAst parenExpressionAst) { return parenExpressionAst.Pipeline.Accept(this); }
/// <summary/> public virtual object VisitParenExpression(ParenExpressionAst parenExpressionAst) { return(null); }
public override AstVisitAction VisitParenExpression(ParenExpressionAst ast) { return this.Check(ast); }
public object VisitParenExpression(ParenExpressionAst parenExpressionAst) { throw new UnexpectedElementException(); }
public override AstVisitAction VisitParenExpression(ParenExpressionAst parenExpressionAst) { return(AstVisitAction.Continue); }
public override AstVisitAction VisitParenExpression(ParenExpressionAst parenExpressionAst) { // allowed if the child pipeline is allowed. return AstVisitAction.Continue; }
public virtual AstVisitAction VisitParenExpression(ParenExpressionAst parenExpressionAst) => DefaultVisit(parenExpressionAst);
public object VisitParenExpression(ParenExpressionAst parenExpressionAst) { PipelineBaseAst pipeline = parenExpressionAst.Pipeline; AssignmentStatementAst assignmentStatementAst = pipeline as AssignmentStatementAst; if (assignmentStatementAst == null) { return this.CaptureStatementResults(pipeline, CaptureAstContext.Assignment, null); } return this.CompileAssignment(assignmentStatementAst, null); }
public override AstVisitAction VisitParenExpression(ParenExpressionAst parenExpressionAst) { var value = EvaluateAst(parenExpressionAst.Pipeline); this._pipelineCommandRuntime.WriteObject(value, true); return AstVisitAction.SkipChildren; }
public override AstVisitAction VisitParenExpression(ParenExpressionAst parenExpressionAst) { // just iterate over children return base.VisitParenExpression(parenExpressionAst); }
public virtual AstVisitAction VisitParenExpression(ParenExpressionAst parenExpressionAst) { return AstVisitAction.Continue; }
public object VisitParenExpression(ParenExpressionAst parenExpressionAst) { CheckIsConstant(parenExpressionAst, "Caller to verify ast is constant"); return parenExpressionAst.Pipeline.Accept(this); }
private void CheckAssignmentTarget(ExpressionAst ast, bool simpleAssignment, Action <Ast> reportError) { ArrayLiteralAst ast2 = ast as ArrayLiteralAst; Ast pipeline = null; if (ast2 != null) { if (simpleAssignment) { this.CheckArrayLiteralAssignment(ast2, reportError); } else { pipeline = ast2; } } else { ParenExpressionAst ast4 = ast as ParenExpressionAst; if (ast4 != null) { ExpressionAst pureExpression = ast4.Pipeline.GetPureExpression(); if (pureExpression == null) { pipeline = ast4.Pipeline; } else { this.CheckAssignmentTarget(pureExpression, simpleAssignment, reportError); } } else if (ast is ISupportsAssignment) { if (ast is AttributedExpressionAst) { ExpressionAst child = ast; int num = 0; IScriptExtent extent = null; while (child is AttributedExpressionAst) { ConvertExpressionAst ast7 = child as ConvertExpressionAst; if (ast7 != null) { num++; Type reflectionType = ast7.Type.TypeName.GetReflectionType(); if (typeof(PSReference).Equals(reflectionType)) { extent = ast7.Type.Extent; } else if (typeof(void).Equals(reflectionType)) { this._parser.ReportError(ast7.Type.Extent, ParserStrings.VoidTypeConstraintNotAllowed, new object[0]); } } child = ((AttributedExpressionAst)child).Child; } if ((extent != null) && (num > 1)) { this._parser.ReportError(extent, ParserStrings.ReferenceNeedsToBeByItselfInTypeConstraint, new object[0]); } else { this.CheckAssignmentTarget(child, simpleAssignment, reportError); } } } else { pipeline = ast; } } if (pipeline != null) { reportError(pipeline); } }
public object VisitParenExpression(ParenExpressionAst parenExpressionAst) { var pipe = parenExpressionAst.Pipeline; var assignmentStatementAst = pipe as AssignmentStatementAst; if (assignmentStatementAst != null) { return CompileAssignment(assignmentStatementAst); } // SubExpression and ParenExpression are two special cases for handling the partial output while exception // is thrown. For example, function bar { 1; throw 2 }, the output of (bar) should be 1 and the error record with message '2'; // but the output of (bar).Length should just be the error record with message '2'. bool shouldPreserveOutputInCaseOfException = parenExpressionAst.ShouldPreserveOutputInCaseOfException(); return CaptureStatementResults(pipe, shouldPreserveOutputInCaseOfException ? CaptureAstContext.AssignmentWithResultPreservation : CaptureAstContext.AssignmentWithoutResultPreservation); }
public override AstVisitAction VisitParenExpression(ParenExpressionAst ast) { return(Check(ast)); }
public override AstVisitAction VisitParenExpression(ParenExpressionAst parenExpressionAst) { return AstVisitAction.Continue; }
public virtual AstVisitAction VisitParenExpression(ParenExpressionAst parenExpressionAst) { return(AstVisitAction.Continue); }
/// <summary> /// Visit Paren Expression /// </summary> /// <param name="parenExpressionAst"></param> /// <returns></returns> public object VisitParenExpression(ParenExpressionAst parenExpressionAst) { if (parenExpressionAst == null) return null; parenExpressionAst.Pipeline.Visit(this.Decorator); return null; }
public object VisitParenExpression(ParenExpressionAst parenExpressionAst) { CheckIsConstant(parenExpressionAst, "Caller to verify ast is constant"); return(parenExpressionAst.Pipeline.Accept(this)); }
public object VisitParenExpression(ParenExpressionAst parenExpressionAst) { throw new NotImplementedException(); }