예제 #1
0
            public override void VisitPipeExpression(PipeExpression node)
            {
                base.VisitPipeExpression(node);

                // operators on right-hand side of pipe have row scope
                if (_position >= node.Operator.TriviaStart)
                {
                    _binder._rowScope = node.Expression.ResultType as TableSymbol;
                }
            }
예제 #2
0
 private static object?Evaluate(Expression expression, IDictionary <string, object> properties)
 {
     return(expression switch
     {
         TextExpression text => text.Value,
         ConstantExpression constant => constant.Value,
         PipeExpression pipe => PipeValue(pipe, properties),
         TemplateExpression part => EvaluateTemplate(part, properties),
         PropertyExpression property => GetProperty(property, properties),
         FunctionCallExpression function => CallFunction(function, properties),
         MultiTemplateExpression => throw new NotSupportedException("Multi-template expressions are top-level expressions only."),
         _ => throw new NotImplementedException(string.Format(Strings.EvaluationNotImplemented, expression)),
     });
            public override void VisitPipeExpression(PipeExpression node)
            {
                node.Expression.Accept(this);

                // result of left-side expression is in scope for right-side query operator
                var oldRowScope = _binder._rowScope;

                _binder._rowScope = _binder.GetResultType(node.Expression) as TableSymbol;
                try
                {
                    node.Operator.Accept(this);
                }
                finally
                {
                    _binder._rowScope = oldRowScope;
                }

                BindNode(node);
            }
예제 #4
0
 public override T VisitPipeExpression(PipeExpression node)
 {
     throw new NotImplementedException();
 }