Revert "Reorganise jsonpath operators and methods"
This reverts commit 283a95da923605c1cc148155db2d865d0801b419. The reordering of JsonPathItemType affects the binary on-disk compatibility of the jsonpath type, so we must not change it. Revert for now and consider.
This commit is contained in:
parent
76ba8a8b63
commit
0958f8f6bf
@ -17689,20 +17689,6 @@ strict $.**.HR
|
|||||||
</para></entry>
|
</para></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
<row>
|
|
||||||
<entry role="func_table_entry"><para role="func_signature">
|
|
||||||
<replaceable>number</replaceable> <literal>.</literal> <literal>abs()</literal>
|
|
||||||
<returnvalue><replaceable>number</replaceable></returnvalue>
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Absolute value of the given number
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
<literal>jsonb_path_query('{"z": -0.3}', '$.z.abs()')</literal>
|
|
||||||
<returnvalue>0.3</returnvalue>
|
|
||||||
</para></entry>
|
|
||||||
</row>
|
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry role="func_table_entry"><para role="func_signature">
|
<entry role="func_table_entry"><para role="func_signature">
|
||||||
<replaceable>number</replaceable> <literal>.</literal> <literal>ceiling()</literal>
|
<replaceable>number</replaceable> <literal>.</literal> <literal>ceiling()</literal>
|
||||||
@ -17731,6 +17717,20 @@ strict $.**.HR
|
|||||||
</para></entry>
|
</para></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
|
<row>
|
||||||
|
<entry role="func_table_entry"><para role="func_signature">
|
||||||
|
<replaceable>number</replaceable> <literal>.</literal> <literal>abs()</literal>
|
||||||
|
<returnvalue><replaceable>number</replaceable></returnvalue>
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Absolute value of the given number
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
<literal>jsonb_path_query('{"z": -0.3}', '$.z.abs()')</literal>
|
||||||
|
<returnvalue>0.3</returnvalue>
|
||||||
|
</para></entry>
|
||||||
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry role="func_table_entry"><para role="func_signature">
|
<entry role="func_table_entry"><para role="func_signature">
|
||||||
<replaceable>string</replaceable> <literal>.</literal> <literal>datetime()</literal>
|
<replaceable>string</replaceable> <literal>.</literal> <literal>datetime()</literal>
|
||||||
|
@ -439,10 +439,10 @@ flattenJsonPathParseItem(StringInfo buf, int *result, struct Node *escontext,
|
|||||||
break;
|
break;
|
||||||
case jpiType:
|
case jpiType:
|
||||||
case jpiSize:
|
case jpiSize:
|
||||||
case jpiDouble:
|
|
||||||
case jpiAbs:
|
case jpiAbs:
|
||||||
case jpiCeiling:
|
|
||||||
case jpiFloor:
|
case jpiFloor:
|
||||||
|
case jpiCeiling:
|
||||||
|
case jpiDouble:
|
||||||
case jpiKeyValue:
|
case jpiKeyValue:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -610,6 +610,18 @@ printJsonPathItem(StringInfo buf, JsonPathItem *v, bool inKey,
|
|||||||
if (printBracketes)
|
if (printBracketes)
|
||||||
appendStringInfoChar(buf, ')');
|
appendStringInfoChar(buf, ')');
|
||||||
break;
|
break;
|
||||||
|
case jpiPlus:
|
||||||
|
case jpiMinus:
|
||||||
|
if (printBracketes)
|
||||||
|
appendStringInfoChar(buf, '(');
|
||||||
|
appendStringInfoChar(buf, v->type == jpiPlus ? '+' : '-');
|
||||||
|
jspGetArg(v, &elem);
|
||||||
|
printJsonPathItem(buf, &elem, false,
|
||||||
|
operationPriority(elem.type) <=
|
||||||
|
operationPriority(v->type));
|
||||||
|
if (printBracketes)
|
||||||
|
appendStringInfoChar(buf, ')');
|
||||||
|
break;
|
||||||
case jpiFilter:
|
case jpiFilter:
|
||||||
appendStringInfoString(buf, "?(");
|
appendStringInfoString(buf, "?(");
|
||||||
jspGetArg(v, &elem);
|
jspGetArg(v, &elem);
|
||||||
@ -700,35 +712,23 @@ printJsonPathItem(StringInfo buf, JsonPathItem *v, bool inKey,
|
|||||||
v->content.anybounds.first,
|
v->content.anybounds.first,
|
||||||
v->content.anybounds.last);
|
v->content.anybounds.last);
|
||||||
break;
|
break;
|
||||||
case jpiPlus:
|
|
||||||
case jpiMinus:
|
|
||||||
if (printBracketes)
|
|
||||||
appendStringInfoChar(buf, '(');
|
|
||||||
appendStringInfoChar(buf, v->type == jpiPlus ? '+' : '-');
|
|
||||||
jspGetArg(v, &elem);
|
|
||||||
printJsonPathItem(buf, &elem, false,
|
|
||||||
operationPriority(elem.type) <=
|
|
||||||
operationPriority(v->type));
|
|
||||||
if (printBracketes)
|
|
||||||
appendStringInfoChar(buf, ')');
|
|
||||||
break;
|
|
||||||
case jpiType:
|
case jpiType:
|
||||||
appendStringInfoString(buf, ".type()");
|
appendStringInfoString(buf, ".type()");
|
||||||
break;
|
break;
|
||||||
case jpiSize:
|
case jpiSize:
|
||||||
appendStringInfoString(buf, ".size()");
|
appendStringInfoString(buf, ".size()");
|
||||||
break;
|
break;
|
||||||
case jpiDouble:
|
|
||||||
appendStringInfoString(buf, ".double()");
|
|
||||||
break;
|
|
||||||
case jpiAbs:
|
case jpiAbs:
|
||||||
appendStringInfoString(buf, ".abs()");
|
appendStringInfoString(buf, ".abs()");
|
||||||
break;
|
break;
|
||||||
|
case jpiFloor:
|
||||||
|
appendStringInfoString(buf, ".floor()");
|
||||||
|
break;
|
||||||
case jpiCeiling:
|
case jpiCeiling:
|
||||||
appendStringInfoString(buf, ".ceiling()");
|
appendStringInfoString(buf, ".ceiling()");
|
||||||
break;
|
break;
|
||||||
case jpiFloor:
|
case jpiDouble:
|
||||||
appendStringInfoString(buf, ".floor()");
|
appendStringInfoString(buf, ".double()");
|
||||||
break;
|
break;
|
||||||
case jpiDatetime:
|
case jpiDatetime:
|
||||||
appendStringInfoString(buf, ".datetime(");
|
appendStringInfoString(buf, ".datetime(");
|
||||||
@ -771,11 +771,11 @@ jspOperationName(JsonPathItemType type)
|
|||||||
return "<=";
|
return "<=";
|
||||||
case jpiGreaterOrEqual:
|
case jpiGreaterOrEqual:
|
||||||
return ">=";
|
return ">=";
|
||||||
case jpiAdd:
|
|
||||||
case jpiPlus:
|
case jpiPlus:
|
||||||
|
case jpiAdd:
|
||||||
return "+";
|
return "+";
|
||||||
case jpiSub:
|
|
||||||
case jpiMinus:
|
case jpiMinus:
|
||||||
|
case jpiSub:
|
||||||
return "-";
|
return "-";
|
||||||
case jpiMul:
|
case jpiMul:
|
||||||
return "*";
|
return "*";
|
||||||
@ -783,26 +783,26 @@ jspOperationName(JsonPathItemType type)
|
|||||||
return "/";
|
return "/";
|
||||||
case jpiMod:
|
case jpiMod:
|
||||||
return "%";
|
return "%";
|
||||||
case jpiType:
|
|
||||||
return "type";
|
|
||||||
case jpiSize:
|
|
||||||
return "size";
|
|
||||||
case jpiDouble:
|
|
||||||
return "double";
|
|
||||||
case jpiAbs:
|
|
||||||
return "abs";
|
|
||||||
case jpiCeiling:
|
|
||||||
return "ceiling";
|
|
||||||
case jpiFloor:
|
|
||||||
return "floor";
|
|
||||||
case jpiDatetime:
|
|
||||||
return "datetime";
|
|
||||||
case jpiKeyValue:
|
|
||||||
return "keyvalue";
|
|
||||||
case jpiStartsWith:
|
case jpiStartsWith:
|
||||||
return "starts with";
|
return "starts with";
|
||||||
case jpiLikeRegex:
|
case jpiLikeRegex:
|
||||||
return "like_regex";
|
return "like_regex";
|
||||||
|
case jpiType:
|
||||||
|
return "type";
|
||||||
|
case jpiSize:
|
||||||
|
return "size";
|
||||||
|
case jpiKeyValue:
|
||||||
|
return "keyvalue";
|
||||||
|
case jpiDouble:
|
||||||
|
return "double";
|
||||||
|
case jpiAbs:
|
||||||
|
return "abs";
|
||||||
|
case jpiFloor:
|
||||||
|
return "floor";
|
||||||
|
case jpiCeiling:
|
||||||
|
return "ceiling";
|
||||||
|
case jpiDatetime:
|
||||||
|
return "datetime";
|
||||||
default:
|
default:
|
||||||
elog(ERROR, "unrecognized jsonpath item type: %d", type);
|
elog(ERROR, "unrecognized jsonpath item type: %d", type);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -893,10 +893,10 @@ jspInitByBuffer(JsonPathItem *v, char *base, int32 pos)
|
|||||||
case jpiAnyKey:
|
case jpiAnyKey:
|
||||||
case jpiType:
|
case jpiType:
|
||||||
case jpiSize:
|
case jpiSize:
|
||||||
case jpiDouble:
|
|
||||||
case jpiAbs:
|
case jpiAbs:
|
||||||
case jpiCeiling:
|
|
||||||
case jpiFloor:
|
case jpiFloor:
|
||||||
|
case jpiCeiling:
|
||||||
|
case jpiDouble:
|
||||||
case jpiKeyValue:
|
case jpiKeyValue:
|
||||||
case jpiLast:
|
case jpiLast:
|
||||||
break;
|
break;
|
||||||
@ -935,9 +935,9 @@ jspInitByBuffer(JsonPathItem *v, char *base, int32 pos)
|
|||||||
case jpiNot:
|
case jpiNot:
|
||||||
case jpiExists:
|
case jpiExists:
|
||||||
case jpiIsUnknown:
|
case jpiIsUnknown:
|
||||||
case jpiFilter:
|
|
||||||
case jpiPlus:
|
case jpiPlus:
|
||||||
case jpiMinus:
|
case jpiMinus:
|
||||||
|
case jpiFilter:
|
||||||
case jpiDatetime:
|
case jpiDatetime:
|
||||||
read_int32(v->content.arg, base, pos);
|
read_int32(v->content.arg, base, pos);
|
||||||
break;
|
break;
|
||||||
@ -989,6 +989,13 @@ jspGetNext(JsonPathItem *v, JsonPathItem *a)
|
|||||||
v->type == jpiRoot ||
|
v->type == jpiRoot ||
|
||||||
v->type == jpiVariable ||
|
v->type == jpiVariable ||
|
||||||
v->type == jpiLast ||
|
v->type == jpiLast ||
|
||||||
|
v->type == jpiAdd ||
|
||||||
|
v->type == jpiSub ||
|
||||||
|
v->type == jpiMul ||
|
||||||
|
v->type == jpiDiv ||
|
||||||
|
v->type == jpiMod ||
|
||||||
|
v->type == jpiPlus ||
|
||||||
|
v->type == jpiMinus ||
|
||||||
v->type == jpiEqual ||
|
v->type == jpiEqual ||
|
||||||
v->type == jpiNotEqual ||
|
v->type == jpiNotEqual ||
|
||||||
v->type == jpiGreater ||
|
v->type == jpiGreater ||
|
||||||
@ -999,19 +1006,12 @@ jspGetNext(JsonPathItem *v, JsonPathItem *a)
|
|||||||
v->type == jpiOr ||
|
v->type == jpiOr ||
|
||||||
v->type == jpiNot ||
|
v->type == jpiNot ||
|
||||||
v->type == jpiIsUnknown ||
|
v->type == jpiIsUnknown ||
|
||||||
v->type == jpiAdd ||
|
|
||||||
v->type == jpiPlus ||
|
|
||||||
v->type == jpiSub ||
|
|
||||||
v->type == jpiMinus ||
|
|
||||||
v->type == jpiMul ||
|
|
||||||
v->type == jpiDiv ||
|
|
||||||
v->type == jpiMod ||
|
|
||||||
v->type == jpiType ||
|
v->type == jpiType ||
|
||||||
v->type == jpiSize ||
|
v->type == jpiSize ||
|
||||||
v->type == jpiDouble ||
|
|
||||||
v->type == jpiAbs ||
|
v->type == jpiAbs ||
|
||||||
v->type == jpiCeiling ||
|
|
||||||
v->type == jpiFloor ||
|
v->type == jpiFloor ||
|
||||||
|
v->type == jpiCeiling ||
|
||||||
|
v->type == jpiDouble ||
|
||||||
v->type == jpiDatetime ||
|
v->type == jpiDatetime ||
|
||||||
v->type == jpiKeyValue ||
|
v->type == jpiKeyValue ||
|
||||||
v->type == jpiStartsWith ||
|
v->type == jpiStartsWith ||
|
||||||
|
@ -874,6 +874,33 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case jpiAdd:
|
||||||
|
return executeBinaryArithmExpr(cxt, jsp, jb,
|
||||||
|
numeric_add_opt_error, found);
|
||||||
|
|
||||||
|
case jpiSub:
|
||||||
|
return executeBinaryArithmExpr(cxt, jsp, jb,
|
||||||
|
numeric_sub_opt_error, found);
|
||||||
|
|
||||||
|
case jpiMul:
|
||||||
|
return executeBinaryArithmExpr(cxt, jsp, jb,
|
||||||
|
numeric_mul_opt_error, found);
|
||||||
|
|
||||||
|
case jpiDiv:
|
||||||
|
return executeBinaryArithmExpr(cxt, jsp, jb,
|
||||||
|
numeric_div_opt_error, found);
|
||||||
|
|
||||||
|
case jpiMod:
|
||||||
|
return executeBinaryArithmExpr(cxt, jsp, jb,
|
||||||
|
numeric_mod_opt_error, found);
|
||||||
|
|
||||||
|
case jpiPlus:
|
||||||
|
return executeUnaryArithmExpr(cxt, jsp, jb, NULL, found);
|
||||||
|
|
||||||
|
case jpiMinus:
|
||||||
|
return executeUnaryArithmExpr(cxt, jsp, jb, numeric_uminus,
|
||||||
|
found);
|
||||||
|
|
||||||
case jpiFilter:
|
case jpiFilter:
|
||||||
{
|
{
|
||||||
JsonPathBool st;
|
JsonPathBool st;
|
||||||
@ -953,33 +980,6 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case jpiAdd:
|
|
||||||
return executeBinaryArithmExpr(cxt, jsp, jb,
|
|
||||||
numeric_add_opt_error, found);
|
|
||||||
|
|
||||||
case jpiPlus:
|
|
||||||
return executeUnaryArithmExpr(cxt, jsp, jb, NULL, found);
|
|
||||||
|
|
||||||
case jpiSub:
|
|
||||||
return executeBinaryArithmExpr(cxt, jsp, jb,
|
|
||||||
numeric_sub_opt_error, found);
|
|
||||||
|
|
||||||
case jpiMinus:
|
|
||||||
return executeUnaryArithmExpr(cxt, jsp, jb, numeric_uminus,
|
|
||||||
found);
|
|
||||||
|
|
||||||
case jpiMul:
|
|
||||||
return executeBinaryArithmExpr(cxt, jsp, jb,
|
|
||||||
numeric_mul_opt_error, found);
|
|
||||||
|
|
||||||
case jpiDiv:
|
|
||||||
return executeBinaryArithmExpr(cxt, jsp, jb,
|
|
||||||
numeric_div_opt_error, found);
|
|
||||||
|
|
||||||
case jpiMod:
|
|
||||||
return executeBinaryArithmExpr(cxt, jsp, jb,
|
|
||||||
numeric_mod_opt_error, found);
|
|
||||||
|
|
||||||
case jpiType:
|
case jpiType:
|
||||||
{
|
{
|
||||||
JsonbValue *jbv = palloc(sizeof(*jbv));
|
JsonbValue *jbv = palloc(sizeof(*jbv));
|
||||||
@ -1021,6 +1021,18 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case jpiAbs:
|
||||||
|
return executeNumericItemMethod(cxt, jsp, jb, unwrap, numeric_abs,
|
||||||
|
found);
|
||||||
|
|
||||||
|
case jpiFloor:
|
||||||
|
return executeNumericItemMethod(cxt, jsp, jb, unwrap, numeric_floor,
|
||||||
|
found);
|
||||||
|
|
||||||
|
case jpiCeiling:
|
||||||
|
return executeNumericItemMethod(cxt, jsp, jb, unwrap, numeric_ceil,
|
||||||
|
found);
|
||||||
|
|
||||||
case jpiDouble:
|
case jpiDouble:
|
||||||
{
|
{
|
||||||
JsonbValue jbv;
|
JsonbValue jbv;
|
||||||
@ -1086,18 +1098,6 @@ executeItemOptUnwrapTarget(JsonPathExecContext *cxt, JsonPathItem *jsp,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case jpiAbs:
|
|
||||||
return executeNumericItemMethod(cxt, jsp, jb, unwrap, numeric_abs,
|
|
||||||
found);
|
|
||||||
|
|
||||||
case jpiCeiling:
|
|
||||||
return executeNumericItemMethod(cxt, jsp, jb, unwrap, numeric_ceil,
|
|
||||||
found);
|
|
||||||
|
|
||||||
case jpiFloor:
|
|
||||||
return executeNumericItemMethod(cxt, jsp, jb, unwrap, numeric_floor,
|
|
||||||
found);
|
|
||||||
|
|
||||||
case jpiDatetime:
|
case jpiDatetime:
|
||||||
if (unwrap && JsonbType(jb) == jbvArray)
|
if (unwrap && JsonbType(jb) == jbvArray)
|
||||||
return executeItemUnwrapTargetArray(cxt, jsp, jb, found, false);
|
return executeItemUnwrapTargetArray(cxt, jsp, jb, found, false);
|
||||||
|
@ -80,7 +80,7 @@ static bool makeItemLikeRegex(JsonPathParseItem *expr,
|
|||||||
%token <str> OR_P AND_P NOT_P
|
%token <str> OR_P AND_P NOT_P
|
||||||
%token <str> LESS_P LESSEQUAL_P EQUAL_P NOTEQUAL_P GREATEREQUAL_P GREATER_P
|
%token <str> LESS_P LESSEQUAL_P EQUAL_P NOTEQUAL_P GREATEREQUAL_P GREATER_P
|
||||||
%token <str> ANY_P STRICT_P LAX_P LAST_P STARTS_P WITH_P LIKE_REGEX_P FLAG_P
|
%token <str> ANY_P STRICT_P LAX_P LAST_P STARTS_P WITH_P LIKE_REGEX_P FLAG_P
|
||||||
%token <str> TYPE_P SIZE_P DOUBLE_P ABS_P CEILING_P FLOOR_P KEYVALUE_P
|
%token <str> ABS_P SIZE_P TYPE_P FLOOR_P DOUBLE_P CEILING_P KEYVALUE_P
|
||||||
%token <str> DATETIME_P
|
%token <str> DATETIME_P
|
||||||
|
|
||||||
%type <result> result
|
%type <result> result
|
||||||
@ -206,10 +206,10 @@ accessor_expr:
|
|||||||
expr:
|
expr:
|
||||||
accessor_expr { $$ = makeItemList($1); }
|
accessor_expr { $$ = makeItemList($1); }
|
||||||
| '(' expr ')' { $$ = $2; }
|
| '(' expr ')' { $$ = $2; }
|
||||||
| expr '+' expr { $$ = makeItemBinary(jpiAdd, $1, $3); }
|
|
||||||
| '+' expr %prec UMINUS { $$ = makeItemUnary(jpiPlus, $2); }
|
| '+' expr %prec UMINUS { $$ = makeItemUnary(jpiPlus, $2); }
|
||||||
| expr '-' expr { $$ = makeItemBinary(jpiSub, $1, $3); }
|
|
||||||
| '-' expr %prec UMINUS { $$ = makeItemUnary(jpiMinus, $2); }
|
| '-' expr %prec UMINUS { $$ = makeItemUnary(jpiMinus, $2); }
|
||||||
|
| expr '+' expr { $$ = makeItemBinary(jpiAdd, $1, $3); }
|
||||||
|
| expr '-' expr { $$ = makeItemBinary(jpiSub, $1, $3); }
|
||||||
| expr '*' expr { $$ = makeItemBinary(jpiMul, $1, $3); }
|
| expr '*' expr { $$ = makeItemBinary(jpiMul, $1, $3); }
|
||||||
| expr '/' expr { $$ = makeItemBinary(jpiDiv, $1, $3); }
|
| expr '/' expr { $$ = makeItemBinary(jpiDiv, $1, $3); }
|
||||||
| expr '%' expr { $$ = makeItemBinary(jpiMod, $1, $3); }
|
| expr '%' expr { $$ = makeItemBinary(jpiMod, $1, $3); }
|
||||||
@ -278,28 +278,28 @@ key_name:
|
|||||||
| EXISTS_P
|
| EXISTS_P
|
||||||
| STRICT_P
|
| STRICT_P
|
||||||
| LAX_P
|
| LAX_P
|
||||||
| LAST_P
|
|
||||||
| FLAG_P
|
|
||||||
| TYPE_P
|
|
||||||
| SIZE_P
|
|
||||||
| DOUBLE_P
|
|
||||||
| ABS_P
|
| ABS_P
|
||||||
| CEILING_P
|
| SIZE_P
|
||||||
|
| TYPE_P
|
||||||
| FLOOR_P
|
| FLOOR_P
|
||||||
|
| DOUBLE_P
|
||||||
|
| CEILING_P
|
||||||
| DATETIME_P
|
| DATETIME_P
|
||||||
| KEYVALUE_P
|
| KEYVALUE_P
|
||||||
|
| LAST_P
|
||||||
| STARTS_P
|
| STARTS_P
|
||||||
| WITH_P
|
| WITH_P
|
||||||
| LIKE_REGEX_P
|
| LIKE_REGEX_P
|
||||||
|
| FLAG_P
|
||||||
;
|
;
|
||||||
|
|
||||||
method:
|
method:
|
||||||
TYPE_P { $$ = jpiType; }
|
ABS_P { $$ = jpiAbs; }
|
||||||
| SIZE_P { $$ = jpiSize; }
|
| SIZE_P { $$ = jpiSize; }
|
||||||
| DOUBLE_P { $$ = jpiDouble; }
|
| TYPE_P { $$ = jpiType; }
|
||||||
| ABS_P { $$ = jpiAbs; }
|
|
||||||
| CEILING_P { $$ = jpiCeiling; }
|
|
||||||
| FLOOR_P { $$ = jpiFloor; }
|
| FLOOR_P { $$ = jpiFloor; }
|
||||||
|
| DOUBLE_P { $$ = jpiDouble; }
|
||||||
|
| CEILING_P { $$ = jpiCeiling; }
|
||||||
| KEYVALUE_P { $$ = jpiKeyValue; }
|
| KEYVALUE_P { $$ = jpiKeyValue; }
|
||||||
;
|
;
|
||||||
%%
|
%%
|
||||||
|
@ -66,6 +66,13 @@ typedef enum JsonPathItemType
|
|||||||
jpiGreater, /* expr > expr */
|
jpiGreater, /* expr > expr */
|
||||||
jpiLessOrEqual, /* expr <= expr */
|
jpiLessOrEqual, /* expr <= expr */
|
||||||
jpiGreaterOrEqual, /* expr >= expr */
|
jpiGreaterOrEqual, /* expr >= expr */
|
||||||
|
jpiAdd, /* expr + expr */
|
||||||
|
jpiSub, /* expr - expr */
|
||||||
|
jpiMul, /* expr * expr */
|
||||||
|
jpiDiv, /* expr / expr */
|
||||||
|
jpiMod, /* expr % expr */
|
||||||
|
jpiPlus, /* + expr */
|
||||||
|
jpiMinus, /* - expr */
|
||||||
jpiAnyArray, /* [*] */
|
jpiAnyArray, /* [*] */
|
||||||
jpiAnyKey, /* .* */
|
jpiAnyKey, /* .* */
|
||||||
jpiIndexArray, /* [subscript, ...] */
|
jpiIndexArray, /* [subscript, ...] */
|
||||||
@ -76,28 +83,14 @@ typedef enum JsonPathItemType
|
|||||||
jpiVariable, /* $variable */
|
jpiVariable, /* $variable */
|
||||||
jpiFilter, /* ? (predicate) */
|
jpiFilter, /* ? (predicate) */
|
||||||
jpiExists, /* EXISTS (expr) predicate */
|
jpiExists, /* EXISTS (expr) predicate */
|
||||||
|
|
||||||
/*
|
|
||||||
* For better maintainability or readability, keep the order of the below
|
|
||||||
* jsonpath Operators and Methods at the other places, like in the
|
|
||||||
* documentation, switch() cases, keywords list, etc., too.
|
|
||||||
*/
|
|
||||||
jpiAdd, /* expr + expr */
|
|
||||||
jpiPlus, /* + expr */
|
|
||||||
jpiSub, /* expr - expr */
|
|
||||||
jpiMinus, /* - expr */
|
|
||||||
jpiMul, /* expr * expr */
|
|
||||||
jpiDiv, /* expr / expr */
|
|
||||||
jpiMod, /* expr % expr */
|
|
||||||
jpiType, /* .type() item method */
|
jpiType, /* .type() item method */
|
||||||
jpiSize, /* .size() item method */
|
jpiSize, /* .size() item method */
|
||||||
jpiDouble, /* .double() item method */
|
|
||||||
jpiAbs, /* .abs() item method */
|
jpiAbs, /* .abs() item method */
|
||||||
jpiCeiling, /* .ceiling() item method */
|
|
||||||
jpiFloor, /* .floor() item method */
|
jpiFloor, /* .floor() item method */
|
||||||
|
jpiCeiling, /* .ceiling() item method */
|
||||||
|
jpiDouble, /* .double() item method */
|
||||||
jpiDatetime, /* .datetime() item method */
|
jpiDatetime, /* .datetime() item method */
|
||||||
jpiKeyValue, /* .keyvalue() item method */
|
jpiKeyValue, /* .keyvalue() item method */
|
||||||
|
|
||||||
jpiSubscript, /* array subscript: 'expr' or 'expr TO expr' */
|
jpiSubscript, /* array subscript: 'expr' or 'expr TO expr' */
|
||||||
jpiLast, /* LAST array subscript */
|
jpiLast, /* LAST array subscript */
|
||||||
jpiStartsWith, /* STARTS WITH predicate */
|
jpiStartsWith, /* STARTS WITH predicate */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user