public JsonElementProxy Evaluate(QueryExpressionNode left, QueryExpressionNode right, JsonElement element)
        {
            var lElement = left.Evaluate(element);

            if (lElement.ValueKind != JsonValueKind.Number)
            {
                return(default);
示例#2
0
        public JsonElementProxy Evaluate(QueryExpressionNode left, QueryExpressionNode right, JsonElement element)
        {
            var lElement = left.Evaluate(element);

            return(lElement.ValueKind == JsonValueKind.Undefined);
            //return lElement.ValueKind.In(JsonValueKind.False, JsonValueKind.Null, JsonValueKind.Undefined);
        }
        public JsonElementProxy Evaluate(QueryExpressionNode left, QueryExpressionNode right, JsonElement element)
        {
            var lElement = left.Evaluate(element);

            if (!lElement.ValueKind.In(JsonValueKind.False, JsonValueKind.True))
            {
                return(default);
示例#4
0
        public string ToString(QueryExpressionNode left, QueryExpressionNode right)
        {
            var lString = left.MaybeAddParentheses(OrderOfOperation);
            var rString = right.MaybeAddParentheses(OrderOfOperation);

            return($"{lString}!={rString}");
        }
示例#5
0
 public QueryExpressionType GetOutputType(QueryExpressionNode left, QueryExpressionNode right)
 {
     if (left.OutputType == QueryExpressionType.Invalid ||
         right.OutputType == QueryExpressionType.Invalid)
     {
         return(QueryExpressionType.Invalid);
     }
     return(QueryExpressionType.Boolean);
 }
 public QueryExpressionType GetOutputType(QueryExpressionNode left, QueryExpressionNode right)
 {
     if (left.OutputType != right.OutputType)
     {
         return(QueryExpressionType.Invalid);
     }
     if (left.OutputType == QueryExpressionType.Number)
     {
         return(QueryExpressionType.Number);
     }
     return(QueryExpressionType.Invalid);
 }
示例#7
0
 public QueryExpressionType GetOutputType(QueryExpressionNode left, QueryExpressionNode right)
 {
     if (left.OutputType != right.OutputType)
     {
         return(QueryExpressionType.Invalid);
     }
     return(left.OutputType switch
     {
         QueryExpressionType.Number => QueryExpressionType.Boolean,
         QueryExpressionType.String => QueryExpressionType.Boolean,
         _ => QueryExpressionType.Invalid
     });
示例#8
0
 public string ToString(QueryExpressionNode left, QueryExpressionNode right)
 {
     return($"{left}!={right}");
 }
示例#9
0
 public JsonElement Evaluate(QueryExpressionNode left, QueryExpressionNode right, JsonElement element)
 {
     return((!left.Evaluate(element).IsEquivalentTo(right.Evaluate(element))).AsJsonElement());
 }
示例#10
0
 public QueryExpressionNode(QueryExpressionNode left, IQueryExpressionOperator op, QueryExpressionNode right)
 {
     Left     = left ?? throw new ArgumentNullException(nameof(left));
     Operator = op ?? throw new ArgumentNullException(nameof(op));
     Right    = right;
 }
示例#11
0
 public QueryExpressionType GetOutputType(QueryExpressionNode left, QueryExpressionNode right)
 {
     return(QueryExpressionType.Boolean);
 }
示例#12
0
 public string ToString(QueryExpressionNode left, QueryExpressionNode right)
 {
     return(left.ToString());
 }
示例#13
0
 public JsonElementProxy Evaluate(QueryExpressionNode left, QueryExpressionNode right, JsonElement element)
 {
     return(left.Evaluate(element).ValueKind != JsonValueKind.Undefined);
 }