public JsonElementProxy Evaluate(QueryExpressionNode left, QueryExpressionNode right, JsonElement element) { var lElement = left.Evaluate(element); if (lElement.ValueKind != JsonValueKind.Number) { return(default);
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);
public string ToString(QueryExpressionNode left, QueryExpressionNode right) { var lString = left.MaybeAddParentheses(OrderOfOperation); var rString = right.MaybeAddParentheses(OrderOfOperation); return($"{lString}!={rString}"); }
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); }
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 });
public string ToString(QueryExpressionNode left, QueryExpressionNode right) { return($"{left}!={right}"); }
public JsonElement Evaluate(QueryExpressionNode left, QueryExpressionNode right, JsonElement element) { return((!left.Evaluate(element).IsEquivalentTo(right.Evaluate(element))).AsJsonElement()); }
public QueryExpressionNode(QueryExpressionNode left, IQueryExpressionOperator op, QueryExpressionNode right) { Left = left ?? throw new ArgumentNullException(nameof(left)); Operator = op ?? throw new ArgumentNullException(nameof(op)); Right = right; }
public QueryExpressionType GetOutputType(QueryExpressionNode left, QueryExpressionNode right) { return(QueryExpressionType.Boolean); }
public string ToString(QueryExpressionNode left, QueryExpressionNode right) { return(left.ToString()); }
public JsonElementProxy Evaluate(QueryExpressionNode left, QueryExpressionNode right, JsonElement element) { return(left.Evaluate(element).ValueKind != JsonValueKind.Undefined); }