1
0
Fork 0

Bug fix 3.5/fix in not in workaround (#9814)

* remove hack for NOT IN

* added parsing test

* added derived files

* added CHANGELOG entry
This commit is contained in:
Jan 2019-08-28 13:04:24 +02:00 committed by KVS85
parent bc1df0e78d
commit 226373e200
8 changed files with 1531 additions and 1501 deletions

View File

@ -1,6 +1,10 @@
v3.5.1 (XXXX-XX-XX)
-------------------
* Fixed parsing of "NOT IN" in AQL, which previously didn't correctly parse
"NOT IN_RANGE(...)" because it checked if the "NOT" token was followed by
whitespace and then the two letters "IN".
* Changed log level for message "keep alive timeout - closing stream!" from INFO to
DEBUG.

File diff suppressed because it is too large Load Diff

View File

@ -85,39 +85,39 @@ extern int Aqldebug;
T_NOT = 290,
T_AND = 291,
T_OR = 292,
T_NIN = 293,
T_REGEX_MATCH = 294,
T_REGEX_NON_MATCH = 295,
T_EQ = 296,
T_NE = 297,
T_LT = 298,
T_GT = 299,
T_LE = 300,
T_GE = 301,
T_LIKE = 302,
T_PLUS = 303,
T_MINUS = 304,
T_TIMES = 305,
T_DIV = 306,
T_MOD = 307,
T_QUESTION = 308,
T_COLON = 309,
T_SCOPE = 310,
T_RANGE = 311,
T_COMMA = 312,
T_OPEN = 313,
T_CLOSE = 314,
T_OBJECT_OPEN = 315,
T_OBJECT_CLOSE = 316,
T_ARRAY_OPEN = 317,
T_ARRAY_CLOSE = 318,
T_OUTBOUND = 319,
T_INBOUND = 320,
T_ANY = 321,
T_ALL = 322,
T_NONE = 323,
UMINUS = 324,
UPLUS = 325,
T_REGEX_MATCH = 293,
T_REGEX_NON_MATCH = 294,
T_EQ = 295,
T_NE = 296,
T_LT = 297,
T_GT = 298,
T_LE = 299,
T_GE = 300,
T_LIKE = 301,
T_PLUS = 302,
T_MINUS = 303,
T_TIMES = 304,
T_DIV = 305,
T_MOD = 306,
T_QUESTION = 307,
T_COLON = 308,
T_SCOPE = 309,
T_RANGE = 310,
T_COMMA = 311,
T_OPEN = 312,
T_CLOSE = 313,
T_OBJECT_OPEN = 314,
T_OBJECT_CLOSE = 315,
T_ARRAY_OPEN = 316,
T_ARRAY_CLOSE = 317,
T_OUTBOUND = 318,
T_INBOUND = 319,
T_ANY = 320,
T_ALL = 321,
T_NONE = 322,
UMINUS = 323,
UPLUS = 324,
UNEGATION = 325,
FUNCCALL = 326,
REFERENCE = 327,
INDEXED = 328,

View File

@ -85,39 +85,39 @@ extern int Aqldebug;
T_NOT = 290,
T_AND = 291,
T_OR = 292,
T_NIN = 293,
T_REGEX_MATCH = 294,
T_REGEX_NON_MATCH = 295,
T_EQ = 296,
T_NE = 297,
T_LT = 298,
T_GT = 299,
T_LE = 300,
T_GE = 301,
T_LIKE = 302,
T_PLUS = 303,
T_MINUS = 304,
T_TIMES = 305,
T_DIV = 306,
T_MOD = 307,
T_QUESTION = 308,
T_COLON = 309,
T_SCOPE = 310,
T_RANGE = 311,
T_COMMA = 312,
T_OPEN = 313,
T_CLOSE = 314,
T_OBJECT_OPEN = 315,
T_OBJECT_CLOSE = 316,
T_ARRAY_OPEN = 317,
T_ARRAY_CLOSE = 318,
T_OUTBOUND = 319,
T_INBOUND = 320,
T_ANY = 321,
T_ALL = 322,
T_NONE = 323,
UMINUS = 324,
UPLUS = 325,
T_REGEX_MATCH = 293,
T_REGEX_NON_MATCH = 294,
T_EQ = 295,
T_NE = 296,
T_LT = 297,
T_GT = 298,
T_LE = 299,
T_GE = 300,
T_LIKE = 301,
T_PLUS = 302,
T_MINUS = 303,
T_TIMES = 304,
T_DIV = 305,
T_MOD = 306,
T_QUESTION = 307,
T_COLON = 308,
T_SCOPE = 309,
T_RANGE = 310,
T_COMMA = 311,
T_OPEN = 312,
T_CLOSE = 313,
T_OBJECT_OPEN = 314,
T_OBJECT_CLOSE = 315,
T_ARRAY_OPEN = 316,
T_ARRAY_CLOSE = 317,
T_OUTBOUND = 318,
T_INBOUND = 319,
T_ANY = 320,
T_ALL = 321,
T_NONE = 322,
UMINUS = 323,
UPLUS = 324,
UNEGATION = 325,
FUNCCALL = 326,
REFERENCE = 327,
INDEXED = 328,

View File

@ -255,7 +255,6 @@ static AstNode* TransformOutputVariables(Parser* parser, AstNode const* names) {
%token T_NOT "not operator"
%token T_AND "and operator"
%token T_OR "or operator"
%token T_NIN "not in operator"
%token T_REGEX_MATCH "~= operator"
%token T_REGEX_NON_MATCH "~! operator"
@ -308,12 +307,12 @@ static AstNode* TransformOutputVariables(Parser* parser, AstNode const* names) {
%left T_AND
%nonassoc T_OUTBOUND T_INBOUND T_ANY T_ALL T_NONE
%left T_EQ T_NE T_LIKE T_REGEX_MATCH T_REGEX_NON_MATCH
%left T_IN T_NIN
%left T_IN T_NOT
%left T_LT T_GT T_LE T_GE
%left T_RANGE
%left T_PLUS T_MINUS
%left T_TIMES T_DIV T_MOD
%right UMINUS UPLUS T_NOT
%right UMINUS UPLUS UNEGATION
%left FUNCCALL
%left REFERENCE
%left INDEXED
@ -1332,7 +1331,7 @@ operator_unary:
| T_MINUS expression %prec UMINUS {
$$ = parser->ast()->createNodeUnaryOperator(NODE_TYPE_OPERATOR_UNARY_MINUS, $2);
}
| T_NOT expression %prec T_NOT {
| T_NOT expression %prec UNEGATION {
$$ = parser->ast()->createNodeUnaryOperator(NODE_TYPE_OPERATOR_UNARY_NOT, $2);
}
;
@ -1380,8 +1379,8 @@ operator_binary:
| expression T_IN expression {
$$ = parser->ast()->createNodeBinaryOperator(NODE_TYPE_OPERATOR_BINARY_IN, $1, $3);
}
| expression T_NIN expression {
$$ = parser->ast()->createNodeBinaryOperator(NODE_TYPE_OPERATOR_BINARY_NIN, $1, $3);
| expression T_NOT T_IN expression {
$$ = parser->ast()->createNodeBinaryOperator(NODE_TYPE_OPERATOR_BINARY_NIN, $1, $4);
}
| expression T_LIKE expression {
AstNode* arguments = parser->ast()->createNodeArray(2);
@ -1423,8 +1422,17 @@ operator_binary:
| expression quantifier T_IN expression {
$$ = parser->ast()->createNodeBinaryArrayOperator(NODE_TYPE_OPERATOR_BINARY_ARRAY_IN, $1, $4, $2);
}
| expression quantifier T_NIN expression {
$$ = parser->ast()->createNodeBinaryArrayOperator(NODE_TYPE_OPERATOR_BINARY_ARRAY_NIN, $1, $4, $2);
| expression T_ALL T_NOT T_IN expression {
auto quantifier = parser->ast()->createNodeQuantifier(Quantifier::ALL);
$$ = parser->ast()->createNodeBinaryArrayOperator(NODE_TYPE_OPERATOR_BINARY_ARRAY_NIN, $1, $5, quantifier);
}
| expression T_ANY T_NOT T_IN expression {
auto quantifier = parser->ast()->createNodeQuantifier(Quantifier::ANY);
$$ = parser->ast()->createNodeBinaryArrayOperator(NODE_TYPE_OPERATOR_BINARY_ARRAY_NIN, $1, $5, quantifier);
}
| expression T_NONE T_NOT T_IN expression {
auto quantifier = parser->ast()->createNodeQuantifier(Quantifier::NONE);
$$ = parser->ast()->createNodeBinaryArrayOperator(NODE_TYPE_OPERATOR_BINARY_ARRAY_NIN, $1, $5, quantifier);
}
;
@ -1757,8 +1765,7 @@ reference:
// now try special variables
if (ast->scopes()->canUseCurrentVariable() && strcmp($1.value, "CURRENT") == 0) {
variable = ast->scopes()->getCurrentVariable();
}
else if (strcmp($1.value, Variable::NAME_CURRENT) == 0) {
} else if (strcmp($1.value, Variable::NAME_CURRENT) == 0) {
variable = ast->scopes()->getCurrentVariable();
}
}

View File

@ -1,6 +1,7 @@
#line 17 "Aql/tokens.ll"
#line 16 "Aql/tokens.ll"
#include <stdint.h>
#if (_MSC_VER >= 1)
// fix ret_val = EOB_ACT_LAST_MATCH later on, its generated, we can't control this.
#pragma warning( disable : 4267)
#endif
@ -740,8 +741,8 @@ static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
#define YY_NUM_RULES 102
#define YY_END_OF_BUFFER 103
#define YY_NUM_RULES 99
#define YY_END_OF_BUFFER 100
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@ -749,39 +750,38 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static const flex_int16_t yy_accept[282] =
static const flex_int16_t yy_accept[275] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 103, 101, 88, 89,
44, 74, 101, 51, 101, 79, 57, 58, 49, 47,
56, 48, 101, 50, 84, 84, 54, 42, 43, 40,
52, 101, 63, 63, 63, 63, 63, 63, 63, 63,
63, 63, 63, 63, 63, 63, 63, 63, 61, 62,
101, 64, 59, 101, 60, 101, 68, 67, 68, 65,
73, 72, 73, 73, 83, 82, 80, 83, 78, 77,
75, 78, 92, 91, 95, 97, 96, 100, 99, 99,
100, 88, 38, 36, 63, 45, 55, 85, 93, 90,
0, 0, 84, 53, 41, 37, 35, 39, 86, 0,
0, 63, 63, 63, 63, 63, 63, 63, 63, 63,
63, 63, 63, 15, 63, 63, 63, 63, 63, 14,
63, 63, 63, 63, 63, 63, 63, 63, 0, 46,
69, 66, 71, 70, 81, 76, 92, 95, 94, 98,
85, 0, 85, 86, 87, 0, 86, 63, 29, 13,
28, 10, 63, 63, 63, 63, 63, 1, 63, 63,
63, 63, 63, 2, 63, 63, 63, 12, 63, 63,
0, 0, 0, 0, 100, 98, 88, 89, 44, 74,
98, 51, 98, 79, 57, 58, 49, 47, 56, 48,
98, 50, 84, 84, 54, 42, 43, 40, 52, 98,
63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
63, 87, 87, 86, 86, 63, 63, 11, 63, 63,
63, 63, 63, 63, 63, 63, 61, 62, 98, 64,
59, 98, 60, 98, 68, 67, 68, 65, 73, 72,
73, 73, 83, 82, 80, 83, 78, 77, 75, 78,
92, 91, 95, 97, 96, 88, 38, 36, 63, 45,
55, 85, 93, 90, 0, 0, 84, 53, 41, 37,
63, 63, 63, 63, 16, 63, 31, 63, 30, 32,
63, 63, 63, 63, 63, 6, 33, 63, 63, 17,
87, 87, 63, 63, 63, 34, 63, 23, 63, 63,
63, 7, 63, 63, 63, 63, 63, 63, 63, 63,
63, 63, 3, 63, 19, 63, 63, 18, 63, 4,
63, 20, 22, 63, 5, 63, 27, 63, 63, 21,
63, 63, 8, 63, 26, 63, 9, 63, 63, 63,
63, 63, 63, 63, 63, 63, 24, 63, 63, 25,
0
35, 39, 86, 0, 0, 63, 63, 63, 63, 63,
63, 63, 63, 63, 63, 63, 63, 15, 63, 63,
63, 63, 63, 14, 63, 63, 63, 63, 63, 63,
63, 63, 0, 46, 69, 66, 71, 70, 81, 76,
92, 95, 94, 85, 0, 85, 86, 87, 0, 86,
63, 29, 13, 28, 10, 63, 63, 63, 63, 63,
1, 63, 63, 63, 63, 63, 2, 63, 63, 63,
12, 63, 63, 63, 63, 63, 63, 63, 63, 63,
63, 63, 63, 63, 87, 87, 86, 86, 63, 63,
11, 63, 63, 63, 63, 63, 63, 16, 63, 31,
63, 30, 32, 63, 63, 63, 63, 63, 6, 33,
63, 63, 17, 87, 87, 63, 63, 63, 34, 63,
23, 63, 63, 63, 7, 63, 63, 63, 63, 63,
63, 63, 63, 63, 63, 3, 63, 19, 63, 63,
18, 63, 4, 63, 20, 22, 63, 5, 63, 27,
63, 63, 21, 63, 63, 8, 63, 26, 63, 9,
63, 63, 63, 63, 63, 63, 63, 63, 63, 24,
63, 63, 25, 0
} ;
static const YY_CHAR yy_ec[256] =
@ -829,165 +829,162 @@ static const YY_CHAR yy_meta[82] =
1
} ;
static const flex_int16_t yy_base[310] =
static const flex_int16_t yy_base[302] =
{ 0,
0, 0, 79, 80, 81, 84, 85, 86, 87, 88,
457, 456, 93, 94, 83, 105, 458, 621, 453, 621,
76, 621, 0, 621, 446, 621, 621, 621, 621, 621,
621, 621, 83, 92, 84, 94, 432, 427, 81, 397,
621, 91, 114, 0, 80, 92, 132, 79, 102, 358,
129, 104, 128, 98, 142, 119, 128, 130, 621, 621,
353, 621, 621, 323, 621, 317, 621, 621, 0, 621,
621, 621, 0, 283, 621, 621, 621, 0, 621, 621,
621, 0, 0, 621, 0, 621, 337, 621, 621, 621,
138, 343, 621, 621, 0, 621, 621, 171, 621, 621,
449, 448, 93, 94, 449, 602, 446, 602, 63, 602,
0, 602, 439, 602, 602, 602, 602, 602, 602, 602,
82, 87, 86, 91, 426, 423, 64, 422, 602, 87,
81, 0, 79, 92, 126, 86, 101, 390, 123, 119,
126, 118, 123, 127, 129, 127, 602, 602, 388, 602,
602, 362, 602, 358, 602, 602, 0, 602, 602, 602,
0, 326, 602, 602, 602, 0, 602, 602, 602, 0,
0, 602, 0, 602, 370, 382, 602, 602, 0, 602,
602, 164, 602, 602, 96, 159, 183, 602, 602, 602,
100, 192, 196, 621, 621, 621, 621, 621, 0, 249,
242, 0, 153, 142, 173, 167, 144, 150, 155, 179,
180, 176, 193, 195, 181, 184, 195, 193, 197, 0,
191, 208, 196, 198, 196, 213, 209, 253, 235, 621,
621, 621, 621, 621, 621, 621, 0, 0, 621, 621,
256, 259, 263, 0, 0, 175, 131, 215, 0, 0,
0, 0, 232, 257, 244, 246, 246, 0, 250, 252,
263, 255, 264, 0, 268, 265, 270, 0, 265, 276,
266, 270, 263, 267, 266, 274, 285, 282, 287, 0,
305, 0, 88, 75, 0, 300, 308, 0, 307, 312,
602, 602, 0, 298, 236, 0, 143, 136, 158, 151,
155, 161, 162, 171, 172, 168, 185, 185, 173, 173,
182, 182, 186, 0, 180, 208, 187, 188, 189, 229,
194, 241, 173, 602, 602, 602, 602, 602, 602, 602,
0, 0, 602, 244, 248, 250, 0, 0, 106, 75,
222, 0, 0, 0, 0, 233, 186, 227, 234, 234,
0, 239, 241, 245, 242, 250, 0, 254, 251, 257,
0, 252, 263, 252, 257, 250, 254, 256, 271, 280,
280, 281, 0, 306, 0, 73, 71, 0, 287, 290,
0, 292, 298, 301, 299, 285, 293, 0, 296, 0,
313, 311, 301, 305, 0, 309, 0, 306, 0, 0,
311, 306, 327, 313, 312, 0, 0, 315, 318, 0,
73, 0, 329, 334, 325, 0, 323, 0, 328, 324,
333, 0, 335, 354, 357, 349, 363, 366, 354, 373,
357, 375, 0, 375, 0, 362, 369, 0, 379, 0,
368, 0, 0, 370, 0, 372, 0, 387, 389, 0,
376, 392, 0, 383, 0, 71, 0, 385, 389, 63,
397, 393, 392, 413, 407, 398, 0, 411, 405, 0,
621, 475, 482, 489, 496, 503, 510, 517, 105, 521,
525, 527, 534, 541, 548, 555, 562, 569, 573, 577,
293, 0, 0, 299, 294, 307, 299, 299, 0, 0,
300, 304, 0, 65, 0, 315, 321, 312, 0, 310,
0, 314, 311, 323, 0, 324, 342, 346, 337, 351,
353, 341, 360, 344, 361, 0, 361, 0, 349, 355,
0, 361, 0, 352, 0, 0, 353, 0, 354, 0,
369, 372, 0, 360, 375, 0, 364, 0, 59, 0,
364, 369, 56, 387, 375, 379, 400, 395, 386, 0,
399, 393, 0, 602, 463, 470, 477, 484, 491, 498,
97, 502, 506, 508, 515, 522, 529, 536, 543, 550,
554, 558, 562, 566, 570, 574, 578, 582, 586, 590,
581, 585, 589, 593, 597, 601, 605, 609, 613
594
} ;
static const flex_int16_t yy_def[310] =
static const flex_int16_t yy_def[302] =
{ 0,
281, 1, 282, 282, 283, 283, 284, 284, 285, 285,
286, 286, 287, 287, 288, 288, 281, 281, 281, 281,
281, 281, 289, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 290, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 281, 281,
292, 281, 281, 281, 281, 281, 281, 281, 293, 281,
281, 281, 294, 281, 281, 281, 281, 295, 281, 281,
281, 296, 297, 281, 298, 281, 281, 281, 281, 281,
281, 281, 281, 281, 291, 281, 281, 281, 281, 281,
274, 1, 275, 275, 276, 276, 277, 277, 278, 278,
279, 279, 280, 280, 274, 274, 274, 274, 274, 274,
281, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 282,
283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
283, 283, 283, 283, 283, 283, 274, 274, 284, 274,
274, 274, 274, 274, 274, 274, 285, 274, 274, 274,
286, 274, 274, 274, 274, 287, 274, 274, 274, 288,
289, 274, 290, 274, 274, 274, 274, 274, 283, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
281, 281, 281, 281, 281, 281, 281, 281, 299, 300,
301, 291, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 302, 292, 281,
281, 281, 281, 281, 281, 281, 297, 298, 281, 281,
281, 281, 281, 299, 303, 304, 305, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 291, 306,
302, 303, 307, 305, 308, 291, 291, 291, 291, 291,
274, 274, 291, 292, 293, 283, 283, 283, 283, 283,
283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
283, 294, 284, 274, 274, 274, 274, 274, 274, 274,
289, 290, 274, 274, 274, 274, 291, 295, 296, 297,
283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
283, 283, 298, 294, 295, 299, 297, 300, 283, 283,
283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
307, 309, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
0, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
283, 283, 283, 299, 301, 283, 283, 283, 283, 283,
283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
283, 283, 283, 0, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
281, 281, 281, 281, 281, 281, 281, 281, 281
274
} ;
static const flex_int16_t yy_nxt[703] =
static const flex_int16_t yy_nxt[684] =
{ 0,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 44,
47, 48, 44, 49, 44, 50, 51, 44, 52, 53,
44, 54, 55, 56, 57, 44, 58, 44, 59, 18,
60, 61, 62, 43, 44, 45, 46, 44, 47, 48,
44, 49, 50, 51, 44, 52, 53, 44, 54, 55,
56, 57, 44, 58, 44, 63, 64, 65, 18, 18,
66, 68, 68, 72, 89, 90, 72, 76, 76, 80,
80, 81, 81, 77, 77, 86, 86, 93, 97, 101,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 42,
45, 46, 42, 47, 42, 48, 49, 42, 50, 51,
42, 52, 53, 54, 55, 42, 56, 42, 57, 16,
58, 59, 60, 41, 42, 43, 44, 42, 45, 46,
42, 47, 48, 49, 42, 50, 51, 42, 52, 53,
54, 55, 42, 56, 42, 61, 62, 63, 16, 16,
64, 66, 66, 70, 87, 100, 70, 74, 74, 78,
78, 79, 79, 75, 75, 84, 84, 91, 93, 92,
98, 98, 106, 99, 87, 87, 89, 90, 100, 101,
95, 103, 103, 102, 272, 110, 91, 151, 151, 117,
123, 118, 269, 102, 222, 119, 195, 132, 69, 69,
73, 70, 70, 73, 78, 78, 82, 82, 91, 222,
124, 102, 111, 128, 91, 113, 117, 123, 129, 118,
114, 102, 115, 119, 94, 132, 116, 120, 126, 107,
135, 74, 127, 137, 74, 121, 91, 124, 136, 130,
128, 122, 131, 113, 133, 129, 150, 114, 159, 115,
163, 134, 195, 116, 158, 120, 126, 135, 98, 98,
127, 137, 164, 121, 162, 136, 130, 165, 122, 131,
92, 95, 89, 94, 85, 85, 95, 265, 97, 97,
262, 104, 107, 144, 144, 96, 215, 108, 111, 109,
96, 112, 188, 110, 215, 113, 188, 117, 67, 67,
71, 68, 68, 71, 76, 76, 80, 80, 105, 118,
107, 88, 101, 96, 108, 111, 109, 126, 96, 112,
110, 114, 120, 113, 117, 127, 121, 149, 122, 115,
131, 72, 128, 123, 72, 116, 118, 124, 129, 130,
125, 145, 152, 145, 151, 126, 146, 146, 155, 114,
120, 92, 92, 127, 121, 122, 153, 115, 131, 128,
123, 156, 116, 96, 124, 129, 130, 125, 95, 152,
102, 160, 133, 150, 152, 159, 152, 163, 134, 153,
153, 101, 158, 103, 103, 166, 167, 168, 169, 164,
161, 170, 162, 173, 165, 102, 156, 174, 102, 160,
175, 177, 176, 179, 180, 184, 178, 171, 172, 185,
186, 187, 166, 167, 168, 181, 169, 161, 182, 170,
173, 183, 189, 102, 174, 188, 196, 175, 177, 176,
179, 180, 184, 178, 171, 172, 185, 186, 197, 187,
190, 190, 181, 151, 151, 182, 153, 153, 183, 189,
153, 153, 188, 196, 198, 102, 139, 199, 200, 201,
202, 203, 204, 111, 205, 197, 206, 207, 208, 209,
97, 97, 151, 157, 158, 154, 155, 159, 160, 161,
162, 163, 96, 191, 153, 166, 167, 168, 156, 169,
170, 96, 172, 173, 133, 171, 177, 164, 165, 178,
157, 158, 154, 179, 159, 160, 161, 182, 162, 163,
96, 191, 166, 167, 168, 174, 169, 170, 175, 172,
173, 176, 171, 177, 164, 165, 178, 180, 183, 183,
179, 144, 144, 189, 182, 146, 146, 146, 146, 190,
192, 181, 174, 96, 197, 175, 193, 194, 176, 195,
196, 198, 199, 200, 201, 180, 202, 105, 203, 204,
189, 205, 183, 206, 207, 208, 190, 192, 181, 209,
156, 210, 211, 217, 190, 212, 213, 214, 215, 216,
218, 219, 198, 102, 199, 200, 201, 202, 203, 220,
204, 205, 190, 190, 206, 207, 208, 209, 210, 223,
211, 217, 212, 213, 214, 215, 216, 224, 218, 219,
225, 226, 227, 228, 92, 229, 230, 220, 231, 232,
233, 234, 235, 149, 236, 237, 190, 223, 238, 239,
240, 241, 144, 242, 243, 224, 244, 245, 225, 226,
227, 228, 229, 230, 246, 231, 232, 233, 234, 247,
235, 236, 237, 248, 249, 238, 239, 250, 240, 241,
242, 243, 251, 244, 245, 252, 141, 253, 254, 140,
210, 96, 197, 193, 194, 211, 195, 196, 198, 212,
199, 200, 201, 213, 202, 203, 216, 204, 205, 217,
206, 207, 208, 183, 183, 218, 209, 219, 210, 222,
220, 221, 228, 211, 223, 224, 225, 212, 226, 227,
229, 213, 230, 231, 216, 232, 233, 217, 234, 149,
235, 236, 237, 218, 238, 219, 222, 183, 220, 221,
228, 223, 224, 225, 239, 226, 227, 229, 240, 230,
231, 241, 232, 242, 233, 243, 234, 235, 236, 237,
244, 238, 245, 86, 246, 247, 143, 248, 249, 250,
253, 239, 251, 252, 254, 240, 255, 256, 257, 241,
255, 246, 256, 257, 139, 258, 247, 259, 260, 125,
261, 248, 249, 262, 250, 263, 264, 265, 108, 266,
251, 267, 273, 252, 253, 268, 254, 255, 270, 271,
256, 257, 258, 274, 259, 275, 260, 261, 276, 277,
262, 278, 263, 279, 264, 265, 266, 280, 105, 267,
273, 104, 268, 96, 92, 270, 271, 281, 84, 84,
274, 281, 275, 281, 281, 281, 276, 277, 278, 281,
281, 279, 281, 281, 280, 67, 67, 67, 67, 67,
67, 67, 71, 71, 71, 71, 71, 71, 71, 75,
75, 75, 75, 75, 75, 75, 79, 79, 79, 79,
258, 242, 243, 259, 260, 138, 261, 263, 244, 264,
245, 246, 266, 247, 248, 267, 249, 250, 253, 251,
252, 254, 268, 255, 256, 269, 257, 270, 258, 271,
259, 272, 260, 261, 263, 273, 264, 135, 134, 133,
266, 119, 267, 102, 99, 98, 90, 86, 274, 268,
82, 82, 274, 269, 274, 270, 271, 274, 274, 272,
274, 274, 273, 65, 65, 65, 65, 65, 65, 65,
69, 69, 69, 69, 69, 69, 69, 73, 73, 73,
73, 73, 73, 73, 77, 77, 77, 77, 77, 77,
77, 81, 81, 81, 81, 81, 81, 81, 83, 83,
79, 79, 79, 83, 83, 83, 83, 83, 83, 83,
85, 85, 85, 85, 85, 85, 85, 88, 88, 88,
88, 88, 88, 88, 109, 109, 109, 109, 112, 281,
112, 112, 138, 138, 142, 281, 142, 142, 142, 142,
142, 143, 281, 143, 143, 143, 143, 143, 145, 281,
145, 145, 145, 145, 145, 146, 281, 146, 146, 146,
146, 146, 147, 281, 147, 147, 147, 147, 147, 148,
281, 281, 148, 148, 148, 148, 154, 281, 154, 154,
155, 281, 155, 155, 157, 281, 157, 157, 191, 281,
191, 191, 192, 281, 192, 192, 193, 281, 193, 193,
83, 83, 83, 83, 83, 103, 103, 103, 103, 106,
274, 106, 106, 132, 132, 136, 274, 136, 136, 136,
136, 136, 137, 274, 137, 137, 137, 137, 137, 139,
274, 139, 139, 139, 139, 139, 140, 274, 140, 140,
140, 140, 140, 141, 274, 141, 141, 141, 141, 141,
142, 274, 274, 142, 142, 142, 142, 147, 274, 147,
147, 148, 274, 148, 148, 150, 274, 150, 150, 184,
274, 184, 184, 185, 274, 185, 185, 186, 274, 186,
186, 187, 274, 187, 187, 183, 274, 183, 183, 214,
274, 214, 214, 188, 274, 188, 188, 215, 274, 215,
194, 281, 194, 194, 190, 281, 190, 190, 221, 281,
221, 221, 195, 281, 195, 195, 222, 281, 222, 222,
17, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281
215, 15, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274
} ;
static const flex_int16_t yy_chk[703] =
static const flex_int16_t yy_chk[684] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@ -997,88 +994,85 @@ static const flex_int16_t yy_chk[703] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 3, 4, 5, 15, 15, 6, 7, 8, 9,
10, 9, 10, 7, 8, 13, 14, 21, 33, 35,
1, 3, 4, 5, 19, 37, 6, 7, 8, 9,
10, 9, 10, 7, 8, 13, 14, 31, 32, 31,
33, 33, 39, 34, 13, 14, 16, 16, 34, 36,
289, 36, 36, 35, 270, 42, 15, 101, 101, 45,
48, 46, 266, 36, 221, 46, 194, 54, 3, 4,
5, 3, 4, 6, 7, 8, 9, 10, 16, 193,
49, 35, 42, 52, 15, 43, 45, 48, 52, 46,
43, 36, 43, 46, 21, 54, 43, 47, 51, 39,
56, 5, 51, 58, 6, 47, 16, 49, 57, 53,
52, 47, 53, 43, 55, 52, 91, 43, 114, 43,
117, 55, 157, 43, 113, 47, 51, 56, 98, 98,
51, 58, 118, 47, 116, 57, 53, 119, 47, 53,
31, 33, 281, 32, 13, 14, 34, 263, 34, 34,
259, 40, 41, 95, 95, 33, 214, 41, 43, 41,
34, 44, 187, 41, 186, 44, 150, 46, 3, 4,
5, 3, 4, 6, 7, 8, 9, 10, 40, 47,
41, 19, 37, 33, 41, 43, 41, 52, 34, 44,
41, 45, 49, 44, 46, 53, 49, 149, 50, 45,
56, 5, 53, 50, 6, 45, 47, 51, 54, 55,
51, 96, 108, 96, 107, 52, 96, 96, 110, 45,
49, 92, 92, 53, 49, 50, 109, 45, 56, 53,
50, 111, 45, 92, 51, 54, 55, 51, 97, 108,
98, 115, 55, 91, 102, 114, 102, 117, 55, 102,
102, 103, 113, 103, 103, 120, 121, 122, 123, 118,
115, 124, 116, 125, 119, 103, 156, 126, 98, 115,
127, 128, 127, 129, 131, 133, 128, 124, 124, 134,
135, 136, 120, 121, 122, 132, 123, 115, 132, 124,
125, 132, 137, 103, 126, 136, 158, 127, 128, 127,
129, 131, 133, 128, 124, 124, 134, 135, 163, 136,
138, 138, 132, 151, 151, 132, 152, 152, 132, 137,
153, 153, 136, 158, 164, 151, 139, 165, 166, 167,
169, 170, 171, 111, 172, 163, 173, 175, 176, 177,
97, 97, 107, 112, 113, 109, 110, 114, 115, 116,
117, 118, 97, 157, 109, 119, 120, 121, 111, 121,
122, 92, 123, 125, 133, 122, 127, 118, 118, 128,
112, 113, 109, 129, 114, 115, 116, 131, 117, 118,
97, 157, 119, 120, 121, 126, 121, 122, 126, 123,
125, 126, 122, 127, 118, 118, 128, 130, 132, 132,
129, 144, 144, 151, 131, 145, 145, 146, 146, 156,
158, 130, 126, 144, 164, 126, 159, 160, 126, 162,
163, 165, 166, 168, 169, 130, 170, 105, 172, 173,
151, 174, 132, 175, 176, 177, 156, 158, 130, 178,
110, 179, 180, 186, 138, 181, 182, 183, 184, 185,
187, 188, 164, 151, 165, 166, 167, 169, 170, 189,
171, 172, 191, 191, 173, 175, 176, 177, 179, 196,
180, 186, 181, 182, 183, 184, 185, 197, 187, 188,
199, 200, 201, 202, 92, 203, 204, 189, 206, 208,
211, 212, 213, 87, 214, 215, 191, 196, 218, 219,
223, 224, 74, 225, 227, 197, 229, 230, 199, 200,
201, 202, 203, 204, 231, 206, 208, 211, 212, 233,
213, 214, 215, 234, 235, 218, 219, 236, 223, 224,
225, 227, 237, 229, 230, 238, 66, 239, 240, 64,
179, 144, 164, 159, 160, 180, 162, 163, 165, 181,
166, 168, 169, 182, 170, 172, 189, 173, 174, 190,
175, 176, 177, 184, 184, 192, 178, 193, 179, 196,
194, 195, 206, 180, 197, 199, 201, 181, 204, 205,
207, 182, 208, 211, 189, 212, 216, 190, 217, 104,
218, 220, 222, 192, 223, 193, 196, 184, 194, 195,
206, 197, 199, 201, 224, 204, 205, 207, 226, 208,
211, 227, 212, 228, 216, 229, 217, 218, 220, 222,
230, 223, 231, 86, 232, 233, 85, 234, 235, 237,
242, 224, 239, 240, 244, 226, 247, 249, 251, 227,
241, 231, 242, 244, 61, 246, 233, 247, 249, 50,
251, 234, 235, 254, 236, 256, 258, 259, 40, 261,
237, 262, 271, 238, 239, 264, 240, 241, 268, 269,
242, 244, 246, 272, 247, 273, 249, 251, 274, 275,
254, 276, 256, 278, 258, 259, 261, 279, 38, 262,
271, 37, 264, 25, 19, 268, 269, 17, 12, 11,
272, 0, 273, 0, 0, 0, 274, 275, 276, 0,
0, 278, 0, 0, 279, 282, 282, 282, 282, 282,
282, 282, 283, 283, 283, 283, 283, 283, 283, 284,
284, 284, 284, 284, 284, 284, 285, 285, 285, 285,
252, 228, 229, 254, 255, 72, 257, 261, 230, 262,
231, 232, 264, 233, 234, 265, 235, 237, 242, 239,
240, 244, 266, 247, 249, 267, 251, 268, 252, 269,
254, 271, 255, 257, 261, 272, 262, 64, 62, 59,
264, 48, 265, 38, 36, 35, 23, 17, 15, 266,
12, 11, 0, 267, 0, 268, 269, 0, 0, 271,
0, 0, 272, 275, 275, 275, 275, 275, 275, 275,
276, 276, 276, 276, 276, 276, 276, 277, 277, 277,
277, 277, 277, 277, 278, 278, 278, 278, 278, 278,
278, 279, 279, 279, 279, 279, 279, 279, 280, 280,
285, 285, 285, 286, 286, 286, 286, 286, 286, 286,
287, 287, 287, 287, 287, 287, 287, 288, 288, 288,
288, 288, 288, 288, 290, 290, 290, 290, 291, 0,
291, 291, 292, 292, 293, 0, 293, 293, 293, 293,
293, 294, 0, 294, 294, 294, 294, 294, 295, 0,
295, 295, 295, 295, 295, 296, 0, 296, 296, 296,
296, 296, 297, 0, 297, 297, 297, 297, 297, 298,
0, 0, 298, 298, 298, 298, 299, 0, 299, 299,
300, 0, 300, 300, 301, 0, 301, 301, 302, 0,
302, 302, 303, 0, 303, 303, 304, 0, 304, 304,
280, 280, 280, 280, 280, 282, 282, 282, 282, 283,
0, 283, 283, 284, 284, 285, 0, 285, 285, 285,
285, 285, 286, 0, 286, 286, 286, 286, 286, 287,
0, 287, 287, 287, 287, 287, 288, 0, 288, 288,
288, 288, 288, 289, 0, 289, 289, 289, 289, 289,
290, 0, 0, 290, 290, 290, 290, 291, 0, 291,
291, 292, 0, 292, 292, 293, 0, 293, 293, 294,
0, 294, 294, 295, 0, 295, 295, 296, 0, 296,
296, 297, 0, 297, 297, 298, 0, 298, 298, 299,
0, 299, 299, 300, 0, 300, 300, 301, 0, 301,
305, 0, 305, 305, 306, 0, 306, 306, 307, 0,
307, 307, 308, 0, 308, 308, 309, 0, 309, 309,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
281, 281
301, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274, 274, 274, 274, 274, 274, 274, 274,
274, 274, 274
} ;
/* Table of booleans, true if rule could match eol. */
static const flex_int32_t yy_rule_can_match_eol[103] =
static const flex_int32_t yy_rule_can_match_eol[100] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1,
0, 0, 0, };
0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0,
};
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
@ -1094,7 +1088,6 @@ static const flex_int32_t yy_rule_can_match_eol[103] =
#include "Basics/Common.h"
#include "Basics/conversions.h"
#include "Basics/NumberUtils.h"
@ -1145,7 +1138,6 @@ class Parser;
#define DOUBLE_QUOTE 4
#define COMMENT_SINGLE 5
#define COMMENT_MULTI 6
#define NOT 7
@ -1578,13 +1570,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 282 )
if ( yy_current_state >= 275 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
while ( yy_current_state != 281 );
while ( yy_current_state != 274 );
yy_cp = yyg->yy_last_accepting_cpos;
yy_current_state = yyg->yy_last_accepting_state;
@ -1688,7 +1680,7 @@ YY_RULE_SETUP
case 12:
YY_RULE_SETUP
{
BEGIN(NOT);
return T_NOT;
}
YY_BREAK
case 13:
@ -2317,51 +2309,14 @@ YY_RULE_SETUP
yycolumn = 0;
}
YY_BREAK
/* ---------------------------------------------------------------------------
* special transformation for NOT IN to T_NIN
* --------------------------------------------------------------------------- */
case 98:
YY_RULE_SETUP
{
/* T_NOT + T_IN => T_NIN */
BEGIN(INITIAL);
return T_NIN;
}
YY_BREAK
case 99:
/* rule 99 can match eol */
YY_RULE_SETUP
{
/* ignore whitespace */
}
YY_BREAK
case 100:
YY_RULE_SETUP
{
/* found something different to T_IN */
/* now push the character back into the input stream and return a T_NOT token */
BEGIN(INITIAL);
yyless(0);
/* must decrement offset by one character as we're pushing the char back onto the stack */
yyextra->decreaseOffset(1);
return T_NOT;
}
YY_BREAK
case YY_STATE_EOF(NOT):
{
/* make sure that we still return a T_NOT when we reach the end of the input */
BEGIN(INITIAL);
return T_NOT;
}
YY_BREAK
case 101:
YY_RULE_SETUP
{
/* anything else is returned as it is */
return (int) yytext[0];
}
YY_BREAK
case 102:
case 99:
YY_RULE_SETUP
ECHO;
YY_BREAK
@ -2675,7 +2630,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 282 )
if ( yy_current_state >= 275 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
@ -2705,11 +2660,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 282 )
if ( yy_current_state >= 275 )
yy_c = yy_meta[yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
yy_is_jam = (yy_current_state == 281);
yy_is_jam = (yy_current_state == 274);
(void)yyg;
return yy_is_jam ? 0 : yy_current_state;

View File

@ -11,7 +11,6 @@
%x DOUBLE_QUOTE
%x COMMENT_SINGLE
%x COMMENT_MULTI
%x NOT
%top{
#include <stdint.h>
@ -115,7 +114,7 @@ class Parser;
}
(?i:NOT) {
BEGIN(NOT);
return T_NOT;
}
(?i:AND) {
@ -578,37 +577,6 @@ class Parser;
yycolumn = 0;
}
/* ---------------------------------------------------------------------------
* special transformation for NOT IN to T_NIN
* --------------------------------------------------------------------------- */
<NOT>(?i:IN) {
/* T_NOT + T_IN => T_NIN */
BEGIN(INITIAL);
return T_NIN;
}
<NOT>[\r\t\n ] {
/* ignore whitespace */
}
<NOT>. {
/* found something different to T_IN */
/* now push the character back into the input stream and return a T_NOT token */
BEGIN(INITIAL);
yyless(0);
/* must decrement offset by one character as we're pushing the char back onto the stack */
yyextra->decreaseOffset(1);
return T_NOT;
}
<NOT><<EOF>> {
/* make sure that we still return a T_NOT when we reach the end of the input */
BEGIN(INITIAL);
return T_NOT;
}
. {
/* anything else is returned as it is */
return (int) yytext[0];

View File

@ -1,5 +1,5 @@
/*jshint globalstrict:false, strict:false, maxlen: 7000 */
/*global assertEqual, assertTrue, assertMatch, fail, AQL_EXECUTE */
/*global assertEqual, assertTrue, assertMatch, fail, AQL_EXECUTE, AQL_PARSE */
////////////////////////////////////////////////////////////////////////////////
/// @brief tests for query language, PARSE function
@ -351,6 +351,83 @@ function ahuacatlParseTestSuite () {
assertEqual(query[1][1], column);
}
});
},
testPrecedenceOfNotIn : function() {
let result = AQL_PARSE("RETURN 3..4 NOT IN 1..2").ast;
assertEqual("root", result[0].type);
result = result[0].subNodes;
assertEqual("return", result[0].type);
result = result[0].subNodes;
assertEqual("compare not in", result[0].type);
let sub = result[0].subNodes;
assertEqual("range", sub[0].type);
assertEqual("value", sub[0].subNodes[0].type);
assertEqual(3, sub[0].subNodes[0].value);
assertEqual("value", sub[0].subNodes[1].type);
assertEqual(4, sub[0].subNodes[1].value);
assertEqual("range", sub[1].type);
assertEqual("value", sub[1].subNodes[0].type);
assertEqual(1, sub[1].subNodes[0].value);
assertEqual("value", sub[1].subNodes[1].type);
assertEqual(2, sub[1].subNodes[1].value);
result = AQL_PARSE("RETURN 3..(4 NOT IN 1)..2").ast;
assertEqual("root", result[0].type);
result = result[0].subNodes;
assertEqual("return", result[0].type);
result = result[0].subNodes;
assertEqual("range", result[0].type);
sub = result[0].subNodes;
assertEqual("range", sub[0].type);
assertEqual("value", sub[0].subNodes[0].type);
assertEqual(3, sub[0].subNodes[0].value);
assertEqual("compare not in", sub[0].subNodes[1].type);
assertEqual("value", sub[0].subNodes[1].subNodes[0].type);
assertEqual(4, sub[0].subNodes[1].subNodes[0].value);
assertEqual("value", sub[0].subNodes[1].subNodes[1].type);
assertEqual(1, sub[0].subNodes[1].subNodes[1].value);
assertEqual("value", sub[1].type);
assertEqual(2, sub[1].value);
},
testPrecedenceOfNestedNotIn : function() {
let result = AQL_PARSE("RETURN 3..4 NOT IN 1..2 NOT IN 7..8").ast;
assertEqual("root", result[0].type);
result = result[0].subNodes;
assertEqual("return", result[0].type);
result = result[0].subNodes;
assertEqual("compare not in", result[0].type);
let sub = result[0].subNodes;
assertEqual("compare not in", sub[0].type);
assertEqual("range", sub[0].subNodes[0].type);
assertEqual("value", sub[0].subNodes[0].subNodes[0].type);
assertEqual(3, sub[0].subNodes[0].subNodes[0].value);
assertEqual("value", sub[0].subNodes[0].subNodes[1].type);
assertEqual(4, sub[0].subNodes[0].subNodes[1].value);
assertEqual("range", sub[0].subNodes[1].type);
assertEqual("value", sub[0].subNodes[1].subNodes[0].type);
assertEqual(1, sub[0].subNodes[1].subNodes[0].value);
assertEqual("value", sub[0].subNodes[1].subNodes[1].type);
assertEqual(2, sub[0].subNodes[1].subNodes[1].value);
assertEqual("range", sub[1].type);
assertEqual("value", sub[1].subNodes[0].type);
assertEqual(7, sub[1].subNodes[0].value);
assertEqual("value", sub[1].subNodes[1].type);
assertEqual(8, sub[1].subNodes[1].value);
}
};