EvaluateAst() public method

public EvaluateAst ( Ast expressionAst ) : object
expressionAst Ast
return object
示例#1
0
        private string GetOutputFileName(FileRedirectionAst redirectionAst)
        {
            object outputPath = _visitor.EvaluateAst(redirectionAst.Location, false);

            if (outputPath != null)
            {
                return(outputPath.ToString());
            }
            return(null);
        }
示例#2
0
        private void FilterByScript()
        {
            ExecutionContext.SetVariable("_", InputObject);

            var executionVisitor = new ExecutionVisitor(ExecutionContext, (PipelineCommandRuntime)CommandRuntime);

            object result = executionVisitor.EvaluateAst(FilterScript.Ast, true);
            if (IsTrue(result))
            {
                WriteObject(InputObject);
            }
        }