diff --git a/builtin.c b/builtin.c index 657a7a1f..756b069d 100644 --- a/builtin.c +++ b/builtin.c @@ -161,6 +161,21 @@ static void f_greatereq(jv input[], jv output[]) { order_cmp(input, output, CMP_OP_GREATEREQ); } +static void f_contains(jv input[], jv output[]) { + jv_free(input[0]); + jv a = input[2]; + jv b = input[1]; + jv_kind akind = jv_get_kind(a); + + if (akind == jv_get_kind(b)) { + output[0] = jv_bool(jv_contains(a, b)); + } else { + output[0] = jv_invalid_with_msg(jv_string_fmt("Can only check containment of values of the same type.")); + jv_free(a); + jv_free(b); + } +} + static void f_tonumber(jv input[], jv output[]) { if (jv_get_kind(input[0]) == JV_KIND_NUMBER) { output[0] = input[0]; @@ -265,6 +280,7 @@ static struct cfunction function_list[] = { {f_greater, "_greater", CALL_BUILTIN_3_1}, {f_lesseq, "_lesseq", CALL_BUILTIN_3_1}, {f_greatereq, "_greatereq", CALL_BUILTIN_3_1}, + {f_contains, "_contains", CALL_BUILTIN_3_1}, {f_length, "length", CALL_BUILTIN_1_1}, {f_type, "type", CALL_BUILTIN_1_1}, {f_add, "add", CALL_BUILTIN_1_1}, diff --git a/docs/content/3.manual/manual.yml b/docs/content/3.manual/manual.yml index 6c107700..437afdff 100644 --- a/docs/content/3.manual/manual.yml +++ b/docs/content/3.manual/manual.yml @@ -522,7 +522,33 @@ sections: - program: '.[] == 1' input: '[1, 1.0, "1", "banana"]' output: ['[true, true, false, false]'] - + - title: `contains` + body: | + + The expression 'a contains b' will produce true if b is completely + contained within a. A string B is contained in a string A if B is a + substring of A. An array B is contained in an array A is all elements + in B are contained in any element in A. An object B is contained in + object A if all of the values in B are contained in the value in A with + the same key. All other types are assumed to be contained in each other + if they are equal. + + examples: + - program: '. == contains "bar"' + input: '"foobar"' + output: ['true'] + - program: '. contains ["baz", "bar"]' + input: '["foobar", "foobaz", "blarp"]' + output: ['true'] + - program: '. contains ["bazzzzz", "bar"]' + input: '["foobar", "foobaz", "blarp"]' + output: ['false'] + - program: '. contains {foo: 12, bar: [{barp: 12}]}' + input: '{foo: 12, bar:[1,2,{barp:12, blip:13}]}' + output: ['true'] + - program: '. contains {foo: 12, bar: [{barp: 15}]}' + input: '{foo: 12, bar:[1,2,{barp:12, blip:13}]}' + output: ['false'] - title: if-then-else body: | diff --git a/jv.c b/jv.c index 2d91366b..77937a8d 100644 --- a/jv.c +++ b/jv.c @@ -329,6 +329,28 @@ jv jv_array_slice(jv a, int start, int end) { return a; } +int jv_array_contains(jv a, jv b) { + int r = 1; + int a_length = jv_array_length(jv_copy(a)); + int b_length = jv_array_length(jv_copy(b)); + for (int bi = 0; bi < b_length; bi++) { + int ri = 0; + for (int ai = 0; ai < a_length; ai++) { + if (jv_contains(jv_array_get(jv_copy(a), ai), jv_array_get(jv_copy(b), bi))) { + ri = 1; + break; + } + } + if (!ri) { + r = 0; + break; + } + } + jv_free(a); + jv_free(b); + return r; +} + /* * Strings (internal helpers) @@ -863,6 +885,27 @@ jv jv_object_merge(jv a, jv b) { return a; } +int jv_object_contains(jv a, jv b) { + assert(jv_get_kind(a) == JV_KIND_OBJECT); + assert(jv_get_kind(b) == JV_KIND_OBJECT); + int r = 1; + + jv_object_foreach(i, b) { + jv key = jv_object_iter_key(b, i); + jv a_val = jv_object_get(jv_copy(a), jv_copy(key)); + jv b_val = jv_object_get(jv_copy(b), jv_copy(key)); + + r = jv_contains(a_val, b_val); + jv_free(key); + + if (!r) break; + } + + jv_free(a); + jv_free(b); + return r; +} + /* * Object iteration (internal helpers) */ @@ -977,3 +1020,21 @@ int jv_equal(jv a, jv b) { jv_free(b); return r; } + +int jv_contains(jv a, jv b) { + int r = 1; + if (jv_get_kind(a) != jv_get_kind(b)) { + r = 0; + } else if (jv_get_kind(a) == JV_KIND_OBJECT) { + r = jv_object_contains(jv_copy(a), jv_copy(b)); + } else if (jv_get_kind(a) == JV_KIND_ARRAY) { + r = jv_array_contains(jv_copy(a), jv_copy(b)); + } else if (jv_get_kind(a) == JV_KIND_STRING) { + r = strstr(jv_string_value(a), jv_string_value(b)) != 0; + } else { + r = jv_equal(jv_copy(a), jv_copy(b)); + } + jv_free(a); + jv_free(b); + return r; +} \ No newline at end of file diff --git a/jv.h b/jv.h index c81b2e24..02817681 100644 --- a/jv.h +++ b/jv.h @@ -48,6 +48,7 @@ jv jv_copy(jv); void jv_free(jv); int jv_equal(jv, jv); +int jv_contains(jv, jv); jv jv_invalid(); jv jv_invalid_with_msg(jv); diff --git a/lexer.gen.c b/lexer.gen.c index c78730e3..250fc430 100644 --- a/lexer.gen.c +++ b/lexer.gen.c @@ -358,8 +358,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 35 -#define YY_END_OF_BUFFER 36 +#define YY_NUM_RULES 36 +#define YY_END_OF_BUFFER 37 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -367,17 +367,19 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[88] = +static yyconst flex_int16_t yy_accept[96] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 36, 34, 33, 33, 34, 26, 1, 22, - 23, 24, 22, 22, 22, 22, 22, 25, 22, 22, - 22, 32, 32, 32, 32, 32, 32, 32, 22, 30, - 30, 28, 31, 33, 2, 1, 17, 15, 25, 16, - 0, 13, 18, 20, 3, 21, 32, 32, 4, 32, - 32, 32, 6, 11, 32, 14, 30, 29, 27, 29, - 0, 25, 19, 10, 5, 32, 32, 12, 32, 0, - 29, 9, 8, 7, 29, 29, 0 + 0, 0, 37, 35, 34, 34, 35, 27, 1, 23, + 24, 25, 23, 23, 23, 23, 23, 26, 23, 23, + 23, 33, 33, 33, 33, 33, 33, 33, 33, 23, + 31, 31, 29, 32, 34, 2, 1, 17, 15, 26, + 16, 0, 13, 18, 20, 3, 21, 33, 33, 4, + 33, 33, 33, 33, 6, 11, 33, 14, 31, 30, + 28, 30, 0, 26, 19, 10, 33, 5, 33, 33, + 12, 33, 0, 30, 33, 9, 8, 7, 30, 33, + 30, 33, 33, 22, 0 + } ; static yyconst flex_int32_t yy_ec[256] = @@ -391,11 +393,11 @@ static yyconst flex_int32_t yy_ec[256] = 21, 22, 1, 1, 23, 23, 23, 23, 24, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 25, 26, 27, 1, 28, 1, 29, 23, 23, 30, + 25, 26, 27, 1, 28, 1, 29, 23, 30, 31, - 31, 32, 23, 33, 34, 23, 23, 35, 23, 36, - 37, 23, 23, 38, 39, 40, 41, 23, 23, 23, - 23, 23, 42, 43, 44, 1, 1, 1, 1, 1, + 32, 33, 23, 34, 35, 23, 23, 36, 23, 37, + 38, 23, 23, 39, 40, 41, 42, 23, 23, 23, + 23, 23, 43, 44, 45, 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, 1, 1, 1, 1, @@ -412,91 +414,97 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[45] = +static yyconst flex_int32_t yy_meta[46] = { 0, 1, 1, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 4, 4, 1, 5, 1, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 1, 1, 1 + 4, 4, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[97] = +static yyconst flex_int16_t yy_base[105] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 42, 43, 144, 145, 48, 50, 122, 145, 0, 145, - 145, 145, 121, 120, 39, 40, 42, 50, 119, 118, - 117, 0, 23, 91, 37, 88, 78, 77, 80, 0, - 0, 145, 38, 73, 145, 0, 145, 145, 63, 145, - 71, 79, 145, 145, 145, 145, 0, 69, 0, 66, - 27, 67, 0, 0, 65, 145, 0, 69, 145, 67, - 75, 74, 145, 0, 0, 58, 58, 0, 50, 61, - 58, 0, 0, 0, 56, 51, 145, 102, 108, 111, - 117, 123, 126, 128, 130, 132 + 43, 44, 152, 153, 49, 51, 130, 153, 0, 153, + 153, 153, 129, 128, 40, 41, 43, 51, 127, 126, + 125, 0, 23, 107, 112, 35, 110, 88, 91, 100, + 0, 0, 153, 39, 74, 153, 0, 153, 153, 63, + 153, 72, 94, 153, 153, 153, 153, 0, 75, 0, + 68, 71, 27, 72, 0, 0, 70, 153, 0, 75, + 153, 74, 82, 81, 153, 0, 56, 0, 63, 62, + 0, 56, 65, 66, 62, 0, 0, 0, 64, 53, + 59, 45, 39, 0, 153, 107, 113, 116, 122, 128, + 131, 133, 135, 137 } ; -static yyconst flex_int16_t yy_def[97] = +static yyconst flex_int16_t yy_def[105] = { 0, - 87, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 88, 88, 87, 87, 87, 87, 87, 87, 89, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 90, 90, 90, 90, 90, 90, 90, 87, 91, - 91, 87, 92, 87, 87, 89, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 87, 91, 87, 87, 93, - 87, 87, 87, 90, 90, 90, 90, 90, 90, 92, - 94, 90, 90, 90, 95, 96, 0, 87, 87, 87, - 87, 87, 87, 87, 87, 87 + 95, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 96, 96, 95, 95, 95, 95, 95, 95, 97, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 98, 98, 98, 98, 98, 98, 98, 98, 95, + 99, 99, 95, 100, 95, 95, 97, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 95, 99, 95, + 95, 101, 95, 95, 95, 98, 98, 98, 98, 98, + 98, 98, 100, 102, 98, 98, 98, 98, 103, 98, + 104, 98, 98, 98, 0, 95, 95, 95, 95, 95, + 95, 95, 95, 95 } ; -static yyconst flex_int16_t yy_nxt[190] = +static yyconst flex_int16_t yy_nxt[199] = { 0, 14, 15, 16, 14, 17, 18, 19, 20, 21, 22, 23, 24, 20, 25, 26, 27, 28, 20, 20, 29, 30, 31, 32, 32, 21, 14, 22, 32, 33, 34, - 35, 32, 32, 36, 32, 32, 37, 32, 32, 38, - 32, 21, 39, 22, 41, 41, 69, 42, 42, 44, - 44, 44, 44, 49, 49, 49, 49, 52, 58, 50, - 76, 59, 53, 51, 49, 77, 49, 43, 43, 87, - 51, 61, 62, 51, 44, 44, 80, 49, 70, 49, - 51, 80, 71, 80, 71, 84, 51, 72, 83, 82, - 72, 72, 80, 51, 80, 79, 78, 75, 74, 73, + 35, 36, 32, 32, 37, 32, 32, 38, 32, 32, + 39, 32, 21, 40, 22, 42, 42, 71, 43, 43, + 45, 45, 45, 45, 50, 50, 50, 50, 53, 59, + 51, 79, 60, 54, 52, 50, 80, 50, 44, 44, + 63, 64, 52, 95, 52, 45, 45, 50, 94, 50, + 72, 93, 52, 73, 83, 73, 52, 92, 74, 83, + 90, 83, 88, 87, 52, 86, 85, 74, 74, 83, + + 83, 82, 81, 78, 77, 76, 72, 41, 41, 41, + 41, 41, 41, 47, 75, 47, 47, 47, 47, 58, + 68, 58, 69, 69, 67, 69, 66, 69, 70, 70, + 70, 70, 70, 70, 84, 84, 89, 89, 91, 91, + 70, 70, 65, 62, 61, 57, 56, 55, 49, 48, + 46, 95, 13, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95 - 66, 70, 40, 40, 40, 40, 40, 40, 46, 65, - 46, 46, 46, 46, 57, 64, 57, 67, 67, 63, - 67, 60, 67, 68, 68, 68, 68, 68, 68, 81, - 81, 85, 85, 86, 86, 68, 68, 56, 55, 54, - 48, 47, 45, 87, 13, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87 } ; -static yyconst flex_int16_t yy_chk[190] = +static yyconst flex_int16_t yy_chk[199] = { 0, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 11, 12, 43, 11, 12, 15, - 15, 16, 16, 25, 26, 25, 26, 27, 33, 25, - 61, 33, 27, 26, 28, 61, 28, 11, 12, 80, - 26, 35, 35, 28, 44, 44, 86, 49, 43, 49, - 28, 85, 51, 81, 51, 79, 49, 51, 77, 76, - 72, 71, 70, 49, 68, 65, 62, 60, 58, 52, + 1, 1, 1, 1, 1, 11, 12, 44, 11, 12, + 15, 15, 16, 16, 25, 26, 25, 26, 27, 33, + 25, 63, 33, 27, 26, 28, 63, 28, 11, 12, + 36, 36, 26, 83, 28, 45, 45, 50, 93, 50, + 44, 92, 28, 52, 91, 52, 50, 90, 52, 89, + 85, 84, 82, 80, 50, 79, 77, 74, 73, 72, + + 70, 67, 64, 62, 61, 59, 83, 96, 96, 96, + 96, 96, 96, 97, 53, 97, 97, 97, 97, 98, + 40, 98, 99, 99, 39, 99, 38, 99, 100, 100, + 100, 100, 100, 100, 101, 101, 102, 102, 103, 103, + 104, 104, 37, 35, 34, 31, 30, 29, 24, 23, + 17, 13, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95 - 39, 80, 88, 88, 88, 88, 88, 88, 89, 38, - 89, 89, 89, 89, 90, 37, 90, 91, 91, 36, - 91, 34, 91, 92, 92, 92, 92, 92, 92, 93, - 93, 94, 94, 95, 95, 96, 96, 31, 30, 29, - 24, 23, 17, 13, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87 } ; /* The intent behind this definition is that it'll catch @@ -530,7 +538,7 @@ struct lexer_param; static int enter(int opening, int state, yyscan_t yyscanner); static int try_exit(int closing, int state, yyscan_t yyscanner); #define YY_NO_INPUT 1 -#line 534 "lexer.gen.c" +#line 542 "lexer.gen.c" #define INITIAL 0 #define IN_PAREN 1 @@ -786,7 +794,7 @@ YY_DECL #line 35 "lexer.l" -#line 790 "lexer.gen.c" +#line 798 "lexer.gen.c" yylval = yylval_param; @@ -843,13 +851,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 >= 88 ) + if ( yy_current_state >= 96 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 145 ); + while ( yy_base[yy_current_state] != 153 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -981,57 +989,62 @@ YY_RULE_SETUP case 22: YY_RULE_SETUP #line 59 "lexer.l" -{ return yytext[0];} +{ return CONTAINS; } YY_BREAK case 23: YY_RULE_SETUP -#line 61 "lexer.l" +#line 60 "lexer.l" +{ return yytext[0];} + YY_BREAK +case 24: +YY_RULE_SETUP +#line 62 "lexer.l" { return enter(yytext[0], YY_START, yyscanner); } YY_BREAK -case 24: +case 25: YY_RULE_SETUP -#line 65 "lexer.l" +#line 66 "lexer.l" { return try_exit(yytext[0], YY_START, yyscanner); } YY_BREAK -case 25: +case 26: YY_RULE_SETUP -#line 70 "lexer.l" +#line 71 "lexer.l" { yylval->literal = jv_parse_sized(yytext, yyleng); return LITERAL; } YY_BREAK -case 26: +case 27: YY_RULE_SETUP -#line 74 "lexer.l" +#line 75 "lexer.l" { yy_push_state(IN_QQSTRING, yyscanner); return QQSTRING_START; } YY_BREAK -case 27: +case 28: YY_RULE_SETUP -#line 80 "lexer.l" +#line 81 "lexer.l" { return enter(QQSTRING_INTERP_START, YY_START, yyscanner); } YY_BREAK -case 28: +case 29: YY_RULE_SETUP -#line 83 "lexer.l" +#line 84 "lexer.l" { yy_pop_state(yyscanner); return QQSTRING_END; } YY_BREAK -case 29: -/* rule 29 can match eol */ +case 30: +/* rule 30 can match eol */ YY_RULE_SETUP -#line 87 "lexer.l" +#line 88 "lexer.l" { /* pass escapes to the json parser */ jv escapes = jv_string_fmt("\"%.*s\"", yyleng, yytext); @@ -1040,45 +1053,45 @@ YY_RULE_SETUP return QQSTRING_TEXT; } YY_BREAK -case 30: -/* rule 30 can match eol */ +case 31: +/* rule 31 can match eol */ YY_RULE_SETUP -#line 94 "lexer.l" +#line 95 "lexer.l" { yylval->literal = jv_string_sized(yytext, yyleng); return QQSTRING_TEXT; } YY_BREAK -case 31: +case 32: YY_RULE_SETUP -#line 98 "lexer.l" +#line 99 "lexer.l" { return INVALID_CHARACTER; } YY_BREAK -case 32: +case 33: YY_RULE_SETUP -#line 104 "lexer.l" +#line 105 "lexer.l" { yylval->literal = jv_string(yytext); return IDENT;} YY_BREAK -case 33: -/* rule 33 can match eol */ -YY_RULE_SETUP -#line 106 "lexer.l" -{} - YY_BREAK case 34: +/* rule 34 can match eol */ YY_RULE_SETUP -#line 108 "lexer.l" -{ return INVALID_CHARACTER; } +#line 107 "lexer.l" +{} YY_BREAK case 35: YY_RULE_SETUP -#line 110 "lexer.l" +#line 109 "lexer.l" +{ return INVALID_CHARACTER; } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 111 "lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1082 "lexer.gen.c" +#line 1095 "lexer.gen.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(IN_PAREN): case YY_STATE_EOF(IN_BRACKET): @@ -1377,7 +1390,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 >= 88 ) + if ( yy_current_state >= 96 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1406,11 +1419,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 >= 88 ) + if ( yy_current_state >= 96 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 87); + yy_is_jam = (yy_current_state == 95); return yy_is_jam ? 0 : yy_current_state; } @@ -2264,7 +2277,7 @@ void jq_yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 110 "lexer.l" +#line 111 "lexer.l" /* perhaps these should be calls... */ @@ -2285,6 +2298,10 @@ static int try_exit(int c, int state, yyscan_t yyscanner) { match = ')'; ret = QQSTRING_INTERP_END; break; + + default: + // may not be the best error to give + return INVALID_CHARACTER; } assert(match); if (match == c) { diff --git a/lexer.gen.h b/lexer.gen.h index 84a71abb..9249586d 100644 --- a/lexer.gen.h +++ b/lexer.gen.h @@ -354,7 +354,7 @@ extern int jq_yylex \ #undef YY_DECL #endif -#line 110 "lexer.l" +#line 111 "lexer.l" #line 361 "lexer.gen.h" diff --git a/lexer.l b/lexer.l index b09ccce4..4f283011 100644 --- a/lexer.l +++ b/lexer.l @@ -56,6 +56,7 @@ struct lexer_param; "//=" { return SETDEFINEDOR; } "<=" { return LESSEQ; } ">=" { return GREATEREQ; } +"contains" { return CONTAINS; } "."|"="|";"|","|":"|"|"|"+"|"-"|"*"|"/"|"\$"|"<"|">" { return yytext[0];} "["|"{"|"(" { diff --git a/parser.gen.c b/parser.gen.c index 4abc81e7..0fb39b3c 100644 --- a/parser.gen.c +++ b/parser.gen.c @@ -149,11 +149,12 @@ struct lexer_param; SETDEFINEDOR = 278, LESSEQ = 279, GREATEREQ = 280, - QQSTRING_START = 281, - QQSTRING_TEXT = 282, - QQSTRING_INTERP_START = 283, - QQSTRING_INTERP_END = 284, - QQSTRING_END = 285 + CONTAINS = 281, + QQSTRING_START = 282, + QQSTRING_TEXT = 283, + QQSTRING_INTERP_START = 284, + QQSTRING_INTERP_END = 285, + QQSTRING_END = 286 }; #endif @@ -172,7 +173,7 @@ typedef union YYSTYPE /* Line 293 of yacc.c */ -#line 176 "parser.gen.c" +#line 177 "parser.gen.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -196,7 +197,7 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ /* Line 343 of yacc.c */ -#line 89 "parser.y" +#line 90 "parser.y" #include "lexer.gen.h" struct lexer_param { @@ -240,14 +241,11 @@ int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, block* answer, int* errors, } static block gen_dictpair(block k, block v) { - block b = gen_subexp(k); - block_append(&b, gen_subexp(v)); - block_append(&b, gen_op_simple(INSERT)); - return b; + return BLOCK(gen_subexp(k), gen_subexp(v), gen_op_simple(INSERT)); } static block gen_index(block obj, block key) { - return block_join(obj, block_join(gen_subexp(key), gen_op_simple(INDEX))); + return BLOCK(obj, gen_subexp(key), gen_op_simple(INDEX)); } static block gen_binop(block a, block b, int op) { @@ -263,34 +261,28 @@ static block gen_binop(block a, block b, int op) { case '>': funcname = "_greater"; break; case LESSEQ: funcname = "_lesseq"; break; case GREATEREQ: funcname = "_greatereq"; break; + case CONTAINS: funcname = "_contains"; break; } assert(funcname); - block c = gen_noop(); - block_append(&c, gen_subexp(a)); - block_append(&c, gen_subexp(b)); - block_append(&c, gen_op_call(CALL_1_1, gen_op_block_unbound(CLOSURE_REF, funcname))); - return c; + return gen_call(funcname, BLOCK(gen_lambda(a), gen_lambda(b))); } static block gen_format(block a) { - return block_join(a, gen_op_call(CALL_1_1, gen_op_block_unbound(CLOSURE_REF, "tostring"))); + return BLOCK(a, gen_call("tostring", gen_noop())); } static block gen_update(block a, block op, int optype) { - block assign = a; - block_append(&assign, gen_op_simple(DUP)); if (optype) { op = gen_binop(gen_noop(), op, optype); } - block_append(&assign, op); - return gen_assign(assign); + return gen_assign(BLOCK(a, gen_op_simple(DUP), op)); } /* Line 343 of yacc.c */ -#line 294 "parser.gen.c" +#line 286 "parser.gen.c" #ifdef short # undef short @@ -511,20 +503,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 35 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 831 +#define YYLAST 854 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 50 +#define YYNTOKENS 51 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 12 /* YYNRULES -- Number of rules. */ -#define YYNRULES 69 +#define YYNRULES 70 /* YYNRULES -- Number of states. */ -#define YYNSTATES 149 +#define YYNSTATES 151 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 285 +#define YYMAXUTOK 286 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -535,16 +527,16 @@ static const yytype_uint8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 41, 2, 2, 2, - 43, 44, 39, 37, 33, 38, 45, 40, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 42, 31, - 35, 34, 36, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 42, 2, 2, 2, + 44, 45, 40, 38, 34, 39, 46, 41, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 43, 32, + 36, 35, 37, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 46, 2, 47, 2, 2, 2, 2, 2, 2, + 2, 47, 2, 48, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 48, 32, 49, 2, 2, 2, 2, + 2, 2, 2, 49, 33, 50, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -560,7 +552,7 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30 + 25, 26, 27, 28, 29, 30, 31 }; #if YYDEBUG @@ -571,54 +563,56 @@ static const yytype_uint16 yyprhs[] = 0, 0, 3, 5, 7, 8, 11, 14, 21, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, 99, 103, 107, - 111, 115, 119, 121, 125, 131, 140, 141, 144, 149, - 155, 159, 163, 165, 167, 171, 174, 179, 183, 185, - 187, 191, 195, 198, 202, 205, 207, 212, 216, 220, - 225, 229, 230, 232, 236, 240, 244, 248, 250, 256 + 111, 115, 119, 123, 125, 129, 135, 144, 145, 148, + 153, 159, 163, 167, 169, 171, 175, 178, 183, 187, + 189, 191, 195, 199, 202, 206, 209, 211, 216, 220, + 224, 229, 233, 234, 236, 240, 244, 248, 252, 254, + 260 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 51, 0, -1, 53, -1, 52, -1, -1, 55, 52, - -1, 55, 53, -1, 59, 9, 41, 4, 32, 53, - -1, 11, 53, 12, 53, 57, -1, 11, 53, 1, - -1, 53, 34, 53, -1, 53, 17, 53, -1, 53, - 16, 53, -1, 53, 8, 53, -1, 53, 23, 53, - -1, 53, 18, 53, -1, 53, 32, 53, -1, 53, - 33, 53, -1, 53, 37, 53, -1, 53, 19, 53, - -1, 53, 38, 53, -1, 53, 20, 53, -1, 53, - 39, 53, -1, 53, 21, 53, -1, 53, 40, 53, - -1, 53, 22, 53, -1, 53, 6, 53, -1, 53, - 7, 53, -1, 53, 35, 53, -1, 53, 36, 53, - -1, 53, 24, 53, -1, 53, 25, 53, -1, 59, - -1, 26, 56, 30, -1, 10, 4, 42, 53, 31, - -1, 10, 4, 43, 4, 44, 42, 53, 31, -1, - -1, 56, 27, -1, 56, 28, 53, 29, -1, 14, - 53, 12, 53, 57, -1, 13, 53, 15, -1, 58, - 32, 58, -1, 59, -1, 45, -1, 59, 45, 4, - -1, 45, 4, -1, 59, 46, 53, 47, -1, 59, - 46, 47, -1, 5, -1, 54, -1, 43, 53, 44, - -1, 46, 53, 47, -1, 46, 47, -1, 48, 60, - 49, -1, 41, 4, -1, 4, -1, 4, 43, 53, - 44, -1, 43, 1, 44, -1, 46, 1, 47, -1, - 59, 46, 1, 47, -1, 48, 1, 49, -1, -1, - 61, -1, 61, 33, 60, -1, 1, 33, 60, -1, - 4, 42, 58, -1, 54, 42, 58, -1, 4, -1, - 43, 53, 44, 42, 58, -1, 43, 1, 44, 42, - 58, -1 + 52, 0, -1, 54, -1, 53, -1, -1, 56, 53, + -1, 56, 54, -1, 60, 9, 42, 4, 33, 54, + -1, 11, 54, 12, 54, 58, -1, 11, 54, 1, + -1, 54, 35, 54, -1, 54, 17, 54, -1, 54, + 16, 54, -1, 54, 8, 54, -1, 54, 23, 54, + -1, 54, 18, 54, -1, 54, 33, 54, -1, 54, + 34, 54, -1, 54, 38, 54, -1, 54, 19, 54, + -1, 54, 39, 54, -1, 54, 20, 54, -1, 54, + 40, 54, -1, 54, 21, 54, -1, 54, 41, 54, + -1, 54, 22, 54, -1, 54, 6, 54, -1, 54, + 7, 54, -1, 54, 36, 54, -1, 54, 37, 54, + -1, 54, 24, 54, -1, 54, 25, 54, -1, 54, + 26, 54, -1, 60, -1, 27, 57, 31, -1, 10, + 4, 43, 54, 32, -1, 10, 4, 44, 4, 45, + 43, 54, 32, -1, -1, 57, 28, -1, 57, 29, + 54, 30, -1, 14, 54, 12, 54, 58, -1, 13, + 54, 15, -1, 59, 33, 59, -1, 60, -1, 46, + -1, 60, 46, 4, -1, 46, 4, -1, 60, 47, + 54, 48, -1, 60, 47, 48, -1, 5, -1, 55, + -1, 44, 54, 45, -1, 47, 54, 48, -1, 47, + 48, -1, 49, 61, 50, -1, 42, 4, -1, 4, + -1, 4, 44, 54, 45, -1, 44, 1, 45, -1, + 47, 1, 48, -1, 60, 47, 1, 48, -1, 49, + 1, 50, -1, -1, 62, -1, 62, 34, 61, -1, + 1, 34, 61, -1, 4, 43, 59, -1, 55, 43, + 59, -1, 4, -1, 44, 54, 45, 43, 59, -1, + 44, 1, 45, 43, 59, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 183, 183, 186, 191, 194, 199, 203, 210, 213, - 218, 227, 231, 235, 239, 243, 247, 251, 255, 259, - 263, 267, 271, 275, 279, 283, 287, 291, 295, 299, - 303, 307, 311, 316, 321, 327, 335, 338, 341, 347, - 350, 355, 359, 365, 368, 371, 375, 378, 381, 384, - 387, 390, 393, 396, 401, 405, 409, 419, 420, 421, - 422, 425, 428, 429, 430, 433, 436, 439, 443, 446 + 0, 175, 175, 178, 183, 186, 191, 195, 202, 205, + 210, 214, 218, 222, 226, 230, 234, 238, 242, 246, + 250, 254, 258, 262, 266, 270, 274, 278, 282, 286, + 290, 294, 298, 302, 307, 312, 317, 325, 328, 331, + 337, 340, 345, 349, 355, 358, 361, 365, 368, 371, + 374, 377, 380, 383, 386, 389, 393, 397, 402, 403, + 404, 405, 408, 411, 412, 413, 416, 419, 422, 426, + 429 }; #endif @@ -631,12 +625,12 @@ static const char *const yytname[] = "\"==\"", "\"!=\"", "\"//\"", "\"as\"", "\"def\"", "\"if\"", "\"then\"", "\"else\"", "\"elif\"", "\"end\"", "\"and\"", "\"or\"", "\"|=\"", "\"+=\"", "\"-=\"", "\"*=\"", "\"/=\"", "\"//=\"", "\"<=\"", "\">=\"", - "QQSTRING_START", "QQSTRING_TEXT", "QQSTRING_INTERP_START", - "QQSTRING_INTERP_END", "QQSTRING_END", "';'", "'|'", "','", "'='", "'<'", - "'>'", "'+'", "'-'", "'*'", "'/'", "'$'", "':'", "'('", "')'", "'.'", - "'['", "']'", "'{'", "'}'", "$accept", "TopLevel", "FuncDefs", "Exp", - "String", "FuncDef", "QQString", "ElseBody", "ExpD", "Term", "MkDict", - "MkDictPair", 0 + "\"contains\"", "QQSTRING_START", "QQSTRING_TEXT", + "QQSTRING_INTERP_START", "QQSTRING_INTERP_END", "QQSTRING_END", "';'", + "'|'", "','", "'='", "'<'", "'>'", "'+'", "'-'", "'*'", "'/'", "'$'", + "':'", "'('", "')'", "'.'", "'['", "']'", "'{'", "'}'", "$accept", + "TopLevel", "FuncDefs", "Exp", "String", "FuncDef", "QQString", + "ElseBody", "ExpD", "Term", "MkDict", "MkDictPair", 0 }; #endif @@ -648,21 +642,23 @@ static const yytype_uint16 yytoknum[] = 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 59, 124, 44, 61, 60, 62, 43, 45, 42, - 47, 36, 58, 40, 41, 46, 91, 93, 123, 125 + 285, 286, 59, 124, 44, 61, 60, 62, 43, 45, + 42, 47, 36, 58, 40, 41, 46, 91, 93, 123, + 125 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 50, 51, 51, 52, 52, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 54, 55, 55, 56, 56, 56, 57, - 57, 58, 58, 59, 59, 59, 59, 59, 59, 59, - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 59, 60, 60, 60, 60, 61, 61, 61, 61, 61 + 0, 51, 52, 52, 53, 53, 54, 54, 54, 54, + 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, + 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, + 54, 54, 54, 54, 55, 56, 56, 57, 57, 57, + 58, 58, 59, 59, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, + 62 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -671,10 +667,11 @@ static const yytype_uint8 yyr2[] = 0, 2, 1, 1, 0, 2, 2, 6, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 1, 3, 5, 8, 0, 2, 4, 5, - 3, 3, 1, 1, 3, 2, 4, 3, 1, 1, - 3, 3, 2, 3, 2, 1, 4, 3, 3, 4, - 3, 0, 1, 3, 3, 3, 3, 1, 5, 5 + 3, 3, 3, 1, 3, 5, 8, 0, 2, 4, + 5, 3, 3, 1, 1, 3, 2, 4, 3, 1, + 1, 3, 3, 2, 3, 2, 1, 4, 3, 3, + 4, 3, 0, 1, 3, 3, 3, 3, 1, 5, + 5 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. @@ -682,264 +679,271 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 4, 55, 48, 0, 0, 36, 0, 0, 43, 0, - 0, 0, 3, 2, 49, 4, 32, 0, 0, 0, - 0, 0, 54, 0, 0, 45, 0, 52, 0, 0, - 67, 0, 0, 0, 62, 1, 0, 0, 0, 0, + 4, 56, 49, 0, 0, 37, 0, 0, 44, 0, + 0, 0, 3, 2, 50, 4, 33, 0, 0, 0, + 0, 0, 55, 0, 0, 46, 0, 53, 0, 0, + 68, 0, 0, 0, 63, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, - 0, 0, 0, 0, 0, 0, 9, 0, 37, 0, - 33, 57, 50, 58, 51, 0, 60, 0, 0, 0, - 0, 53, 0, 26, 27, 13, 12, 11, 15, 19, - 21, 23, 25, 14, 30, 31, 16, 17, 10, 28, - 29, 18, 20, 22, 24, 0, 44, 0, 47, 0, - 56, 0, 0, 0, 0, 0, 64, 65, 42, 0, - 0, 66, 63, 0, 59, 46, 34, 0, 0, 0, - 8, 38, 0, 0, 0, 0, 0, 0, 0, 41, - 69, 68, 7, 0, 40, 0, 35, 0, 39 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, + 6, 0, 0, 0, 0, 0, 0, 9, 0, 38, + 0, 34, 58, 51, 59, 52, 0, 61, 0, 0, + 0, 0, 54, 0, 26, 27, 13, 12, 11, 15, + 19, 21, 23, 25, 14, 30, 31, 32, 16, 17, + 10, 28, 29, 18, 20, 22, 24, 0, 45, 0, + 48, 0, 57, 0, 0, 0, 0, 0, 65, 66, + 43, 0, 0, 67, 64, 0, 60, 47, 35, 0, + 0, 0, 8, 39, 0, 0, 0, 0, 0, 0, + 0, 42, 70, 69, 7, 0, 41, 0, 36, 0, + 40 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 11, 12, 59, 14, 20, 21, 130, 117, 16, + -1, 11, 12, 60, 14, 20, 21, 132, 119, 16, 33, 34 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -75 +#define YYPACT_NINF -76 static const yytype_int16 yypact[] = { - 175, -41, -75, 10, 175, -75, 16, 129, 18, 78, - 64, 28, -75, 645, -75, 175, 52, 175, -27, 295, - 175, -17, -75, -14, 330, -75, -18, -75, 218, -28, - -10, 152, -8, -16, 2, -75, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, -75, 645, - 22, 71, 101, 365, 175, 72, -75, 175, -75, 175, - -75, -75, -75, -75, -75, 73, -75, 161, 34, 400, - 161, -75, 73, 785, 785, 715, 791, 765, 740, 740, - 740, 740, 740, 740, 785, 785, 680, 715, 740, 785, - 785, -15, -15, -75, -75, 76, -75, 37, -75, 253, - -75, 470, 41, 435, 505, 48, -75, 54, -19, 45, - 49, 54, -75, 60, -75, -75, -75, 51, 175, 175, - -75, -75, 161, 161, 161, 175, 175, 540, 575, -75, - 54, 54, 680, 610, -75, 175, -75, 435, -75 + 179, -42, -76, 10, 179, -76, 16, 131, 18, 79, + 65, 28, -76, 662, -76, 179, 53, 179, -28, 302, + 179, -18, -76, -15, 338, -76, -19, -76, 223, -29, + -11, 155, -10, 14, 1, -76, 179, 179, 179, 179, + 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, + 179, 179, 179, 179, 179, 179, 179, 179, 179, -76, + 662, -8, 72, 106, 374, 179, 73, -76, 179, -76, + 179, -76, -76, -76, -76, -76, 74, -76, 165, 34, + 410, 165, -76, 74, 807, 807, 734, 813, 786, 760, + 760, 760, 760, 760, 760, 807, 807, 807, 698, 734, + 760, 807, 807, -16, -16, -76, -76, 77, -76, 37, + -76, 259, -76, 482, 41, 446, 518, 48, -76, 54, + -20, 45, 50, 54, -76, 58, -76, -76, -76, 51, + 179, 179, -76, -76, 165, 165, 165, 179, 179, 554, + 590, -76, 54, 54, 698, 626, -76, 179, -76, 446, + -76 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -75, -75, 79, 0, -9, 8, -75, -52, -62, -74, - -63, -75 + -76, -76, 80, 0, -9, 8, -76, -53, -63, -75, + -64, -76 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -62 +#define YYTABLE_NINF -63 static const yytype_int16 yytable[] = { - 13, 32, 17, 118, 19, 75, 118, 24, 15, 28, - 68, 69, 116, 70, 18, 64, 65, 63, 121, 122, - 22, 76, 25, 15, 56, 57, 61, 62, 35, 73, - 71, 79, 77, 81, 80, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 118, 118, - 118, 60, 109, 105, 111, 29, 32, 113, 30, 114, - 139, 140, 141, 32, 115, 106, 112, 30, 119, 26, - 123, 75, 1, 2, 124, 127, 132, 133, 3, 4, - 5, 134, 135, 136, 58, 148, 0, 61, 62, 5, - 0, 0, 107, 0, 5, 1, 2, 31, 0, 0, - 0, 3, 4, -61, 0, 0, 31, 0, 0, 6, - 0, 7, -61, 8, 9, 27, 10, 5, 137, 138, - 23, 0, 0, 1, 2, 142, 143, 0, 0, 3, - 4, 0, 6, 0, 7, 147, 8, 9, 108, 10, - 0, 0, 0, 78, 0, 5, 1, 2, 0, 0, - 0, 0, 3, 4, 0, 1, 2, 0, 0, 0, - 6, 0, 7, 0, 8, 9, 0, 10, 5, 1, - 2, 0, 0, 0, 0, 3, 4, 5, 0, 0, - 0, 0, 0, 6, 0, 7, 0, 8, 9, 0, - 10, 5, 6, 0, 7, 0, 8, 9, 0, 10, - 0, 0, 0, 0, 0, 0, 6, 0, 7, 0, - 8, 9, 0, 10, 36, 37, 38, 0, 0, 0, + 13, 32, 17, 120, 19, 76, 120, 24, 15, 28, + 69, 70, 118, 71, 18, 65, 66, 64, 123, 124, + 22, 77, 25, 15, 57, 58, 62, 63, 35, 74, + 72, 80, 78, 81, 107, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 120, + 120, 120, 61, 111, 82, 113, 29, 32, 115, 30, + 116, 141, 142, 143, 32, 117, 108, 114, 30, 121, + 26, 125, 76, 1, 2, 126, 129, 134, 135, 3, + 4, 137, 5, 136, 138, 59, 150, 0, 0, 62, + 63, 5, 0, 0, 0, 0, 5, 109, 0, 31, + 1, 2, 0, 0, 0, -62, 3, 4, 31, 0, + 0, 6, 0, 7, -62, 8, 9, 27, 10, 0, + 139, 140, 23, 5, 0, 1, 2, 144, 145, 0, + 0, 3, 4, 0, 0, 0, 0, 149, 6, 0, + 7, 0, 8, 9, 110, 10, 79, 0, 5, 1, + 2, 0, 0, 0, 0, 3, 4, 0, 0, 1, + 2, 0, 0, 6, 0, 7, 0, 8, 9, 0, + 10, 0, 5, 1, 2, 0, 0, 0, 0, 3, + 4, 0, 5, 0, 0, 0, 0, 6, 0, 7, + 0, 8, 9, 0, 10, 0, 5, 6, 0, 7, + 0, 8, 9, 0, 10, 0, 0, 0, 0, 0, + 0, 6, 0, 7, 0, 8, 9, 0, 10, 36, + 37, 38, 0, 0, 0, 0, 0, 0, 0, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 0, 0, 0, 0, 0, 0, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 36, 37, 38, 0, 0, + 0, 75, 0, 0, 0, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 0, 0, 0, 0, + 0, 0, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 0, 0, 67, 0, 0, 0, 127, 36, 37, + 38, 0, 0, 0, 68, 0, 0, 0, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, + 0, 0, 0, 0, 0, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 36, 37, 38, 0, 0, 0, 0, 0, 0, 0, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 0, 0, 0, 0, 0, 0, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 36, - 37, 38, 0, 0, 0, 74, 0, 0, 0, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 0, - 0, 0, 0, 0, 0, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 0, 0, 66, 0, 0, 0, - 125, 36, 37, 38, 0, 0, 0, 67, 0, 0, - 0, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 0, 0, 0, 0, 0, 0, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 36, 37, 38, 0, + 45, 46, 47, 48, 49, 0, 0, 0, 0, 0, + 0, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 36, 37, 38, 73, 0, 0, 0, 0, 0, 0, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 0, 0, 0, 0, 0, 0, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 36, 37, 38, 112, 0, 0, 0, 0, 0, 0, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 0, 0, 0, 0, - 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 36, 37, 38, 72, 0, 0, 0, 0, 0, - 0, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 0, 0, 0, 0, 0, 0, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 36, 37, 38, 110, - 0, 0, 0, 0, 0, 0, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 0, 0, 0, 0, - 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 36, 37, 38, 120, 0, 0, 0, 128, 129, - 0, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 0, 0, 0, 0, 0, 0, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 36, 37, 38, 0, - 0, 0, 0, 0, 0, 0, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 0, 0, 0, 0, - 0, 126, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 36, 37, 38, 0, 0, 0, 0, 0, 0, - 0, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 0, 0, 0, 131, 0, 0, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 36, 37, 38, 0, - 0, 0, 0, 0, 0, 144, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 0, 0, 0, 0, - 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 36, 37, 38, 0, 0, 0, 145, 0, 0, - 0, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 0, 0, 0, 0, 0, 0, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 36, 37, 38, 0, - 0, 0, 0, 0, 0, 0, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 0, 0, 0, 0, - 0, 146, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 36, 37, 38, 0, 0, 0, 0, 0, 0, - 0, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 0, 0, 0, 0, 0, 0, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 36, 37, 38, 0, - 0, 0, 0, 0, 0, 0, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 0, 0, 0, 0, + 43, 44, 45, 46, 47, 48, 49, 0, 0, 0, 0, 0, 0, 50, 51, 52, 53, 54, 55, 56, - 57, 36, 37, 38, 0, 0, 0, 0, 0, 0, - 0, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 0, 0, 0, 0, 0, 36, 37, 0, 51, - 52, 53, 54, 55, 56, 57, 39, 40, -62, -62, - -62, -62, -62, -62, 47, 48, 0, 0, 0, 0, - 0, 36, 37, 0, -62, 52, 53, 54, 55, 56, - 57, 39, 0, 0, 0, 0, 0, 0, 0, 47, - 48, -62, -62, 0, 0, 0, 0, 36, 37, 0, - 52, 53, 54, 55, 56, 57, 0, 0, 0, -62, - -62, 0, 0, 0, 0, 47, 48, 0, 0, 0, - -62, -62, 54, 55, 56, 57, 52, 53, 54, 55, - 56, 57 + 57, 58, 36, 37, 38, 122, 0, 0, 0, 130, + 131, 0, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 0, 0, 0, 0, 0, 0, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 36, 37, + 38, 0, 0, 0, 0, 0, 0, 0, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, + 0, 0, 0, 0, 128, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 36, 37, 38, 0, 0, 0, + 0, 0, 0, 0, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 0, 0, 0, 133, 0, + 0, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 36, 37, 38, 0, 0, 0, 0, 0, 0, 146, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 0, 0, 0, 0, 0, 0, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 36, 37, 38, 0, + 0, 0, 147, 0, 0, 0, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 0, 0, 0, + 0, 0, 0, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 36, 37, 38, 0, 0, 0, 0, 0, + 0, 0, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 0, 0, 0, 0, 0, 148, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 36, 37, + 38, 0, 0, 0, 0, 0, 0, 0, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, + 0, 0, 0, 0, 0, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 36, 37, 38, 0, 0, 0, + 0, 0, 0, 0, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 0, 0, 0, 0, 0, + 0, 0, 51, 52, 53, 54, 55, 56, 57, 58, + 36, 37, 38, 0, 0, 0, 0, 0, 0, 0, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 0, 0, 0, 0, 0, 36, 37, 0, 52, + 53, 54, 55, 56, 57, 58, 39, 40, -63, -63, + -63, -63, -63, -63, 47, 48, 49, 0, 0, 0, + 0, 0, 36, 37, 0, -63, 53, 54, 55, 56, + 57, 58, 39, 0, 0, 0, 0, 0, 0, 0, + 47, 48, 49, -63, -63, 0, 0, 0, 0, 36, + 37, 0, 53, 54, 55, 56, 57, 58, 0, 0, + 0, -63, -63, -63, 0, 0, 0, 47, 48, 49, + 0, 0, 0, -63, -63, 55, 56, 57, 58, 53, + 54, 55, 56, 57, 58 }; #define yypact_value_is_default(yystate) \ - ((yystate) == (-75)) + ((yystate) == (-76)) #define yytable_value_is_error(yytable_value) \ - ((yytable_value) == (-62)) + ((yytable_value) == (-63)) static const yytype_int16 yycheck[] = { - 0, 10, 43, 77, 4, 33, 80, 7, 0, 9, - 27, 28, 75, 30, 4, 42, 43, 17, 80, 82, - 4, 49, 4, 15, 39, 40, 45, 46, 0, 47, - 44, 31, 42, 49, 42, 33, 36, 37, 38, 39, + 0, 10, 44, 78, 4, 34, 81, 7, 0, 9, + 28, 29, 76, 31, 4, 43, 44, 17, 81, 83, + 4, 50, 4, 15, 40, 41, 46, 47, 0, 48, + 45, 31, 43, 43, 42, 34, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 132, 133, - 134, 9, 62, 41, 64, 1, 75, 67, 4, 69, - 132, 133, 134, 82, 1, 4, 4, 4, 44, 1, - 4, 33, 4, 5, 47, 44, 32, 42, 10, 11, - 26, 42, 32, 42, 15, 147, -1, 45, 46, 26, - -1, -1, 1, -1, 26, 4, 5, 43, -1, -1, - -1, 10, 11, 49, -1, -1, 43, -1, -1, 41, - -1, 43, 49, 45, 46, 47, 48, 26, 128, 129, - 1, -1, -1, 4, 5, 135, 136, -1, -1, 10, - 11, -1, 41, -1, 43, 145, 45, 46, 47, 48, - -1, -1, -1, 1, -1, 26, 4, 5, -1, -1, - -1, -1, 10, 11, -1, 4, 5, -1, -1, -1, - 41, -1, 43, -1, 45, 46, -1, 48, 26, 4, - 5, -1, -1, -1, -1, 10, 11, 26, -1, -1, - -1, -1, -1, 41, -1, 43, -1, 45, 46, -1, - 48, 26, 41, -1, 43, -1, 45, 46, -1, 48, - -1, -1, -1, -1, -1, -1, 41, -1, 43, -1, - 45, 46, -1, 48, 6, 7, 8, -1, -1, -1, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 134, + 135, 136, 9, 63, 50, 65, 1, 76, 68, 4, + 70, 134, 135, 136, 83, 1, 4, 4, 4, 45, + 1, 4, 34, 4, 5, 48, 45, 33, 43, 10, + 11, 33, 27, 43, 43, 15, 149, -1, -1, 46, + 47, 27, -1, -1, -1, -1, 27, 1, -1, 44, + 4, 5, -1, -1, -1, 50, 10, 11, 44, -1, + -1, 42, -1, 44, 50, 46, 47, 48, 49, -1, + 130, 131, 1, 27, -1, 4, 5, 137, 138, -1, + -1, 10, 11, -1, -1, -1, -1, 147, 42, -1, + 44, -1, 46, 47, 48, 49, 1, -1, 27, 4, + 5, -1, -1, -1, -1, 10, 11, -1, -1, 4, + 5, -1, -1, 42, -1, 44, -1, 46, 47, -1, + 49, -1, 27, 4, 5, -1, -1, -1, -1, 10, + 11, -1, 27, -1, -1, -1, -1, 42, -1, 44, + -1, 46, 47, -1, 49, -1, 27, 42, -1, 44, + -1, 46, 47, -1, 49, -1, -1, -1, -1, -1, + -1, 42, -1, 44, -1, 46, 47, -1, 49, 6, + 7, 8, -1, -1, -1, -1, -1, -1, -1, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + -1, -1, -1, -1, -1, -1, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 6, 7, 8, -1, -1, + -1, 48, -1, -1, -1, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, + -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, + 41, -1, -1, 1, -1, -1, -1, 48, 6, 7, + 8, -1, -1, -1, 12, -1, -1, -1, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, + -1, -1, -1, -1, -1, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 6, - 7, 8, -1, -1, -1, 47, -1, -1, -1, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, - -1, -1, -1, -1, -1, 32, 33, 34, 35, 36, - 37, 38, 39, 40, -1, -1, 1, -1, -1, -1, - 47, 6, 7, 8, -1, -1, -1, 12, -1, -1, - -1, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, -1, -1, -1, -1, -1, -1, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 6, 7, 8, -1, + 22, 23, 24, 25, 26, -1, -1, -1, -1, -1, + -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 6, 7, 8, 45, -1, -1, -1, -1, -1, -1, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, -1, -1, -1, -1, -1, -1, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 6, 7, 8, 45, -1, -1, -1, -1, -1, -1, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, - -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 6, 7, 8, 44, -1, -1, -1, -1, -1, - -1, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, -1, -1, -1, -1, -1, -1, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 6, 7, 8, 44, - -1, -1, -1, -1, -1, -1, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, - -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 6, 7, 8, 44, -1, -1, -1, 13, 14, - -1, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, -1, -1, -1, -1, -1, -1, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 6, 7, 8, -1, - -1, -1, -1, -1, -1, -1, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, - -1, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 6, 7, 8, -1, -1, -1, -1, -1, -1, - -1, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, -1, -1, -1, 29, -1, -1, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 6, 7, 8, -1, - -1, -1, -1, -1, -1, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, - -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 6, 7, 8, -1, -1, -1, 12, -1, -1, - -1, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, -1, -1, -1, -1, -1, -1, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 6, 7, 8, -1, - -1, -1, -1, -1, -1, -1, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, - -1, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 6, 7, 8, -1, -1, -1, -1, -1, -1, - -1, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, -1, -1, -1, -1, -1, -1, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 6, 7, 8, -1, - -1, -1, -1, -1, -1, -1, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, + 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, - 40, 6, 7, 8, -1, -1, -1, -1, -1, -1, - -1, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, -1, -1, -1, -1, -1, 6, 7, -1, 34, - 35, 36, 37, 38, 39, 40, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, - -1, 6, 7, -1, 34, 35, 36, 37, 38, 39, - 40, 16, -1, -1, -1, -1, -1, -1, -1, 24, - 25, 6, 7, -1, -1, -1, -1, 6, 7, -1, - 35, 36, 37, 38, 39, 40, -1, -1, -1, 24, - 25, -1, -1, -1, -1, 24, 25, -1, -1, -1, - 35, 36, 37, 38, 39, 40, 35, 36, 37, 38, - 39, 40 + 40, 41, 6, 7, 8, 45, -1, -1, -1, 13, + 14, -1, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, -1, -1, -1, -1, -1, -1, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 6, 7, + 8, -1, -1, -1, -1, -1, -1, -1, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, + -1, -1, -1, -1, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 6, 7, 8, -1, -1, -1, + -1, -1, -1, -1, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, -1, -1, -1, 30, -1, + -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 6, 7, 8, -1, -1, -1, -1, -1, -1, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, -1, -1, -1, -1, -1, -1, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 6, 7, 8, -1, + -1, -1, 12, -1, -1, -1, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, + -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 6, 7, 8, -1, -1, -1, -1, -1, + -1, -1, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, -1, -1, -1, -1, -1, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 6, 7, + 8, -1, -1, -1, -1, -1, -1, -1, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, + -1, -1, -1, -1, -1, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 6, 7, 8, -1, -1, -1, + -1, -1, -1, -1, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, -1, -1, -1, -1, -1, + -1, -1, 34, 35, 36, 37, 38, 39, 40, 41, + 6, 7, 8, -1, -1, -1, -1, -1, -1, -1, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, -1, -1, -1, -1, -1, 6, 7, -1, 35, + 36, 37, 38, 39, 40, 41, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, + -1, -1, 6, 7, -1, 35, 36, 37, 38, 39, + 40, 41, 16, -1, -1, -1, -1, -1, -1, -1, + 24, 25, 26, 6, 7, -1, -1, -1, -1, 6, + 7, -1, 36, 37, 38, 39, 40, 41, -1, -1, + -1, 24, 25, 26, -1, -1, -1, 24, 25, 26, + -1, -1, -1, 36, 37, 38, 39, 40, 41, 36, + 37, 38, 39, 40, 41 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 4, 5, 10, 11, 26, 41, 43, 45, 46, - 48, 51, 52, 53, 54, 55, 59, 43, 4, 53, - 55, 56, 4, 1, 53, 4, 1, 47, 53, 1, - 4, 43, 54, 60, 61, 0, 6, 7, 8, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 52, 53, - 9, 45, 46, 53, 42, 43, 1, 12, 27, 28, - 30, 44, 44, 47, 47, 33, 49, 42, 1, 53, - 42, 49, 33, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 41, 4, 1, 47, 53, - 44, 53, 4, 53, 53, 1, 60, 58, 59, 44, - 44, 58, 60, 4, 47, 47, 31, 44, 13, 14, - 57, 29, 32, 42, 42, 32, 42, 53, 53, 58, - 58, 58, 53, 53, 15, 12, 31, 53, 57 + 0, 4, 5, 10, 11, 27, 42, 44, 46, 47, + 49, 52, 53, 54, 55, 56, 60, 44, 4, 54, + 56, 57, 4, 1, 54, 4, 1, 48, 54, 1, + 4, 44, 55, 61, 62, 0, 6, 7, 8, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 53, + 54, 9, 46, 47, 54, 43, 44, 1, 12, 28, + 29, 31, 45, 45, 48, 48, 34, 50, 43, 1, + 54, 43, 50, 34, 54, 54, 54, 54, 54, 54, + 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, + 54, 54, 54, 54, 54, 54, 54, 42, 4, 1, + 48, 54, 45, 54, 4, 54, 54, 1, 61, 59, + 60, 45, 45, 59, 61, 4, 48, 48, 32, 45, + 13, 14, 58, 30, 33, 43, 43, 33, 43, 54, + 54, 59, 59, 59, 54, 54, 15, 12, 32, 54, + 58 }; #define yyerrok (yyerrstatus = 0) @@ -1523,7 +1527,7 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, answer, errors, locations, lex { jv_free((yyvaluep->literal)); }; /* Line 1391 of yacc.c */ -#line 1527 "parser.gen.c" +#line 1531 "parser.gen.c" break; case 5: /* "LITERAL" */ @@ -1532,106 +1536,106 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, answer, errors, locations, lex { jv_free((yyvaluep->literal)); }; /* Line 1391 of yacc.c */ -#line 1536 "parser.gen.c" +#line 1540 "parser.gen.c" break; - case 27: /* "QQSTRING_TEXT" */ + case 28: /* "QQSTRING_TEXT" */ /* Line 1391 of yacc.c */ #line 32 "parser.y" { jv_free((yyvaluep->literal)); }; /* Line 1391 of yacc.c */ -#line 1545 "parser.gen.c" +#line 1549 "parser.gen.c" break; - case 52: /* "FuncDefs" */ + case 53: /* "FuncDefs" */ /* Line 1391 of yacc.c */ #line 33 "parser.y" { block_free((yyvaluep->blk)); }; /* Line 1391 of yacc.c */ -#line 1554 "parser.gen.c" +#line 1558 "parser.gen.c" break; - case 53: /* "Exp" */ + case 54: /* "Exp" */ /* Line 1391 of yacc.c */ #line 33 "parser.y" { block_free((yyvaluep->blk)); }; /* Line 1391 of yacc.c */ -#line 1563 "parser.gen.c" +#line 1567 "parser.gen.c" break; - case 54: /* "String" */ + case 55: /* "String" */ /* Line 1391 of yacc.c */ #line 33 "parser.y" { block_free((yyvaluep->blk)); }; /* Line 1391 of yacc.c */ -#line 1572 "parser.gen.c" +#line 1576 "parser.gen.c" break; - case 55: /* "FuncDef" */ + case 56: /* "FuncDef" */ /* Line 1391 of yacc.c */ #line 33 "parser.y" { block_free((yyvaluep->blk)); }; /* Line 1391 of yacc.c */ -#line 1581 "parser.gen.c" +#line 1585 "parser.gen.c" break; - case 56: /* "QQString" */ + case 57: /* "QQString" */ /* Line 1391 of yacc.c */ #line 33 "parser.y" { block_free((yyvaluep->blk)); }; /* Line 1391 of yacc.c */ -#line 1590 "parser.gen.c" +#line 1594 "parser.gen.c" break; - case 57: /* "ElseBody" */ + case 58: /* "ElseBody" */ /* Line 1391 of yacc.c */ #line 33 "parser.y" { block_free((yyvaluep->blk)); }; /* Line 1391 of yacc.c */ -#line 1599 "parser.gen.c" +#line 1603 "parser.gen.c" break; - case 58: /* "ExpD" */ + case 59: /* "ExpD" */ /* Line 1391 of yacc.c */ #line 33 "parser.y" { block_free((yyvaluep->blk)); }; /* Line 1391 of yacc.c */ -#line 1608 "parser.gen.c" +#line 1612 "parser.gen.c" break; - case 59: /* "Term" */ + case 60: /* "Term" */ /* Line 1391 of yacc.c */ #line 33 "parser.y" { block_free((yyvaluep->blk)); }; /* Line 1391 of yacc.c */ -#line 1617 "parser.gen.c" +#line 1621 "parser.gen.c" break; - case 60: /* "MkDict" */ + case 61: /* "MkDict" */ /* Line 1391 of yacc.c */ #line 33 "parser.y" { block_free((yyvaluep->blk)); }; /* Line 1391 of yacc.c */ -#line 1626 "parser.gen.c" +#line 1630 "parser.gen.c" break; - case 61: /* "MkDictPair" */ + case 62: /* "MkDictPair" */ /* Line 1391 of yacc.c */ #line 33 "parser.y" { block_free((yyvaluep->blk)); }; /* Line 1391 of yacc.c */ -#line 1635 "parser.gen.c" +#line 1639 "parser.gen.c" break; default: @@ -1963,7 +1967,7 @@ yyreduce: case 2: /* Line 1806 of yacc.c */ -#line 183 "parser.y" +#line 175 "parser.y" { *answer = (yyvsp[(1) - (1)].blk); } @@ -1972,7 +1976,7 @@ yyreduce: case 3: /* Line 1806 of yacc.c */ -#line 186 "parser.y" +#line 178 "parser.y" { *answer = (yyvsp[(1) - (1)].blk); } @@ -1981,7 +1985,7 @@ yyreduce: case 4: /* Line 1806 of yacc.c */ -#line 191 "parser.y" +#line 183 "parser.y" { (yyval.blk) = gen_noop(); } @@ -1990,7 +1994,7 @@ yyreduce: case 5: /* Line 1806 of yacc.c */ -#line 194 "parser.y" +#line 186 "parser.y" { (yyval.blk) = block_join((yyvsp[(1) - (2)].blk), (yyvsp[(2) - (2)].blk)); } @@ -1999,7 +2003,7 @@ yyreduce: case 6: /* Line 1806 of yacc.c */ -#line 199 "parser.y" +#line 191 "parser.y" { (yyval.blk) = block_bind((yyvsp[(1) - (2)].blk), (yyvsp[(2) - (2)].blk), OP_IS_CALL_PSEUDO); } @@ -2008,11 +2012,11 @@ yyreduce: case 7: /* Line 1806 of yacc.c */ -#line 203 "parser.y" +#line 195 "parser.y" { - (yyval.blk) = gen_op_simple(DUP); - block_append(&(yyval.blk), (yyvsp[(1) - (6)].blk)); - block_append(&(yyval.blk), block_bind(gen_op_var_unbound(STOREV, jv_string_value((yyvsp[(4) - (6)].literal))), (yyvsp[(6) - (6)].blk), OP_HAS_VARIABLE)); + (yyval.blk) = BLOCK(gen_op_simple(DUP), (yyvsp[(1) - (6)].blk), + block_bind(gen_op_var_unbound(STOREV, jv_string_value((yyvsp[(4) - (6)].literal))), + (yyvsp[(6) - (6)].blk), OP_HAS_VARIABLE)); jv_free((yyvsp[(4) - (6)].literal)); } break; @@ -2020,7 +2024,7 @@ yyreduce: case 8: /* Line 1806 of yacc.c */ -#line 210 "parser.y" +#line 202 "parser.y" { (yyval.blk) = gen_cond((yyvsp[(2) - (5)].blk), (yyvsp[(4) - (5)].blk), (yyvsp[(5) - (5)].blk)); } @@ -2029,7 +2033,7 @@ yyreduce: case 9: /* Line 1806 of yacc.c */ -#line 213 "parser.y" +#line 205 "parser.y" { FAIL((yyloc), "Possibly unterminated 'if' statment"); (yyval.blk) = (yyvsp[(2) - (3)].blk); @@ -2039,21 +2043,16 @@ yyreduce: case 10: /* Line 1806 of yacc.c */ -#line 218 "parser.y" +#line 210 "parser.y" { - block assign = gen_op_simple(DUP); - block_append(&assign, (yyvsp[(3) - (3)].blk)); - block_append(&assign, gen_op_simple(SWAP)); - block_append(&assign, (yyvsp[(1) - (3)].blk)); - block_append(&assign, gen_op_simple(SWAP)); - (yyval.blk) = gen_assign(assign); + (yyval.blk) = gen_assign(BLOCK(gen_op_simple(DUP), (yyvsp[(3) - (3)].blk), gen_op_simple(SWAP), (yyvsp[(1) - (3)].blk), gen_op_simple(SWAP))); } break; case 11: /* Line 1806 of yacc.c */ -#line 227 "parser.y" +#line 214 "parser.y" { (yyval.blk) = gen_or((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk)); } @@ -2062,7 +2061,7 @@ yyreduce: case 12: /* Line 1806 of yacc.c */ -#line 231 "parser.y" +#line 218 "parser.y" { (yyval.blk) = gen_and((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk)); } @@ -2071,7 +2070,7 @@ yyreduce: case 13: /* Line 1806 of yacc.c */ -#line 235 "parser.y" +#line 222 "parser.y" { (yyval.blk) = gen_definedor((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk)); } @@ -2080,7 +2079,7 @@ yyreduce: case 14: /* Line 1806 of yacc.c */ -#line 239 "parser.y" +#line 226 "parser.y" { (yyval.blk) = gen_update((yyvsp[(1) - (3)].blk), gen_definedor(gen_noop(), (yyvsp[(3) - (3)].blk)), 0); } @@ -2089,7 +2088,7 @@ yyreduce: case 15: /* Line 1806 of yacc.c */ -#line 243 "parser.y" +#line 230 "parser.y" { (yyval.blk) = gen_update((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), 0); } @@ -2098,7 +2097,7 @@ yyreduce: case 16: /* Line 1806 of yacc.c */ -#line 247 "parser.y" +#line 234 "parser.y" { (yyval.blk) = block_join((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk)); } @@ -2107,7 +2106,7 @@ yyreduce: case 17: /* Line 1806 of yacc.c */ -#line 251 "parser.y" +#line 238 "parser.y" { (yyval.blk) = gen_both((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk)); } @@ -2116,7 +2115,7 @@ yyreduce: case 18: /* Line 1806 of yacc.c */ -#line 255 "parser.y" +#line 242 "parser.y" { (yyval.blk) = gen_binop((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), '+'); } @@ -2125,7 +2124,7 @@ yyreduce: case 19: /* Line 1806 of yacc.c */ -#line 259 "parser.y" +#line 246 "parser.y" { (yyval.blk) = gen_update((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), '+'); } @@ -2134,7 +2133,7 @@ yyreduce: case 20: /* Line 1806 of yacc.c */ -#line 263 "parser.y" +#line 250 "parser.y" { (yyval.blk) = gen_binop((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), '-'); } @@ -2143,7 +2142,7 @@ yyreduce: case 21: /* Line 1806 of yacc.c */ -#line 267 "parser.y" +#line 254 "parser.y" { (yyval.blk) = gen_update((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), '-'); } @@ -2152,7 +2151,7 @@ yyreduce: case 22: /* Line 1806 of yacc.c */ -#line 271 "parser.y" +#line 258 "parser.y" { (yyval.blk) = gen_binop((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), '*'); } @@ -2161,7 +2160,7 @@ yyreduce: case 23: /* Line 1806 of yacc.c */ -#line 275 "parser.y" +#line 262 "parser.y" { (yyval.blk) = gen_update((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), '*'); } @@ -2170,7 +2169,7 @@ yyreduce: case 24: /* Line 1806 of yacc.c */ -#line 279 "parser.y" +#line 266 "parser.y" { (yyval.blk) = gen_binop((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), '/'); } @@ -2179,7 +2178,7 @@ yyreduce: case 25: /* Line 1806 of yacc.c */ -#line 283 "parser.y" +#line 270 "parser.y" { (yyval.blk) = gen_update((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), '/'); } @@ -2188,7 +2187,7 @@ yyreduce: case 26: /* Line 1806 of yacc.c */ -#line 287 "parser.y" +#line 274 "parser.y" { (yyval.blk) = gen_binop((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), EQ); } @@ -2197,7 +2196,7 @@ yyreduce: case 27: /* Line 1806 of yacc.c */ -#line 291 "parser.y" +#line 278 "parser.y" { (yyval.blk) = gen_binop((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), NEQ); } @@ -2206,7 +2205,7 @@ yyreduce: case 28: /* Line 1806 of yacc.c */ -#line 295 "parser.y" +#line 282 "parser.y" { (yyval.blk) = gen_binop((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), '<'); } @@ -2215,7 +2214,7 @@ yyreduce: case 29: /* Line 1806 of yacc.c */ -#line 299 "parser.y" +#line 286 "parser.y" { (yyval.blk) = gen_binop((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), '>'); } @@ -2224,7 +2223,7 @@ yyreduce: case 30: /* Line 1806 of yacc.c */ -#line 303 "parser.y" +#line 290 "parser.y" { (yyval.blk) = gen_binop((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), LESSEQ); } @@ -2233,7 +2232,7 @@ yyreduce: case 31: /* Line 1806 of yacc.c */ -#line 307 "parser.y" +#line 294 "parser.y" { (yyval.blk) = gen_binop((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), GREATEREQ); } @@ -2242,343 +2241,344 @@ yyreduce: case 32: /* Line 1806 of yacc.c */ -#line 311 "parser.y" - { - (yyval.blk) = (yyvsp[(1) - (1)].blk); +#line 298 "parser.y" + { + (yyval.blk) = gen_binop((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk), CONTAINS); } break; case 33: /* Line 1806 of yacc.c */ -#line 316 "parser.y" - { - (yyval.blk) = (yyvsp[(2) - (3)].blk); +#line 302 "parser.y" + { + (yyval.blk) = (yyvsp[(1) - (1)].blk); } break; case 34: /* Line 1806 of yacc.c */ -#line 321 "parser.y" +#line 307 "parser.y" { - block body = block_join((yyvsp[(4) - (5)].blk), gen_op_simple(RET)); - (yyval.blk) = gen_op_block_defn_rec(CLOSURE_CREATE, jv_string_value((yyvsp[(2) - (5)].literal)), body); - jv_free((yyvsp[(2) - (5)].literal)); + (yyval.blk) = (yyvsp[(2) - (3)].blk); } break; case 35: /* Line 1806 of yacc.c */ -#line 327 "parser.y" +#line 312 "parser.y" { - block body = block_bind(gen_op_block_unbound(CLOSURE_PARAM, jv_string_value((yyvsp[(4) - (8)].literal))), block_join((yyvsp[(7) - (8)].blk), gen_op_simple(RET)), OP_IS_CALL_PSEUDO); - (yyval.blk) = gen_op_block_defn_rec(CLOSURE_CREATE, jv_string_value((yyvsp[(2) - (8)].literal)), body); - jv_free((yyvsp[(2) - (8)].literal)); - jv_free((yyvsp[(4) - (8)].literal)); + (yyval.blk) = gen_function(jv_string_value((yyvsp[(2) - (5)].literal)), (yyvsp[(4) - (5)].blk)); + jv_free((yyvsp[(2) - (5)].literal)); } break; case 36: /* Line 1806 of yacc.c */ -#line 335 "parser.y" +#line 317 "parser.y" { - (yyval.blk) = gen_op_const(LOADK, jv_string("")); + block body = block_bind(gen_op_block_unbound(CLOSURE_PARAM, jv_string_value((yyvsp[(4) - (8)].literal))), (yyvsp[(7) - (8)].blk), OP_IS_CALL_PSEUDO); + (yyval.blk) = gen_function(jv_string_value((yyvsp[(2) - (8)].literal)), body); + jv_free((yyvsp[(2) - (8)].literal)); + jv_free((yyvsp[(4) - (8)].literal)); } break; case 37: /* Line 1806 of yacc.c */ -#line 338 "parser.y" +#line 325 "parser.y" { - (yyval.blk) = gen_binop((yyvsp[(1) - (2)].blk), gen_op_const(LOADK, (yyvsp[(2) - (2)].literal)), '+'); + (yyval.blk) = gen_op_const(LOADK, jv_string("")); } break; case 38: /* Line 1806 of yacc.c */ -#line 341 "parser.y" +#line 328 "parser.y" { - (yyval.blk) = gen_binop((yyvsp[(1) - (4)].blk), gen_format((yyvsp[(3) - (4)].blk)), '+'); + (yyval.blk) = gen_binop((yyvsp[(1) - (2)].blk), gen_op_const(LOADK, (yyvsp[(2) - (2)].literal)), '+'); } break; case 39: /* Line 1806 of yacc.c */ -#line 347 "parser.y" +#line 331 "parser.y" { - (yyval.blk) = gen_cond((yyvsp[(2) - (5)].blk), (yyvsp[(4) - (5)].blk), (yyvsp[(5) - (5)].blk)); + (yyval.blk) = gen_binop((yyvsp[(1) - (4)].blk), gen_format((yyvsp[(3) - (4)].blk)), '+'); } break; case 40: /* Line 1806 of yacc.c */ -#line 350 "parser.y" +#line 337 "parser.y" { - (yyval.blk) = (yyvsp[(2) - (3)].blk); + (yyval.blk) = gen_cond((yyvsp[(2) - (5)].blk), (yyvsp[(4) - (5)].blk), (yyvsp[(5) - (5)].blk)); } break; case 41: /* Line 1806 of yacc.c */ -#line 355 "parser.y" - { - (yyval.blk) = block_join((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk)); +#line 340 "parser.y" + { + (yyval.blk) = (yyvsp[(2) - (3)].blk); } break; case 42: /* Line 1806 of yacc.c */ -#line 359 "parser.y" - { - (yyval.blk) = (yyvsp[(1) - (1)].blk); +#line 345 "parser.y" + { + (yyval.blk) = block_join((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk)); } break; case 43: /* Line 1806 of yacc.c */ -#line 365 "parser.y" +#line 349 "parser.y" { - (yyval.blk) = gen_noop(); + (yyval.blk) = (yyvsp[(1) - (1)].blk); } break; case 44: /* Line 1806 of yacc.c */ -#line 368 "parser.y" +#line 355 "parser.y" { - (yyval.blk) = gen_index((yyvsp[(1) - (3)].blk), gen_op_const(LOADK, (yyvsp[(3) - (3)].literal))); + (yyval.blk) = gen_noop(); } break; case 45: /* Line 1806 of yacc.c */ -#line 371 "parser.y" - { - (yyval.blk) = gen_index(gen_noop(), gen_op_const(LOADK, (yyvsp[(2) - (2)].literal))); +#line 358 "parser.y" + { + (yyval.blk) = gen_index((yyvsp[(1) - (3)].blk), gen_op_const(LOADK, (yyvsp[(3) - (3)].literal))); } break; case 46: /* Line 1806 of yacc.c */ -#line 375 "parser.y" - { - (yyval.blk) = gen_index((yyvsp[(1) - (4)].blk), (yyvsp[(3) - (4)].blk)); +#line 361 "parser.y" + { + (yyval.blk) = gen_index(gen_noop(), gen_op_const(LOADK, (yyvsp[(2) - (2)].literal))); } break; case 47: /* Line 1806 of yacc.c */ -#line 378 "parser.y" +#line 365 "parser.y" { - (yyval.blk) = block_join((yyvsp[(1) - (3)].blk), gen_op_simple(EACH)); + (yyval.blk) = gen_index((yyvsp[(1) - (4)].blk), (yyvsp[(3) - (4)].blk)); } break; case 48: /* Line 1806 of yacc.c */ -#line 381 "parser.y" +#line 368 "parser.y" { - (yyval.blk) = gen_op_const(LOADK, (yyvsp[(1) - (1)].literal)); + (yyval.blk) = block_join((yyvsp[(1) - (3)].blk), gen_op_simple(EACH)); } break; case 49: /* Line 1806 of yacc.c */ -#line 384 "parser.y" +#line 371 "parser.y" { - (yyval.blk) = (yyvsp[(1) - (1)].blk); + (yyval.blk) = gen_op_const(LOADK, (yyvsp[(1) - (1)].literal)); } break; case 50: /* Line 1806 of yacc.c */ -#line 387 "parser.y" - { - (yyval.blk) = (yyvsp[(2) - (3)].blk); +#line 374 "parser.y" + { + (yyval.blk) = (yyvsp[(1) - (1)].blk); } break; case 51: /* Line 1806 of yacc.c */ -#line 390 "parser.y" +#line 377 "parser.y" { - (yyval.blk) = gen_collect((yyvsp[(2) - (3)].blk)); + (yyval.blk) = (yyvsp[(2) - (3)].blk); } break; case 52: /* Line 1806 of yacc.c */ -#line 393 "parser.y" +#line 380 "parser.y" { - (yyval.blk) = gen_op_const(LOADK, jv_array()); + (yyval.blk) = gen_collect((yyvsp[(2) - (3)].blk)); } break; case 53: /* Line 1806 of yacc.c */ -#line 396 "parser.y" +#line 383 "parser.y" { - (yyval.blk) = gen_subexp(gen_op_const(LOADK, jv_object())); - block_append(&(yyval.blk), (yyvsp[(2) - (3)].blk)); - block_append(&(yyval.blk), gen_op_simple(POP)); + (yyval.blk) = gen_op_const(LOADK, jv_array()); } break; case 54: /* Line 1806 of yacc.c */ -#line 401 "parser.y" - { - (yyval.blk) = gen_location((yyloc), gen_op_var_unbound(LOADV, jv_string_value((yyvsp[(2) - (2)].literal)))); - jv_free((yyvsp[(2) - (2)].literal)); +#line 386 "parser.y" + { + (yyval.blk) = BLOCK(gen_subexp(gen_op_const(LOADK, jv_object())), (yyvsp[(2) - (3)].blk), gen_op_simple(POP)); } break; case 55: /* Line 1806 of yacc.c */ -#line 405 "parser.y" +#line 389 "parser.y" { - (yyval.blk) = gen_location((yyloc), gen_op_call(CALL_1_1, gen_op_block_unbound(CLOSURE_REF, jv_string_value((yyvsp[(1) - (1)].literal))))); - jv_free((yyvsp[(1) - (1)].literal)); + (yyval.blk) = gen_location((yyloc), gen_op_var_unbound(LOADV, jv_string_value((yyvsp[(2) - (2)].literal)))); + jv_free((yyvsp[(2) - (2)].literal)); } break; case 56: /* Line 1806 of yacc.c */ -#line 409 "parser.y" +#line 393 "parser.y" { - (yyval.blk) = gen_op_call(CALL_1_1, - block_join(gen_op_block_unbound(CLOSURE_REF, jv_string_value((yyvsp[(1) - (4)].literal))), - block_bind(gen_op_block_defn(CLOSURE_CREATE, - "lambda", - block_join((yyvsp[(3) - (4)].blk), gen_op_simple(RET))), - gen_noop(), OP_IS_CALL_PSEUDO))); - (yyval.blk) = gen_location((yylsp[(1) - (4)]), (yyval.blk)); - jv_free((yyvsp[(1) - (4)].literal)); + (yyval.blk) = gen_location((yyloc), gen_call(jv_string_value((yyvsp[(1) - (1)].literal)), gen_noop())); + jv_free((yyvsp[(1) - (1)].literal)); } break; case 57: /* Line 1806 of yacc.c */ -#line 419 "parser.y" - { (yyval.blk) = gen_noop(); } +#line 397 "parser.y" + { + (yyval.blk) = gen_call(jv_string_value((yyvsp[(1) - (4)].literal)), gen_lambda((yyvsp[(3) - (4)].blk))); + (yyval.blk) = gen_location((yylsp[(1) - (4)]), (yyval.blk)); + jv_free((yyvsp[(1) - (4)].literal)); +} break; case 58: /* Line 1806 of yacc.c */ -#line 420 "parser.y" +#line 402 "parser.y" { (yyval.blk) = gen_noop(); } break; case 59: /* Line 1806 of yacc.c */ -#line 421 "parser.y" - { (yyval.blk) = (yyvsp[(1) - (4)].blk); } +#line 403 "parser.y" + { (yyval.blk) = gen_noop(); } break; case 60: /* Line 1806 of yacc.c */ -#line 422 "parser.y" - { (yyval.blk) = gen_noop(); } +#line 404 "parser.y" + { (yyval.blk) = (yyvsp[(1) - (4)].blk); } break; case 61: /* Line 1806 of yacc.c */ -#line 425 "parser.y" - { - (yyval.blk)=gen_noop(); -} +#line 405 "parser.y" + { (yyval.blk) = gen_noop(); } break; case 62: /* Line 1806 of yacc.c */ -#line 428 "parser.y" - { (yyval.blk) = (yyvsp[(1) - (1)].blk); } +#line 408 "parser.y" + { + (yyval.blk)=gen_noop(); +} break; case 63: /* Line 1806 of yacc.c */ -#line 429 "parser.y" - { (yyval.blk)=block_join((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk)); } +#line 411 "parser.y" + { (yyval.blk) = (yyvsp[(1) - (1)].blk); } break; case 64: /* Line 1806 of yacc.c */ -#line 430 "parser.y" - { (yyval.blk) = (yyvsp[(3) - (3)].blk); } +#line 412 "parser.y" + { (yyval.blk)=block_join((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk)); } break; case 65: /* Line 1806 of yacc.c */ -#line 433 "parser.y" - { - (yyval.blk) = gen_dictpair(gen_op_const(LOADK, (yyvsp[(1) - (3)].literal)), (yyvsp[(3) - (3)].blk)); - } +#line 413 "parser.y" + { (yyval.blk) = (yyvsp[(3) - (3)].blk); } break; case 66: /* Line 1806 of yacc.c */ -#line 436 "parser.y" - { - (yyval.blk) = gen_dictpair((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk)); - } +#line 416 "parser.y" + { + (yyval.blk) = gen_dictpair(gen_op_const(LOADK, (yyvsp[(1) - (3)].literal)), (yyvsp[(3) - (3)].blk)); + } break; case 67: /* Line 1806 of yacc.c */ -#line 439 "parser.y" +#line 419 "parser.y" { - (yyval.blk) = gen_dictpair(gen_op_const(LOADK, jv_copy((yyvsp[(1) - (1)].literal))), - gen_index(gen_noop(), gen_op_const(LOADK, (yyvsp[(1) - (1)].literal)))); + (yyval.blk) = gen_dictpair((yyvsp[(1) - (3)].blk), (yyvsp[(3) - (3)].blk)); } break; case 68: /* Line 1806 of yacc.c */ -#line 443 "parser.y" +#line 422 "parser.y" { - (yyval.blk) = gen_dictpair((yyvsp[(2) - (5)].blk), (yyvsp[(5) - (5)].blk)); + (yyval.blk) = gen_dictpair(gen_op_const(LOADK, jv_copy((yyvsp[(1) - (1)].literal))), + gen_index(gen_noop(), gen_op_const(LOADK, (yyvsp[(1) - (1)].literal)))); } break; case 69: /* Line 1806 of yacc.c */ -#line 446 "parser.y" +#line 426 "parser.y" + { + (yyval.blk) = gen_dictpair((yyvsp[(2) - (5)].blk), (yyvsp[(5) - (5)].blk)); + } + break; + + case 70: + +/* Line 1806 of yacc.c */ +#line 429 "parser.y" { (yyval.blk) = (yyvsp[(5) - (5)].blk); } break; @@ -2823,7 +2823,7 @@ yyreturn: /* Line 2067 of yacc.c */ -#line 447 "parser.y" +#line 430 "parser.y" int jq_parse(struct locfile* locations, block* answer) { diff --git a/parser.gen.h b/parser.gen.h index f5471c26..bf9f9f8c 100644 --- a/parser.gen.h +++ b/parser.gen.h @@ -82,11 +82,12 @@ SETDEFINEDOR = 278, LESSEQ = 279, GREATEREQ = 280, - QQSTRING_START = 281, - QQSTRING_TEXT = 282, - QQSTRING_INTERP_START = 283, - QQSTRING_INTERP_END = 284, - QQSTRING_END = 285 + CONTAINS = 281, + QQSTRING_START = 282, + QQSTRING_TEXT = 283, + QQSTRING_INTERP_START = 284, + QQSTRING_INTERP_END = 285, + QQSTRING_END = 286 }; #endif @@ -105,7 +106,7 @@ typedef union YYSTYPE /* Line 2068 of yacc.c */ -#line 109 "parser.gen.h" +#line 110 "parser.gen.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/parser.gen.info b/parser.gen.info index 4a90d13c..8f1f5656 100644 --- a/parser.gen.info +++ b/parser.gen.info @@ -39,90 +39,91 @@ Grammar 28 | Exp '>' Exp 29 | Exp "<=" Exp 30 | Exp ">=" Exp - 31 | Term + 31 | Exp "contains" Exp + 32 | Term - 32 String: QQSTRING_START QQString QQSTRING_END + 33 String: QQSTRING_START QQString QQSTRING_END - 33 FuncDef: "def" IDENT ':' Exp ';' - 34 | "def" IDENT '(' IDENT ')' ':' Exp ';' + 34 FuncDef: "def" IDENT ':' Exp ';' + 35 | "def" IDENT '(' IDENT ')' ':' Exp ';' - 35 QQString: /* empty */ - 36 | QQString QQSTRING_TEXT - 37 | QQString QQSTRING_INTERP_START Exp QQSTRING_INTERP_END + 36 QQString: /* empty */ + 37 | QQString QQSTRING_TEXT + 38 | QQString QQSTRING_INTERP_START Exp QQSTRING_INTERP_END - 38 ElseBody: "elif" Exp "then" Exp ElseBody - 39 | "else" Exp "end" + 39 ElseBody: "elif" Exp "then" Exp ElseBody + 40 | "else" Exp "end" - 40 ExpD: ExpD '|' ExpD - 41 | Term + 41 ExpD: ExpD '|' ExpD + 42 | Term - 42 Term: '.' - 43 | Term '.' IDENT - 44 | '.' IDENT - 45 | Term '[' Exp ']' - 46 | Term '[' ']' - 47 | LITERAL - 48 | String - 49 | '(' Exp ')' - 50 | '[' Exp ']' - 51 | '[' ']' - 52 | '{' MkDict '}' - 53 | '$' IDENT - 54 | IDENT - 55 | IDENT '(' Exp ')' - 56 | '(' error ')' - 57 | '[' error ']' - 58 | Term '[' error ']' - 59 | '{' error '}' + 43 Term: '.' + 44 | Term '.' IDENT + 45 | '.' IDENT + 46 | Term '[' Exp ']' + 47 | Term '[' ']' + 48 | LITERAL + 49 | String + 50 | '(' Exp ')' + 51 | '[' Exp ']' + 52 | '[' ']' + 53 | '{' MkDict '}' + 54 | '$' IDENT + 55 | IDENT + 56 | IDENT '(' Exp ')' + 57 | '(' error ')' + 58 | '[' error ']' + 59 | Term '[' error ']' + 60 | '{' error '}' - 60 MkDict: /* empty */ - 61 | MkDictPair - 62 | MkDictPair ',' MkDict - 63 | error ',' MkDict + 61 MkDict: /* empty */ + 62 | MkDictPair + 63 | MkDictPair ',' MkDict + 64 | error ',' MkDict - 64 MkDictPair: IDENT ':' ExpD - 65 | String ':' ExpD - 66 | IDENT - 67 | '(' Exp ')' ':' ExpD - 68 | '(' error ')' ':' ExpD + 65 MkDictPair: IDENT ':' ExpD + 66 | String ':' ExpD + 67 | IDENT + 68 | '(' Exp ')' ':' ExpD + 69 | '(' error ')' ':' ExpD Terminals, with rules where they appear $end (0) 0 -'$' (36) 6 53 -'(' (40) 34 49 55 56 67 68 -')' (41) 34 49 55 56 67 68 +'$' (36) 6 54 +'(' (40) 35 50 56 57 68 69 +')' (41) 35 50 56 57 68 69 '*' (42) 21 '+' (43) 17 -',' (44) 16 62 63 +',' (44) 16 63 64 '-' (45) 19 -'.' (46) 42 43 44 +'.' (46) 43 44 45 '/' (47) 23 -':' (58) 33 34 64 65 67 68 -';' (59) 33 34 +':' (58) 34 35 65 66 68 69 +';' (59) 34 35 '<' (60) 27 '=' (61) 9 '>' (62) 28 -'[' (91) 45 46 50 51 57 58 -']' (93) 45 46 50 51 57 58 -'{' (123) 52 59 -'|' (124) 6 15 40 -'}' (125) 52 59 -error (256) 8 56 57 58 59 63 68 +'[' (91) 46 47 51 52 58 59 +']' (93) 46 47 51 52 58 59 +'{' (123) 53 60 +'|' (124) 6 15 41 +'}' (125) 53 60 +error (256) 8 57 58 59 60 64 69 INVALID_CHARACTER (258) -IDENT (259) 6 33 34 43 44 53 54 55 64 66 -LITERAL (260) 47 +IDENT (259) 6 34 35 44 45 54 55 56 65 67 +LITERAL (260) 48 "==" (261) 25 "!=" (262) 26 "//" (263) 12 "as" (264) 6 -"def" (265) 33 34 +"def" (265) 34 35 "if" (266) 7 8 -"then" (267) 7 38 -"else" (268) 39 -"elif" (269) 38 -"end" (270) 39 +"then" (267) 7 39 +"else" (268) 40 +"elif" (269) 39 +"end" (270) 40 "and" (271) 11 "or" (272) 10 "|=" (273) 14 @@ -133,43 +134,44 @@ LITERAL (260) 47 "//=" (278) 13 "<=" (279) 29 ">=" (280) 30 -QQSTRING_START (281) 32 -QQSTRING_TEXT (282) 36 -QQSTRING_INTERP_START (283) 37 -QQSTRING_INTERP_END (284) 37 -QQSTRING_END (285) 32 +"contains" (281) 31 +QQSTRING_START (282) 33 +QQSTRING_TEXT (283) 37 +QQSTRING_INTERP_START (284) 38 +QQSTRING_INTERP_END (285) 38 +QQSTRING_END (286) 33 Nonterminals, with rules where they appear -$accept (50) +$accept (51) on left: 0 -TopLevel (51) +TopLevel (52) on left: 1 2, on right: 0 -FuncDefs (52) +FuncDefs (53) on left: 3 4, on right: 2 4 -Exp (53) +Exp (54) on left: 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 - 25 26 27 28 29 30 31, on right: 1 5 6 7 8 9 10 11 12 13 14 15 16 - 17 18 19 20 21 22 23 24 25 26 27 28 29 30 33 34 37 38 39 45 49 - 50 55 67 -String (54) - on left: 32, on right: 48 65 -FuncDef (55) - on left: 33 34, on right: 4 5 -QQString (56) - on left: 35 36 37, on right: 32 36 37 -ElseBody (57) - on left: 38 39, on right: 7 38 -ExpD (58) - on left: 40 41, on right: 40 64 65 67 68 -Term (59) - on left: 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59, - on right: 6 31 41 43 45 46 58 -MkDict (60) - on left: 60 61 62 63, on right: 52 62 63 -MkDictPair (61) - on left: 64 65 66 67 68, on right: 61 62 + 25 26 27 28 29 30 31 32, on right: 1 5 6 7 8 9 10 11 12 13 14 15 + 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 34 35 38 39 40 + 46 50 51 56 68 +String (55) + on left: 33, on right: 49 66 +FuncDef (56) + on left: 34 35, on right: 4 5 +QQString (57) + on left: 36 37 38, on right: 33 37 38 +ElseBody (58) + on left: 39 40, on right: 7 39 +ExpD (59) + on left: 41 42, on right: 41 65 66 68 69 +Term (60) + on left: 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60, + on right: 6 32 42 44 46 47 59 +MkDict (61) + on left: 61 62 63 64, on right: 53 63 64 +MkDictPair (62) + on left: 65 66 67 68 69, on right: 62 63 state 0 @@ -199,25 +201,25 @@ state 0 state 1 - 54 Term: IDENT . - 55 | IDENT . '(' Exp ')' + 55 Term: IDENT . + 56 | IDENT . '(' Exp ')' '(' shift, and go to state 17 - $default reduce using rule 54 (Term) + $default reduce using rule 55 (Term) state 2 - 47 Term: LITERAL . + 48 Term: LITERAL . - $default reduce using rule 47 (Term) + $default reduce using rule 48 (Term) state 3 - 33 FuncDef: "def" . IDENT ':' Exp ';' - 34 | "def" . IDENT '(' IDENT ')' ':' Exp ';' + 34 FuncDef: "def" . IDENT ':' Exp ';' + 35 | "def" . IDENT '(' IDENT ')' ':' Exp ';' IDENT shift, and go to state 18 @@ -246,24 +248,24 @@ state 4 state 5 - 32 String: QQSTRING_START . QQString QQSTRING_END + 33 String: QQSTRING_START . QQString QQSTRING_END - $default reduce using rule 35 (QQString) + $default reduce using rule 36 (QQString) QQString go to state 21 state 6 - 53 Term: '$' . IDENT + 54 Term: '$' . IDENT IDENT shift, and go to state 22 state 7 - 49 Term: '(' . Exp ')' - 56 | '(' . error ')' + 50 Term: '(' . Exp ')' + 57 | '(' . error ')' error shift, and go to state 23 IDENT shift, and go to state 1 @@ -285,19 +287,19 @@ state 7 state 8 - 42 Term: '.' . - 44 | '.' . IDENT + 43 Term: '.' . + 45 | '.' . IDENT IDENT shift, and go to state 25 - $default reduce using rule 42 (Term) + $default reduce using rule 43 (Term) state 9 - 50 Term: '[' . Exp ']' - 51 | '[' . ']' - 57 | '[' . error ']' + 51 Term: '[' . Exp ']' + 52 | '[' . ']' + 58 | '[' . error ']' error shift, and go to state 26 IDENT shift, and go to state 1 @@ -320,15 +322,15 @@ state 9 state 10 - 52 Term: '{' . MkDict '}' - 59 | '{' . error '}' + 53 Term: '{' . MkDict '}' + 60 | '{' . error '}' error shift, and go to state 29 IDENT shift, and go to state 30 QQSTRING_START shift, and go to state 5 '(' shift, and go to state 31 - '}' reduce using rule 60 (MkDict) + '}' reduce using rule 61 (MkDict) String go to state 32 MkDict go to state 33 @@ -374,38 +376,40 @@ state 13 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 $default reduce using rule 1 (TopLevel) state 14 - 48 Term: String . + 49 Term: String . - $default reduce using rule 48 (Term) + $default reduce using rule 49 (Term) state 15 @@ -426,8 +430,8 @@ state 15 $default reduce using rule 3 (FuncDefs) - FuncDefs go to state 58 - Exp go to state 59 + FuncDefs go to state 59 + Exp go to state 60 String go to state 14 FuncDef go to state 15 Term go to state 16 @@ -436,22 +440,22 @@ state 15 state 16 6 Exp: Term . "as" '$' IDENT '|' Exp - 31 | Term . - 43 Term: Term . '.' IDENT - 45 | Term . '[' Exp ']' - 46 | Term . '[' ']' - 58 | Term . '[' error ']' + 32 | Term . + 44 Term: Term . '.' IDENT + 46 | Term . '[' Exp ']' + 47 | Term . '[' ']' + 59 | Term . '[' error ']' - "as" shift, and go to state 60 - '.' shift, and go to state 61 - '[' shift, and go to state 62 + "as" shift, and go to state 61 + '.' shift, and go to state 62 + '[' shift, and go to state 63 - $default reduce using rule 31 (Exp) + $default reduce using rule 32 (Exp) state 17 - 55 Term: IDENT '(' . Exp ')' + 56 Term: IDENT '(' . Exp ')' IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -464,7 +468,7 @@ state 17 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 63 + Exp go to state 64 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -472,11 +476,11 @@ state 17 state 18 - 33 FuncDef: "def" IDENT . ':' Exp ';' - 34 | "def" IDENT . '(' IDENT ')' ':' Exp ';' + 34 FuncDef: "def" IDENT . ':' Exp ';' + 35 | "def" IDENT . '(' IDENT ')' ':' Exp ';' - ':' shift, and go to state 64 - '(' shift, and go to state 65 + ':' shift, and go to state 65 + '(' shift, and go to state 66 state 19 @@ -505,31 +509,33 @@ state 19 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - error shift, and go to state 66 - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "then" shift, and go to state 67 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + error shift, and go to state 67 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "then" shift, and go to state 68 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 state 20 @@ -547,7 +553,7 @@ state 20 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 59 + Exp go to state 60 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -555,27 +561,27 @@ state 20 state 21 - 32 String: QQSTRING_START QQString . QQSTRING_END - 36 QQString: QQString . QQSTRING_TEXT - 37 | QQString . QQSTRING_INTERP_START Exp QQSTRING_INTERP_END + 33 String: QQSTRING_START QQString . QQSTRING_END + 37 QQString: QQString . QQSTRING_TEXT + 38 | QQString . QQSTRING_INTERP_START Exp QQSTRING_INTERP_END - QQSTRING_TEXT shift, and go to state 68 - QQSTRING_INTERP_START shift, and go to state 69 - QQSTRING_END shift, and go to state 70 + QQSTRING_TEXT shift, and go to state 69 + QQSTRING_INTERP_START shift, and go to state 70 + QQSTRING_END shift, and go to state 71 state 22 - 53 Term: '$' IDENT . + 54 Term: '$' IDENT . - $default reduce using rule 53 (Term) + $default reduce using rule 54 (Term) state 23 - 56 Term: '(' error . ')' + 57 Term: '(' error . ')' - ')' shift, and go to state 71 + ')' shift, and go to state 72 state 24 @@ -602,52 +608,54 @@ state 24 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp - 49 Term: '(' Exp . ')' + 31 | Exp . "contains" Exp + 50 Term: '(' Exp . ')' - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 - ')' shift, and go to state 72 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 + ')' shift, and go to state 73 state 25 - 44 Term: '.' IDENT . + 45 Term: '.' IDENT . - $default reduce using rule 44 (Term) + $default reduce using rule 45 (Term) state 26 - 57 Term: '[' error . ']' + 58 Term: '[' error . ']' - ']' shift, and go to state 73 + ']' shift, and go to state 74 state 27 - 51 Term: '[' ']' . + 52 Term: '[' ']' . - $default reduce using rule 51 (Term) + $default reduce using rule 52 (Term) state 28 @@ -674,58 +682,60 @@ state 28 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp - 50 Term: '[' Exp . ']' + 31 | Exp . "contains" Exp + 51 Term: '[' Exp . ']' - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 - ']' shift, and go to state 74 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 + ']' shift, and go to state 75 state 29 - 59 Term: '{' error . '}' - 63 MkDict: error . ',' MkDict + 60 Term: '{' error . '}' + 64 MkDict: error . ',' MkDict - ',' shift, and go to state 75 - '}' shift, and go to state 76 + ',' shift, and go to state 76 + '}' shift, and go to state 77 state 30 - 64 MkDictPair: IDENT . ':' ExpD - 66 | IDENT . + 65 MkDictPair: IDENT . ':' ExpD + 67 | IDENT . - ':' shift, and go to state 77 + ':' shift, and go to state 78 - $default reduce using rule 66 (MkDictPair) + $default reduce using rule 67 (MkDictPair) state 31 - 67 MkDictPair: '(' . Exp ')' ':' ExpD - 68 | '(' . error ')' ':' ExpD + 68 MkDictPair: '(' . Exp ')' ':' ExpD + 69 | '(' . error ')' ':' ExpD - error shift, and go to state 78 + error shift, and go to state 79 IDENT shift, and go to state 1 LITERAL shift, and go to state 2 "def" shift, and go to state 3 @@ -737,7 +747,7 @@ state 31 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 79 + Exp go to state 80 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -745,26 +755,26 @@ state 31 state 32 - 65 MkDictPair: String . ':' ExpD + 66 MkDictPair: String . ':' ExpD - ':' shift, and go to state 80 + ':' shift, and go to state 81 state 33 - 52 Term: '{' MkDict . '}' + 53 Term: '{' MkDict . '}' - '}' shift, and go to state 81 + '}' shift, and go to state 82 state 34 - 61 MkDict: MkDictPair . - 62 | MkDictPair . ',' MkDict + 62 MkDict: MkDictPair . + 63 | MkDictPair . ',' MkDict - ',' shift, and go to state 82 + ',' shift, and go to state 83 - $default reduce using rule 61 (MkDict) + $default reduce using rule 62 (MkDict) state 35 @@ -789,7 +799,7 @@ state 36 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 83 + Exp go to state 84 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -810,7 +820,7 @@ state 37 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 84 + Exp go to state 85 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -831,7 +841,7 @@ state 38 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 85 + Exp go to state 86 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -852,7 +862,7 @@ state 39 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 86 + Exp go to state 87 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -873,7 +883,7 @@ state 40 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 87 + Exp go to state 88 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -894,7 +904,7 @@ state 41 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 88 + Exp go to state 89 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -915,7 +925,7 @@ state 42 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 89 + Exp go to state 90 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -936,7 +946,7 @@ state 43 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 90 + Exp go to state 91 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -957,7 +967,7 @@ state 44 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 91 + Exp go to state 92 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -978,7 +988,7 @@ state 45 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 92 + Exp go to state 93 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -999,7 +1009,7 @@ state 46 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 93 + Exp go to state 94 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -1020,7 +1030,7 @@ state 47 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 94 + Exp go to state 95 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -1041,7 +1051,7 @@ state 48 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 95 + Exp go to state 96 String go to state 14 FuncDef go to state 20 Term go to state 16 @@ -1049,28 +1059,7 @@ state 48 state 49 - 15 Exp: Exp '|' . Exp - - IDENT shift, and go to state 1 - LITERAL shift, and go to state 2 - "def" shift, and go to state 3 - "if" shift, and go to state 4 - QQSTRING_START shift, and go to state 5 - '$' shift, and go to state 6 - '(' shift, and go to state 7 - '.' shift, and go to state 8 - '[' shift, and go to state 9 - '{' shift, and go to state 10 - - Exp go to state 96 - String go to state 14 - FuncDef go to state 20 - Term go to state 16 - - -state 50 - - 16 Exp: Exp ',' . Exp + 31 Exp: Exp "contains" . Exp IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -1089,9 +1078,9 @@ state 50 Term go to state 16 -state 51 +state 50 - 9 Exp: Exp '=' . Exp + 15 Exp: Exp '|' . Exp IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -1110,9 +1099,9 @@ state 51 Term go to state 16 -state 52 +state 51 - 27 Exp: Exp '<' . Exp + 16 Exp: Exp ',' . Exp IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -1131,9 +1120,9 @@ state 52 Term go to state 16 -state 53 +state 52 - 28 Exp: Exp '>' . Exp + 9 Exp: Exp '=' . Exp IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -1152,9 +1141,9 @@ state 53 Term go to state 16 -state 54 +state 53 - 17 Exp: Exp '+' . Exp + 27 Exp: Exp '<' . Exp IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -1173,9 +1162,9 @@ state 54 Term go to state 16 -state 55 +state 54 - 19 Exp: Exp '-' . Exp + 28 Exp: Exp '>' . Exp IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -1194,9 +1183,9 @@ state 55 Term go to state 16 -state 56 +state 55 - 21 Exp: Exp '*' . Exp + 17 Exp: Exp '+' . Exp IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -1215,9 +1204,9 @@ state 56 Term go to state 16 -state 57 +state 56 - 23 Exp: Exp '/' . Exp + 19 Exp: Exp '-' . Exp IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -1236,14 +1225,56 @@ state 57 Term go to state 16 +state 57 + + 21 Exp: Exp '*' . Exp + + IDENT shift, and go to state 1 + LITERAL shift, and go to state 2 + "def" shift, and go to state 3 + "if" shift, and go to state 4 + QQSTRING_START shift, and go to state 5 + '$' shift, and go to state 6 + '(' shift, and go to state 7 + '.' shift, and go to state 8 + '[' shift, and go to state 9 + '{' shift, and go to state 10 + + Exp go to state 105 + String go to state 14 + FuncDef go to state 20 + Term go to state 16 + + state 58 + 23 Exp: Exp '/' . Exp + + IDENT shift, and go to state 1 + LITERAL shift, and go to state 2 + "def" shift, and go to state 3 + "if" shift, and go to state 4 + QQSTRING_START shift, and go to state 5 + '$' shift, and go to state 6 + '(' shift, and go to state 7 + '.' shift, and go to state 8 + '[' shift, and go to state 9 + '{' shift, and go to state 10 + + Exp go to state 106 + String go to state 14 + FuncDef go to state 20 + Term go to state 16 + + +state 59 + 4 FuncDefs: FuncDef FuncDefs . $default reduce using rule 4 (FuncDefs) -state 59 +state 60 5 Exp: FuncDef Exp . 9 | Exp . '=' Exp @@ -1268,54 +1299,56 @@ state 59 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 $default reduce using rule 5 (Exp) -state 60 +state 61 6 Exp: Term "as" . '$' IDENT '|' Exp - '$' shift, and go to state 105 - - -state 61 - - 43 Term: Term '.' . IDENT - - IDENT shift, and go to state 106 + '$' shift, and go to state 107 state 62 - 45 Term: Term '[' . Exp ']' - 46 | Term '[' . ']' - 58 | Term '[' . error ']' + 44 Term: Term '.' . IDENT - error shift, and go to state 107 + IDENT shift, and go to state 108 + + +state 63 + + 46 Term: Term '[' . Exp ']' + 47 | Term '[' . ']' + 59 | Term '[' . error ']' + + error shift, and go to state 109 IDENT shift, and go to state 1 LITERAL shift, and go to state 2 "def" shift, and go to state 3 @@ -1325,16 +1358,16 @@ state 62 '(' shift, and go to state 7 '.' shift, and go to state 8 '[' shift, and go to state 9 - ']' shift, and go to state 108 + ']' shift, and go to state 110 '{' shift, and go to state 10 - Exp go to state 109 + Exp go to state 111 String go to state 14 FuncDef go to state 20 Term go to state 16 -state 63 +state 64 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -1358,71 +1391,38 @@ state 63 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp - 55 Term: IDENT '(' Exp . ')' + 31 | Exp . "contains" Exp + 56 Term: IDENT '(' Exp . ')' - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 - ')' shift, and go to state 110 - - -state 64 - - 33 FuncDef: "def" IDENT ':' . Exp ';' - - IDENT shift, and go to state 1 - LITERAL shift, and go to state 2 - "def" shift, and go to state 3 - "if" shift, and go to state 4 - QQSTRING_START shift, and go to state 5 - '$' shift, and go to state 6 - '(' shift, and go to state 7 - '.' shift, and go to state 8 - '[' shift, and go to state 9 - '{' shift, and go to state 10 - - Exp go to state 111 - String go to state 14 - FuncDef go to state 20 - Term go to state 16 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 + ')' shift, and go to state 112 state 65 - 34 FuncDef: "def" IDENT '(' . IDENT ')' ':' Exp ';' - - IDENT shift, and go to state 112 - - -state 66 - - 8 Exp: "if" Exp error . - - $default reduce using rule 8 (Exp) - - -state 67 - - 7 Exp: "if" Exp "then" . Exp ElseBody + 34 FuncDef: "def" IDENT ':' . Exp ';' IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -1441,16 +1441,23 @@ state 67 Term go to state 16 +state 66 + + 35 FuncDef: "def" IDENT '(' . IDENT ')' ':' Exp ';' + + IDENT shift, and go to state 114 + + +state 67 + + 8 Exp: "if" Exp error . + + $default reduce using rule 8 (Exp) + + state 68 - 36 QQString: QQString QQSTRING_TEXT . - - $default reduce using rule 36 (QQString) - - -state 69 - - 37 QQString: QQString QQSTRING_INTERP_START . Exp QQSTRING_INTERP_END + 7 Exp: "if" Exp "then" . Exp ElseBody IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -1463,73 +1470,101 @@ state 69 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 114 + Exp go to state 115 String go to state 14 FuncDef go to state 20 Term go to state 16 +state 69 + + 37 QQString: QQString QQSTRING_TEXT . + + $default reduce using rule 37 (QQString) + + state 70 - 32 String: QQSTRING_START QQString QQSTRING_END . + 38 QQString: QQString QQSTRING_INTERP_START . Exp QQSTRING_INTERP_END - $default reduce using rule 32 (String) + IDENT shift, and go to state 1 + LITERAL shift, and go to state 2 + "def" shift, and go to state 3 + "if" shift, and go to state 4 + QQSTRING_START shift, and go to state 5 + '$' shift, and go to state 6 + '(' shift, and go to state 7 + '.' shift, and go to state 8 + '[' shift, and go to state 9 + '{' shift, and go to state 10 + + Exp go to state 116 + String go to state 14 + FuncDef go to state 20 + Term go to state 16 state 71 - 56 Term: '(' error ')' . + 33 String: QQSTRING_START QQString QQSTRING_END . - $default reduce using rule 56 (Term) + $default reduce using rule 33 (String) state 72 - 49 Term: '(' Exp ')' . - - $default reduce using rule 49 (Term) - - -state 73 - - 57 Term: '[' error ']' . + 57 Term: '(' error ')' . $default reduce using rule 57 (Term) -state 74 +state 73 - 50 Term: '[' Exp ']' . + 50 Term: '(' Exp ')' . $default reduce using rule 50 (Term) +state 74 + + 58 Term: '[' error ']' . + + $default reduce using rule 58 (Term) + + state 75 - 63 MkDict: error ',' . MkDict + 51 Term: '[' Exp ']' . - error shift, and go to state 115 - IDENT shift, and go to state 30 - QQSTRING_START shift, and go to state 5 - '(' shift, and go to state 31 - - '}' reduce using rule 60 (MkDict) - - String go to state 32 - MkDict go to state 116 - MkDictPair go to state 34 + $default reduce using rule 51 (Term) state 76 - 59 Term: '{' error '}' . + 64 MkDict: error ',' . MkDict - $default reduce using rule 59 (Term) + error shift, and go to state 117 + IDENT shift, and go to state 30 + QQSTRING_START shift, and go to state 5 + '(' shift, and go to state 31 + + '}' reduce using rule 61 (MkDict) + + String go to state 32 + MkDict go to state 118 + MkDictPair go to state 34 state 77 - 64 MkDictPair: IDENT ':' . ExpD + 60 Term: '{' error '}' . + + $default reduce using rule 60 (Term) + + +state 78 + + 65 MkDictPair: IDENT ':' . ExpD IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -1541,19 +1576,19 @@ state 77 '{' shift, and go to state 10 String go to state 14 - ExpD go to state 117 - Term go to state 118 - - -state 78 - - 68 MkDictPair: '(' error . ')' ':' ExpD - - ')' shift, and go to state 119 + ExpD go to state 119 + Term go to state 120 state 79 + 69 MkDictPair: '(' error . ')' ':' ExpD + + ')' shift, and go to state 121 + + +state 80 + 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp 11 | Exp . "and" Exp @@ -1576,36 +1611,38 @@ state 79 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp - 67 MkDictPair: '(' Exp . ')' ':' ExpD + 31 | Exp . "contains" Exp + 68 MkDictPair: '(' Exp . ')' ':' ExpD - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 - ')' shift, and go to state 120 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 + ')' shift, and go to state 122 -state 80 +state 81 - 65 MkDictPair: String ':' . ExpD + 66 MkDictPair: String ':' . ExpD IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -1617,34 +1654,34 @@ state 80 '{' shift, and go to state 10 String go to state 14 - ExpD go to state 121 - Term go to state 118 - - -state 81 - - 52 Term: '{' MkDict '}' . - - $default reduce using rule 52 (Term) + ExpD go to state 123 + Term go to state 120 state 82 - 62 MkDict: MkDictPair ',' . MkDict + 53 Term: '{' MkDict '}' . - error shift, and go to state 115 + $default reduce using rule 53 (Term) + + +state 83 + + 63 MkDict: MkDictPair ',' . MkDict + + error shift, and go to state 117 IDENT shift, and go to state 30 QQSTRING_START shift, and go to state 5 '(' shift, and go to state 31 - '}' reduce using rule 60 (MkDict) + '}' reduce using rule 61 (MkDict) String go to state 32 - MkDict go to state 122 + MkDict go to state 124 MkDictPair go to state 34 -state 83 +state 84 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -1669,23 +1706,25 @@ state 83 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 - "==" error (nonassociative) - "!=" error (nonassociative) - "<=" error (nonassociative) - ">=" error (nonassociative) - '<' error (nonassociative) - '>' error (nonassociative) + "==" error (nonassociative) + "!=" error (nonassociative) + "<=" error (nonassociative) + ">=" error (nonassociative) + "contains" error (nonassociative) + '<' error (nonassociative) + '>' error (nonassociative) $default reduce using rule 25 (Exp) -state 84 +state 85 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -1710,23 +1749,25 @@ state 84 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 - "==" error (nonassociative) - "!=" error (nonassociative) - "<=" error (nonassociative) - ">=" error (nonassociative) - '<' error (nonassociative) - '>' error (nonassociative) + "==" error (nonassociative) + "!=" error (nonassociative) + "<=" error (nonassociative) + ">=" error (nonassociative) + "contains" error (nonassociative) + '<' error (nonassociative) + '>' error (nonassociative) $default reduce using rule 26 (Exp) -state 85 +state 86 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -1751,32 +1792,34 @@ state 85 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 $default reduce using rule 12 (Exp) -state 86 +state 87 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -1801,22 +1844,24 @@ state 86 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 $default reduce using rule 11 (Exp) -state 87 +state 88 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -1841,23 +1886,25 @@ state 87 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "and" shift, and go to state 39 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "and" shift, and go to state 39 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 $default reduce using rule 10 (Exp) -state 88 +state 89 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -1882,19 +1929,21 @@ state 88 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 "|=" error (nonassociative) "+=" error (nonassociative) @@ -1907,7 +1956,7 @@ state 88 $default reduce using rule 14 (Exp) -state 89 +state 90 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -1932,19 +1981,21 @@ state 89 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 "|=" error (nonassociative) "+=" error (nonassociative) @@ -1957,7 +2008,7 @@ state 89 $default reduce using rule 18 (Exp) -state 90 +state 91 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -1982,19 +2033,21 @@ state 90 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 "|=" error (nonassociative) "+=" error (nonassociative) @@ -2007,7 +2060,7 @@ state 90 $default reduce using rule 20 (Exp) -state 91 +state 92 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -2032,19 +2085,21 @@ state 91 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 "|=" error (nonassociative) "+=" error (nonassociative) @@ -2057,7 +2112,7 @@ state 91 $default reduce using rule 22 (Exp) -state 92 +state 93 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -2082,19 +2137,21 @@ state 92 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 "|=" error (nonassociative) "+=" error (nonassociative) @@ -2107,7 +2164,7 @@ state 92 $default reduce using rule 24 (Exp) -state 93 +state 94 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -2132,19 +2189,21 @@ state 93 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 "|=" error (nonassociative) "+=" error (nonassociative) @@ -2157,47 +2216,6 @@ state 93 $default reduce using rule 13 (Exp) -state 94 - - 9 Exp: Exp . '=' Exp - 10 | Exp . "or" Exp - 11 | Exp . "and" Exp - 12 | Exp . "//" Exp - 13 | Exp . "//=" Exp - 14 | Exp . "|=" Exp - 15 | Exp . '|' Exp - 16 | Exp . ',' Exp - 17 | Exp . '+' Exp - 18 | Exp . "+=" Exp - 19 | Exp . '-' Exp - 20 | Exp . "-=" Exp - 21 | Exp . '*' Exp - 22 | Exp . "*=" Exp - 23 | Exp . '/' Exp - 24 | Exp . "/=" Exp - 25 | Exp . "==" Exp - 26 | Exp . "!=" Exp - 27 | Exp . '<' Exp - 28 | Exp . '>' Exp - 29 | Exp . "<=" Exp - 29 | Exp "<=" Exp . - 30 | Exp . ">=" Exp - - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 - - "==" error (nonassociative) - "!=" error (nonassociative) - "<=" error (nonassociative) - ">=" error (nonassociative) - '<' error (nonassociative) - '>' error (nonassociative) - - $default reduce using rule 29 (Exp) - - state 95 9 Exp: Exp . '=' Exp @@ -2221,25 +2239,113 @@ state 95 27 | Exp . '<' Exp 28 | Exp . '>' Exp 29 | Exp . "<=" Exp + 29 | Exp "<=" Exp . + 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp + + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 + + "==" error (nonassociative) + "!=" error (nonassociative) + "<=" error (nonassociative) + ">=" error (nonassociative) + "contains" error (nonassociative) + '<' error (nonassociative) + '>' error (nonassociative) + + $default reduce using rule 29 (Exp) + + +state 96 + + 9 Exp: Exp . '=' Exp + 10 | Exp . "or" Exp + 11 | Exp . "and" Exp + 12 | Exp . "//" Exp + 13 | Exp . "//=" Exp + 14 | Exp . "|=" Exp + 15 | Exp . '|' Exp + 16 | Exp . ',' Exp + 17 | Exp . '+' Exp + 18 | Exp . "+=" Exp + 19 | Exp . '-' Exp + 20 | Exp . "-=" Exp + 21 | Exp . '*' Exp + 22 | Exp . "*=" Exp + 23 | Exp . '/' Exp + 24 | Exp . "/=" Exp + 25 | Exp . "==" Exp + 26 | Exp . "!=" Exp + 27 | Exp . '<' Exp + 28 | Exp . '>' Exp + 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp 30 | Exp ">=" Exp . + 31 | Exp . "contains" Exp - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 - "==" error (nonassociative) - "!=" error (nonassociative) - "<=" error (nonassociative) - ">=" error (nonassociative) - '<' error (nonassociative) - '>' error (nonassociative) + "==" error (nonassociative) + "!=" error (nonassociative) + "<=" error (nonassociative) + ">=" error (nonassociative) + "contains" error (nonassociative) + '<' error (nonassociative) + '>' error (nonassociative) $default reduce using rule 30 (Exp) -state 96 +state 97 + + 9 Exp: Exp . '=' Exp + 10 | Exp . "or" Exp + 11 | Exp . "and" Exp + 12 | Exp . "//" Exp + 13 | Exp . "//=" Exp + 14 | Exp . "|=" Exp + 15 | Exp . '|' Exp + 16 | Exp . ',' Exp + 17 | Exp . '+' Exp + 18 | Exp . "+=" Exp + 19 | Exp . '-' Exp + 20 | Exp . "-=" Exp + 21 | Exp . '*' Exp + 22 | Exp . "*=" Exp + 23 | Exp . '/' Exp + 24 | Exp . "/=" Exp + 25 | Exp . "==" Exp + 26 | Exp . "!=" Exp + 27 | Exp . '<' Exp + 28 | Exp . '>' Exp + 29 | Exp . "<=" Exp + 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp + 31 | Exp "contains" Exp . + + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 + + "==" error (nonassociative) + "!=" error (nonassociative) + "<=" error (nonassociative) + ">=" error (nonassociative) + "contains" error (nonassociative) + '<' error (nonassociative) + '>' error (nonassociative) + + $default reduce using rule 31 (Exp) + + +state 98 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -2264,33 +2370,35 @@ state 96 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 $default reduce using rule 15 (Exp) -state 97 +state 99 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -2315,32 +2423,34 @@ state 97 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 $default reduce using rule 16 (Exp) -state 98 +state 100 9 Exp: Exp . '=' Exp 9 | Exp '=' Exp . @@ -2365,19 +2475,21 @@ state 98 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 "|=" error (nonassociative) "+=" error (nonassociative) @@ -2390,7 +2502,7 @@ state 98 $default reduce using rule 9 (Exp) -state 99 +state 101 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -2415,23 +2527,25 @@ state 99 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 - "==" error (nonassociative) - "!=" error (nonassociative) - "<=" error (nonassociative) - ">=" error (nonassociative) - '<' error (nonassociative) - '>' error (nonassociative) + "==" error (nonassociative) + "!=" error (nonassociative) + "<=" error (nonassociative) + ">=" error (nonassociative) + "contains" error (nonassociative) + '<' error (nonassociative) + '>' error (nonassociative) $default reduce using rule 27 (Exp) -state 100 +state 102 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -2456,23 +2570,25 @@ state 100 28 | Exp '>' Exp . 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 - "==" error (nonassociative) - "!=" error (nonassociative) - "<=" error (nonassociative) - ">=" error (nonassociative) - '<' error (nonassociative) - '>' error (nonassociative) + "==" error (nonassociative) + "!=" error (nonassociative) + "<=" error (nonassociative) + ">=" error (nonassociative) + "contains" error (nonassociative) + '<' error (nonassociative) + '>' error (nonassociative) $default reduce using rule 28 (Exp) -state 101 +state 103 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -2497,14 +2613,15 @@ state 101 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - '*' shift, and go to state 56 - '/' shift, and go to state 57 + '*' shift, and go to state 57 + '/' shift, and go to state 58 $default reduce using rule 17 (Exp) -state 102 +state 104 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -2529,14 +2646,15 @@ state 102 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - '*' shift, and go to state 56 - '/' shift, and go to state 57 + '*' shift, and go to state 57 + '/' shift, and go to state 58 $default reduce using rule 19 (Exp) -state 103 +state 105 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -2561,11 +2679,12 @@ state 103 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp $default reduce using rule 21 (Exp) -state 104 +state 106 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -2590,94 +2709,37 @@ state 104 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp $default reduce using rule 23 (Exp) -state 105 +state 107 6 Exp: Term "as" '$' . IDENT '|' Exp - IDENT shift, and go to state 123 - - -state 106 - - 43 Term: Term '.' IDENT . - - $default reduce using rule 43 (Term) - - -state 107 - - 58 Term: Term '[' error . ']' - - ']' shift, and go to state 124 + IDENT shift, and go to state 125 state 108 - 46 Term: Term '[' ']' . + 44 Term: Term '.' IDENT . - $default reduce using rule 46 (Term) + $default reduce using rule 44 (Term) state 109 - 9 Exp: Exp . '=' Exp - 10 | Exp . "or" Exp - 11 | Exp . "and" Exp - 12 | Exp . "//" Exp - 13 | Exp . "//=" Exp - 14 | Exp . "|=" Exp - 15 | Exp . '|' Exp - 16 | Exp . ',' Exp - 17 | Exp . '+' Exp - 18 | Exp . "+=" Exp - 19 | Exp . '-' Exp - 20 | Exp . "-=" Exp - 21 | Exp . '*' Exp - 22 | Exp . "*=" Exp - 23 | Exp . '/' Exp - 24 | Exp . "/=" Exp - 25 | Exp . "==" Exp - 26 | Exp . "!=" Exp - 27 | Exp . '<' Exp - 28 | Exp . '>' Exp - 29 | Exp . "<=" Exp - 30 | Exp . ">=" Exp - 45 Term: Term '[' Exp . ']' + 59 Term: Term '[' error . ']' - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 - ']' shift, and go to state 125 + ']' shift, and go to state 126 state 110 - 55 Term: IDENT '(' Exp ')' . + 47 Term: Term '[' ']' . - $default reduce using rule 55 (Term) + $default reduce using rule 47 (Term) state 111 @@ -2704,42 +2766,104 @@ state 111 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp - 33 FuncDef: "def" IDENT ':' Exp . ';' + 31 | Exp . "contains" Exp + 46 Term: Term '[' Exp . ']' - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - ';' shift, and go to state 126 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 + ']' shift, and go to state 127 state 112 - 34 FuncDef: "def" IDENT '(' IDENT . ')' ':' Exp ';' + 56 Term: IDENT '(' Exp ')' . - ')' shift, and go to state 127 + $default reduce using rule 56 (Term) state 113 + 9 Exp: Exp . '=' Exp + 10 | Exp . "or" Exp + 11 | Exp . "and" Exp + 12 | Exp . "//" Exp + 13 | Exp . "//=" Exp + 14 | Exp . "|=" Exp + 15 | Exp . '|' Exp + 16 | Exp . ',' Exp + 17 | Exp . '+' Exp + 18 | Exp . "+=" Exp + 19 | Exp . '-' Exp + 20 | Exp . "-=" Exp + 21 | Exp . '*' Exp + 22 | Exp . "*=" Exp + 23 | Exp . '/' Exp + 24 | Exp . "/=" Exp + 25 | Exp . "==" Exp + 26 | Exp . "!=" Exp + 27 | Exp . '<' Exp + 28 | Exp . '>' Exp + 29 | Exp . "<=" Exp + 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp + 34 FuncDef: "def" IDENT ':' Exp . ';' + + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + ';' shift, and go to state 128 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 + + +state 114 + + 35 FuncDef: "def" IDENT '(' IDENT . ')' ':' Exp ';' + + ')' shift, and go to state 129 + + +state 115 + 7 Exp: "if" Exp "then" Exp . ElseBody 9 | Exp . '=' Exp 10 | Exp . "or" Exp @@ -2763,36 +2887,38 @@ state 113 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "else" shift, and go to state 128 - "elif" shift, and go to state 129 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "else" shift, and go to state 130 + "elif" shift, and go to state 131 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 - ElseBody go to state 130 + ElseBody go to state 132 -state 114 +state 116 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -2816,7 +2942,8 @@ state 114 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp - 37 QQString: QQString QQSTRING_INTERP_START Exp . QQSTRING_INTERP_END + 31 | Exp . "contains" Exp + 38 QQString: QQString QQSTRING_INTERP_START Exp . QQSTRING_INTERP_END "==" shift, and go to state 36 "!=" shift, and go to state 37 @@ -2831,146 +2958,126 @@ state 114 "//=" shift, and go to state 46 "<=" shift, and go to state 47 ">=" shift, and go to state 48 - QQSTRING_INTERP_END shift, and go to state 131 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 - - -state 115 - - 63 MkDict: error . ',' MkDict - - ',' shift, and go to state 75 - - -state 116 - - 63 MkDict: error ',' MkDict . - - $default reduce using rule 63 (MkDict) + "contains" shift, and go to state 49 + QQSTRING_INTERP_END shift, and go to state 133 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 state 117 - 40 ExpD: ExpD . '|' ExpD - 64 MkDictPair: IDENT ':' ExpD . + 64 MkDict: error . ',' MkDict - '|' shift, and go to state 132 - - $default reduce using rule 64 (MkDictPair) + ',' shift, and go to state 76 state 118 - 41 ExpD: Term . - 43 Term: Term . '.' IDENT - 45 | Term . '[' Exp ']' - 46 | Term . '[' ']' - 58 | Term . '[' error ']' + 64 MkDict: error ',' MkDict . - '.' shift, and go to state 61 - '[' shift, and go to state 62 - - $default reduce using rule 41 (ExpD) + $default reduce using rule 64 (MkDict) state 119 - 68 MkDictPair: '(' error ')' . ':' ExpD + 41 ExpD: ExpD . '|' ExpD + 65 MkDictPair: IDENT ':' ExpD . - ':' shift, and go to state 133 - - -state 120 - - 67 MkDictPair: '(' Exp ')' . ':' ExpD - - ':' shift, and go to state 134 - - -state 121 - - 40 ExpD: ExpD . '|' ExpD - 65 MkDictPair: String ':' ExpD . - - '|' shift, and go to state 132 + '|' shift, and go to state 134 $default reduce using rule 65 (MkDictPair) +state 120 + + 42 ExpD: Term . + 44 Term: Term . '.' IDENT + 46 | Term . '[' Exp ']' + 47 | Term . '[' ']' + 59 | Term . '[' error ']' + + '.' shift, and go to state 62 + '[' shift, and go to state 63 + + $default reduce using rule 42 (ExpD) + + +state 121 + + 69 MkDictPair: '(' error ')' . ':' ExpD + + ':' shift, and go to state 135 + + state 122 - 62 MkDict: MkDictPair ',' MkDict . - - $default reduce using rule 62 (MkDict) - - -state 123 - - 6 Exp: Term "as" '$' IDENT . '|' Exp - - '|' shift, and go to state 135 - - -state 124 - - 58 Term: Term '[' error ']' . - - $default reduce using rule 58 (Term) - - -state 125 - - 45 Term: Term '[' Exp ']' . - - $default reduce using rule 45 (Term) - - -state 126 - - 33 FuncDef: "def" IDENT ':' Exp ';' . - - $default reduce using rule 33 (FuncDef) - - -state 127 - - 34 FuncDef: "def" IDENT '(' IDENT ')' . ':' Exp ';' + 68 MkDictPair: '(' Exp ')' . ':' ExpD ':' shift, and go to state 136 +state 123 + + 41 ExpD: ExpD . '|' ExpD + 66 MkDictPair: String ':' ExpD . + + '|' shift, and go to state 134 + + $default reduce using rule 66 (MkDictPair) + + +state 124 + + 63 MkDict: MkDictPair ',' MkDict . + + $default reduce using rule 63 (MkDict) + + +state 125 + + 6 Exp: Term "as" '$' IDENT . '|' Exp + + '|' shift, and go to state 137 + + +state 126 + + 59 Term: Term '[' error ']' . + + $default reduce using rule 59 (Term) + + +state 127 + + 46 Term: Term '[' Exp ']' . + + $default reduce using rule 46 (Term) + + state 128 - 39 ElseBody: "else" . Exp "end" + 34 FuncDef: "def" IDENT ':' Exp ';' . - IDENT shift, and go to state 1 - LITERAL shift, and go to state 2 - "def" shift, and go to state 3 - "if" shift, and go to state 4 - QQSTRING_START shift, and go to state 5 - '$' shift, and go to state 6 - '(' shift, and go to state 7 - '.' shift, and go to state 8 - '[' shift, and go to state 9 - '{' shift, and go to state 10 - - Exp go to state 137 - String go to state 14 - FuncDef go to state 20 - Term go to state 16 + $default reduce using rule 34 (FuncDef) state 129 - 38 ElseBody: "elif" . Exp "then" Exp ElseBody + 35 FuncDef: "def" IDENT '(' IDENT ')' . ':' Exp ';' + + ':' shift, and go to state 138 + + +state 130 + + 40 ElseBody: "else" . Exp "end" IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -2983,65 +3090,50 @@ state 129 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 138 + Exp go to state 139 String go to state 14 FuncDef go to state 20 Term go to state 16 -state 130 +state 131 + + 39 ElseBody: "elif" . Exp "then" Exp ElseBody + + IDENT shift, and go to state 1 + LITERAL shift, and go to state 2 + "def" shift, and go to state 3 + "if" shift, and go to state 4 + QQSTRING_START shift, and go to state 5 + '$' shift, and go to state 6 + '(' shift, and go to state 7 + '.' shift, and go to state 8 + '[' shift, and go to state 9 + '{' shift, and go to state 10 + + Exp go to state 140 + String go to state 14 + FuncDef go to state 20 + Term go to state 16 + + +state 132 7 Exp: "if" Exp "then" Exp ElseBody . $default reduce using rule 7 (Exp) -state 131 - - 37 QQString: QQString QQSTRING_INTERP_START Exp QQSTRING_INTERP_END . - - $default reduce using rule 37 (QQString) - - -state 132 - - 40 ExpD: ExpD '|' . ExpD - - IDENT shift, and go to state 1 - LITERAL shift, and go to state 2 - QQSTRING_START shift, and go to state 5 - '$' shift, and go to state 6 - '(' shift, and go to state 7 - '.' shift, and go to state 8 - '[' shift, and go to state 9 - '{' shift, and go to state 10 - - String go to state 14 - ExpD go to state 139 - Term go to state 118 - - state 133 - 68 MkDictPair: '(' error ')' ':' . ExpD + 38 QQString: QQString QQSTRING_INTERP_START Exp QQSTRING_INTERP_END . - IDENT shift, and go to state 1 - LITERAL shift, and go to state 2 - QQSTRING_START shift, and go to state 5 - '$' shift, and go to state 6 - '(' shift, and go to state 7 - '.' shift, and go to state 8 - '[' shift, and go to state 9 - '{' shift, and go to state 10 - - String go to state 14 - ExpD go to state 140 - Term go to state 118 + $default reduce using rule 38 (QQString) state 134 - 67 MkDictPair: '(' Exp ')' ':' . ExpD + 41 ExpD: ExpD '|' . ExpD IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -3054,11 +3146,47 @@ state 134 String go to state 14 ExpD go to state 141 - Term go to state 118 + Term go to state 120 state 135 + 69 MkDictPair: '(' error ')' ':' . ExpD + + IDENT shift, and go to state 1 + LITERAL shift, and go to state 2 + QQSTRING_START shift, and go to state 5 + '$' shift, and go to state 6 + '(' shift, and go to state 7 + '.' shift, and go to state 8 + '[' shift, and go to state 9 + '{' shift, and go to state 10 + + String go to state 14 + ExpD go to state 142 + Term go to state 120 + + +state 136 + + 68 MkDictPair: '(' Exp ')' ':' . ExpD + + IDENT shift, and go to state 1 + LITERAL shift, and go to state 2 + QQSTRING_START shift, and go to state 5 + '$' shift, and go to state 6 + '(' shift, and go to state 7 + '.' shift, and go to state 8 + '[' shift, and go to state 9 + '{' shift, and go to state 10 + + String go to state 14 + ExpD go to state 143 + Term go to state 120 + + +state 137 + 6 Exp: Term "as" '$' IDENT '|' . Exp IDENT shift, and go to state 1 @@ -3072,15 +3200,15 @@ state 135 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 142 + Exp go to state 144 String go to state 14 FuncDef go to state 20 Term go to state 16 -state 136 +state 138 - 34 FuncDef: "def" IDENT '(' IDENT ')' ':' . Exp ';' + 35 FuncDef: "def" IDENT '(' IDENT ')' ':' . Exp ';' IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -3093,144 +3221,148 @@ state 136 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 143 + Exp go to state 145 String go to state 14 FuncDef go to state 20 Term go to state 16 -state 137 - - 9 Exp: Exp . '=' Exp - 10 | Exp . "or" Exp - 11 | Exp . "and" Exp - 12 | Exp . "//" Exp - 13 | Exp . "//=" Exp - 14 | Exp . "|=" Exp - 15 | Exp . '|' Exp - 16 | Exp . ',' Exp - 17 | Exp . '+' Exp - 18 | Exp . "+=" Exp - 19 | Exp . '-' Exp - 20 | Exp . "-=" Exp - 21 | Exp . '*' Exp - 22 | Exp . "*=" Exp - 23 | Exp . '/' Exp - 24 | Exp . "/=" Exp - 25 | Exp . "==" Exp - 26 | Exp . "!=" Exp - 27 | Exp . '<' Exp - 28 | Exp . '>' Exp - 29 | Exp . "<=" Exp - 30 | Exp . ">=" Exp - 39 ElseBody: "else" Exp . "end" - - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "end" shift, and go to state 144 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 - - -state 138 - - 9 Exp: Exp . '=' Exp - 10 | Exp . "or" Exp - 11 | Exp . "and" Exp - 12 | Exp . "//" Exp - 13 | Exp . "//=" Exp - 14 | Exp . "|=" Exp - 15 | Exp . '|' Exp - 16 | Exp . ',' Exp - 17 | Exp . '+' Exp - 18 | Exp . "+=" Exp - 19 | Exp . '-' Exp - 20 | Exp . "-=" Exp - 21 | Exp . '*' Exp - 22 | Exp . "*=" Exp - 23 | Exp . '/' Exp - 24 | Exp . "/=" Exp - 25 | Exp . "==" Exp - 26 | Exp . "!=" Exp - 27 | Exp . '<' Exp - 28 | Exp . '>' Exp - 29 | Exp . "<=" Exp - 30 | Exp . ">=" Exp - 38 ElseBody: "elif" Exp . "then" Exp ElseBody - - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "then" shift, and go to state 145 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 - - state 139 - 40 ExpD: ExpD . '|' ExpD - 40 | ExpD '|' ExpD . + 9 Exp: Exp . '=' Exp + 10 | Exp . "or" Exp + 11 | Exp . "and" Exp + 12 | Exp . "//" Exp + 13 | Exp . "//=" Exp + 14 | Exp . "|=" Exp + 15 | Exp . '|' Exp + 16 | Exp . ',' Exp + 17 | Exp . '+' Exp + 18 | Exp . "+=" Exp + 19 | Exp . '-' Exp + 20 | Exp . "-=" Exp + 21 | Exp . '*' Exp + 22 | Exp . "*=" Exp + 23 | Exp . '/' Exp + 24 | Exp . "/=" Exp + 25 | Exp . "==" Exp + 26 | Exp . "!=" Exp + 27 | Exp . '<' Exp + 28 | Exp . '>' Exp + 29 | Exp . "<=" Exp + 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp + 40 ElseBody: "else" Exp . "end" - $default reduce using rule 40 (ExpD) + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "end" shift, and go to state 146 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 state 140 - 40 ExpD: ExpD . '|' ExpD - 68 MkDictPair: '(' error ')' ':' ExpD . + 9 Exp: Exp . '=' Exp + 10 | Exp . "or" Exp + 11 | Exp . "and" Exp + 12 | Exp . "//" Exp + 13 | Exp . "//=" Exp + 14 | Exp . "|=" Exp + 15 | Exp . '|' Exp + 16 | Exp . ',' Exp + 17 | Exp . '+' Exp + 18 | Exp . "+=" Exp + 19 | Exp . '-' Exp + 20 | Exp . "-=" Exp + 21 | Exp . '*' Exp + 22 | Exp . "*=" Exp + 23 | Exp . '/' Exp + 24 | Exp . "/=" Exp + 25 | Exp . "==" Exp + 26 | Exp . "!=" Exp + 27 | Exp . '<' Exp + 28 | Exp . '>' Exp + 29 | Exp . "<=" Exp + 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp + 39 ElseBody: "elif" Exp . "then" Exp ElseBody - '|' shift, and go to state 132 - - $default reduce using rule 68 (MkDictPair) + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "then" shift, and go to state 147 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 state 141 - 40 ExpD: ExpD . '|' ExpD - 67 MkDictPair: '(' Exp ')' ':' ExpD . + 41 ExpD: ExpD . '|' ExpD + 41 | ExpD '|' ExpD . - '|' shift, and go to state 132 - - $default reduce using rule 67 (MkDictPair) + $default reduce using rule 41 (ExpD) state 142 + 41 ExpD: ExpD . '|' ExpD + 69 MkDictPair: '(' error ')' ':' ExpD . + + '|' shift, and go to state 134 + + $default reduce using rule 69 (MkDictPair) + + +state 143 + + 41 ExpD: ExpD . '|' ExpD + 68 MkDictPair: '(' Exp ')' ':' ExpD . + + '|' shift, and go to state 134 + + $default reduce using rule 68 (MkDictPair) + + +state 144 + 6 Exp: Term "as" '$' IDENT '|' Exp . 9 | Exp . '=' Exp 10 | Exp . "or" Exp @@ -3254,33 +3386,35 @@ state 142 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp + 31 | Exp . "contains" Exp - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 $default reduce using rule 6 (Exp) -state 143 +state 145 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -3304,43 +3438,45 @@ state 143 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp - 34 FuncDef: "def" IDENT '(' IDENT ')' ':' Exp . ';' + 31 | Exp . "contains" Exp + 35 FuncDef: "def" IDENT '(' IDENT ')' ':' Exp . ';' - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - ';' shift, and go to state 146 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + ';' shift, and go to state 148 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 -state 144 +state 146 - 39 ElseBody: "else" Exp "end" . + 40 ElseBody: "else" Exp "end" . - $default reduce using rule 39 (ElseBody) + $default reduce using rule 40 (ElseBody) -state 145 +state 147 - 38 ElseBody: "elif" Exp "then" . Exp ElseBody + 39 ElseBody: "elif" Exp "then" . Exp ElseBody IDENT shift, and go to state 1 LITERAL shift, and go to state 2 @@ -3353,20 +3489,20 @@ state 145 '[' shift, and go to state 9 '{' shift, and go to state 10 - Exp go to state 147 + Exp go to state 149 String go to state 14 FuncDef go to state 20 Term go to state 16 -state 146 +state 148 - 34 FuncDef: "def" IDENT '(' IDENT ')' ':' Exp ';' . + 35 FuncDef: "def" IDENT '(' IDENT ')' ':' Exp ';' . - $default reduce using rule 34 (FuncDef) + $default reduce using rule 35 (FuncDef) -state 147 +state 149 9 Exp: Exp . '=' Exp 10 | Exp . "or" Exp @@ -3390,38 +3526,40 @@ state 147 28 | Exp . '>' Exp 29 | Exp . "<=" Exp 30 | Exp . ">=" Exp - 38 ElseBody: "elif" Exp "then" Exp . ElseBody + 31 | Exp . "contains" Exp + 39 ElseBody: "elif" Exp "then" Exp . ElseBody - "==" shift, and go to state 36 - "!=" shift, and go to state 37 - "//" shift, and go to state 38 - "else" shift, and go to state 128 - "elif" shift, and go to state 129 - "and" shift, and go to state 39 - "or" shift, and go to state 40 - "|=" shift, and go to state 41 - "+=" shift, and go to state 42 - "-=" shift, and go to state 43 - "*=" shift, and go to state 44 - "/=" shift, and go to state 45 - "//=" shift, and go to state 46 - "<=" shift, and go to state 47 - ">=" shift, and go to state 48 - '|' shift, and go to state 49 - ',' shift, and go to state 50 - '=' shift, and go to state 51 - '<' shift, and go to state 52 - '>' shift, and go to state 53 - '+' shift, and go to state 54 - '-' shift, and go to state 55 - '*' shift, and go to state 56 - '/' shift, and go to state 57 + "==" shift, and go to state 36 + "!=" shift, and go to state 37 + "//" shift, and go to state 38 + "else" shift, and go to state 130 + "elif" shift, and go to state 131 + "and" shift, and go to state 39 + "or" shift, and go to state 40 + "|=" shift, and go to state 41 + "+=" shift, and go to state 42 + "-=" shift, and go to state 43 + "*=" shift, and go to state 44 + "/=" shift, and go to state 45 + "//=" shift, and go to state 46 + "<=" shift, and go to state 47 + ">=" shift, and go to state 48 + "contains" shift, and go to state 49 + '|' shift, and go to state 50 + ',' shift, and go to state 51 + '=' shift, and go to state 52 + '<' shift, and go to state 53 + '>' shift, and go to state 54 + '+' shift, and go to state 55 + '-' shift, and go to state 56 + '*' shift, and go to state 57 + '/' shift, and go to state 58 - ElseBody go to state 148 + ElseBody go to state 150 -state 148 +state 150 - 38 ElseBody: "elif" Exp "then" Exp ElseBody . + 39 ElseBody: "elif" Exp "then" Exp ElseBody . - $default reduce using rule 38 (ElseBody) + $default reduce using rule 39 (ElseBody) diff --git a/parser.y b/parser.y index 92d6f7cd..59d535e6 100644 --- a/parser.y +++ b/parser.y @@ -65,6 +65,7 @@ struct lexer_param; %token SETDEFINEDOR "//=" %token LESSEQ "<=" %token GREATEREQ ">=" +%token CONTAINS "contains" %token QQSTRING_START %token QQSTRING_TEXT @@ -80,7 +81,7 @@ struct lexer_param; %nonassoc '=' SETPIPE SETPLUS SETMINUS SETMULT SETDIV SETDEFINEDOR %left OR %left AND -%nonassoc NEQ EQ '<' '>' LESSEQ GREATEREQ +%nonassoc NEQ EQ '<' '>' LESSEQ GREATEREQ CONTAINS %left '+' '-' %left '*' '/' @@ -149,6 +150,7 @@ static block gen_binop(block a, block b, int op) { case '>': funcname = "_greater"; break; case LESSEQ: funcname = "_lesseq"; break; case GREATEREQ: funcname = "_greatereq"; break; + case CONTAINS: funcname = "_contains"; break; } assert(funcname); @@ -293,6 +295,10 @@ Exp ">=" Exp { $$ = gen_binop($1, $3, GREATEREQ); } | +Exp "contains" Exp { + $$ = gen_binop($1, $3, CONTAINS); +} | + Term { $$ = $1; } diff --git a/testdata b/testdata index 4fff7167..de224b96 100644 --- a/testdata +++ b/testdata @@ -400,3 +400,28 @@ def inc(x): x |= .+1; inc(.[].a) [{"foo":[1,2,{"bar":18},"world"]} == {"foo":[1,2,{"bar":18},"world"]},{"foo":[1,2,{"bar":18},"world"]} == {"foo":[1,2,{"bar":19},"world"]}] {} [true,false] + +# containment operator +["foo" contains "foo", "foobar" contains "foo", "foo" contains "foobar"] +{} +[true, true, false] + +[[] contains [], [1,2,3] contains [1,2], [1,2,3] contains [3,1], [1,2,3] contains [4], [1,2,3] contains [1,4]] +{} +[true, true, true, false, false] + +[["foobar", "foobaz"] contains ["baz", "bar"], ["foobar", "foobaz"] contains ["foo"], ["foobar", "foobaz"] contains ["blap"]] +{} +[true, true, false] + +[{foo: 12, bar:13} contains {foo: 12}, {foo: 12} contains {}, {foo: 12, bar:13} contains {baz:14}] +{} +[true, true, false] + +{foo: {baz: 12, blap: {bar: 13}}, bar: 14} contains {bar: 14, foo: {blap: {}}} +{} +true + +{foo: {baz: 12, blap: {bar: 13}}, bar: 14} contains {bar: 14, foo: {blap: {bar: 14}}} +{} +false