diff --git a/src/parser.c b/src/parser.c index 0599db7f4d..8e583c5127 100644 --- a/src/parser.c +++ b/src/parser.c @@ -345,12 +345,12 @@ enum yysymbol_kind_t YYSYMBOL_57_ = 57, /* '%' */ YYSYMBOL_NONOPT = 58, /* NONOPT */ YYSYMBOL_59_ = 59, /* '?' */ - YYSYMBOL_60_ = 60, /* ';' */ - YYSYMBOL_61_ = 61, /* '(' */ - YYSYMBOL_62_ = 62, /* ')' */ + YYSYMBOL_60_ = 60, /* '.' */ + YYSYMBOL_61_ = 61, /* '[' */ + YYSYMBOL_62_ = 62, /* ';' */ YYSYMBOL_63_ = 63, /* ':' */ - YYSYMBOL_64_ = 64, /* '.' */ - YYSYMBOL_65_ = 65, /* '[' */ + YYSYMBOL_64_ = 64, /* '(' */ + YYSYMBOL_65_ = 65, /* ')' */ YYSYMBOL_66_ = 66, /* ']' */ YYSYMBOL_67_ = 67, /* '{' */ YYSYMBOL_68_ = 68, /* '}' */ @@ -360,18 +360,18 @@ enum yysymbol_kind_t YYSYMBOL_Module = 72, /* Module */ YYSYMBOL_Imports = 73, /* Imports */ YYSYMBOL_FuncDefs = 74, /* FuncDefs */ - YYSYMBOL_Exp = 75, /* Exp */ - YYSYMBOL_Import = 76, /* Import */ - YYSYMBOL_ImportWhat = 77, /* ImportWhat */ - YYSYMBOL_ImportFrom = 78, /* ImportFrom */ - YYSYMBOL_FuncDef = 79, /* FuncDef */ - YYSYMBOL_Params = 80, /* Params */ - YYSYMBOL_Param = 81, /* Param */ - YYSYMBOL_StringStart = 82, /* StringStart */ - YYSYMBOL_String = 83, /* String */ - YYSYMBOL_QQString = 84, /* QQString */ - YYSYMBOL_ElseBody = 85, /* ElseBody */ - YYSYMBOL_ExpD = 86, /* ExpD */ + YYSYMBOL_Query = 75, /* Query */ + YYSYMBOL_Expr = 76, /* Expr */ + YYSYMBOL_Import = 77, /* Import */ + YYSYMBOL_ImportWhat = 78, /* ImportWhat */ + YYSYMBOL_ImportFrom = 79, /* ImportFrom */ + YYSYMBOL_FuncDef = 80, /* FuncDef */ + YYSYMBOL_Params = 81, /* Params */ + YYSYMBOL_Param = 82, /* Param */ + YYSYMBOL_StringStart = 83, /* StringStart */ + YYSYMBOL_String = 84, /* String */ + YYSYMBOL_QQString = 85, /* QQString */ + YYSYMBOL_ElseBody = 86, /* ElseBody */ YYSYMBOL_Term = 87, /* Term */ YYSYMBOL_Args = 88, /* Args */ YYSYMBOL_Arg = 89, /* Arg */ @@ -382,8 +382,9 @@ enum yysymbol_kind_t YYSYMBOL_ObjPats = 94, /* ObjPats */ YYSYMBOL_ObjPat = 95, /* ObjPat */ YYSYMBOL_Keyword = 96, /* Keyword */ - YYSYMBOL_MkDict = 97, /* MkDict */ - YYSYMBOL_MkDictPair = 98 /* MkDictPair */ + YYSYMBOL_DictPairs = 97, /* DictPairs */ + YYSYMBOL_DictPair = 98, /* DictPair */ + YYSYMBOL_DictExpr = 99 /* DictExpr */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -550,7 +551,7 @@ static block gen_loc_object(location *loc, struct locfile *locations) { } -#line 554 "src/parser.c" +#line 555 "src/parser.c" #ifdef short @@ -875,18 +876,18 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 30 +#define YYFINAL 31 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 2051 +#define YYLAST 1275 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 70 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 29 +#define YYNNTS 30 /* YYNRULES -- Number of rules. */ -#define YYNRULES 169 +#define YYNRULES 168 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 315 +#define YYNSTATES 313 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 303 @@ -907,12 +908,12 @@ static const yytype_int8 yytranslate[] = 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, 69, 57, 2, 2, - 61, 62, 55, 53, 49, 54, 64, 56, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 63, 60, + 64, 65, 55, 53, 49, 54, 60, 56, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 63, 62, 51, 50, 52, 59, 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, 65, 2, 66, 2, 2, 2, 2, 2, 2, + 2, 61, 2, 66, 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, 67, 48, 68, 2, 2, 2, 2, @@ -941,22 +942,22 @@ static const yytype_int8 yytranslate[] = static const yytype_int16 yyrline[] = { 0, 290, 290, 293, 298, 301, 316, 319, 324, 327, - 332, 336, 339, 343, 347, 351, 354, 359, 362, 365, - 370, 377, 381, 385, 389, 393, 397, 401, 405, 409, - 413, 417, 421, 425, 429, 433, 437, 441, 445, 449, - 453, 457, 461, 465, 469, 473, 477, 481, 486, 489, - 506, 515, 522, 530, 541, 546, 552, 555, 560, 564, - 571, 574, 580, 587, 590, 593, 599, 602, 605, 610, - 613, 616, 622, 625, 628, 636, 640, 643, 646, 649, - 652, 655, 658, 661, 664, 668, 674, 677, 680, 683, - 686, 689, 692, 695, 698, 701, 704, 707, 710, 713, - 716, 719, 722, 725, 728, 731, 734, 756, 760, 764, - 767, 779, 784, 785, 786, 787, 790, 793, 798, 803, - 806, 811, 814, 819, 823, 826, 831, 834, 839, 842, - 847, 850, 853, 856, 859, 862, 870, 876, 879, 882, - 885, 888, 891, 894, 897, 900, 903, 906, 909, 912, - 915, 918, 921, 924, 927, 932, 935, 936, 937, 940, - 943, 946, 949, 953, 958, 962, 966, 970, 974, 982 + 333, 336, 339, 345, 348, 351, 357, 360, 363, 366, + 369, 372, 375, 378, 381, 384, 387, 390, 393, 396, + 399, 402, 405, 408, 411, 414, 417, 420, 423, 429, + 432, 449, 458, 465, 473, 484, 489, 495, 498, 503, + 507, 514, 517, 523, 530, 533, 536, 542, 545, 548, + 554, 557, 560, 568, 572, 575, 578, 581, 584, 587, + 590, 593, 596, 600, 606, 609, 612, 615, 618, 621, + 624, 627, 630, 633, 636, 639, 642, 645, 648, 651, + 654, 657, 660, 663, 666, 669, 672, 679, 682, 685, + 688, 691, 695, 698, 702, 720, 724, 728, 731, 743, + 748, 749, 750, 751, 754, 757, 762, 767, 770, 775, + 778, 783, 787, 790, 795, 798, 803, 806, 811, 814, + 817, 820, 823, 826, 834, 840, 843, 846, 849, 852, + 855, 858, 861, 864, 867, 870, 873, 876, 879, 882, + 885, 888, 891, 897, 900, 903, 908, 911, 914, 917, + 921, 926, 930, 934, 938, 942, 950, 956, 959 }; #endif @@ -982,12 +983,13 @@ static const char *const yytname[] = "\">=\"", "\"?//\"", "QQSTRING_START", "QQSTRING_TEXT", "QQSTRING_INTERP_START", "QQSTRING_INTERP_END", "QQSTRING_END", "FUNCDEF", "'|'", "','", "'='", "'<'", "'>'", "'+'", "'-'", "'*'", "'/'", - "'%'", "NONOPT", "'?'", "';'", "'('", "')'", "':'", "'.'", "'['", "']'", + "'%'", "NONOPT", "'?'", "'.'", "'['", "';'", "':'", "'('", "')'", "']'", "'{'", "'}'", "'$'", "$accept", "TopLevel", "Module", "Imports", - "FuncDefs", "Exp", "Import", "ImportWhat", "ImportFrom", "FuncDef", - "Params", "Param", "StringStart", "String", "QQString", "ElseBody", - "ExpD", "Term", "Args", "Arg", "RepPatterns", "Patterns", "Pattern", - "ArrayPats", "ObjPats", "ObjPat", "Keyword", "MkDict", "MkDictPair", YY_NULLPTR + "FuncDefs", "Query", "Expr", "Import", "ImportWhat", "ImportFrom", + "FuncDef", "Params", "Param", "StringStart", "String", "QQString", + "ElseBody", "Term", "Args", "Arg", "RepPatterns", "Patterns", "Pattern", + "ArrayPats", "ObjPats", "ObjPat", "Keyword", "DictPairs", "DictPair", + "DictExpr", YY_NULLPTR }; static const char * @@ -997,12 +999,12 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-157) +#define YYPACT_NINF (-179) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-156) +#define YYTABLE_NINF (-154) #define yytable_value_is_error(Yyn) \ ((Yyn) == YYTABLE_NINF) @@ -1011,38 +1013,38 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - -14, 881, 15, 62, -33, -23, -157, -157, -9, -157, - 37, 881, 912, 912, 881, 40, 2, -157, -157, 881, - 193, 282, 415, 595, -18, 1400, 881, -157, -157, 12, - -157, 1, 1, 881, 62, 683, 881, -157, -157, -11, - 1756, 17, 49, 26, 10, -157, -157, 14, 21, 1230, - -157, 74, -9, 53, 51, -157, 1041, -26, 63, 64, - -157, -157, -157, -157, -157, -157, -157, -157, -157, -157, - -157, -157, -157, -157, -157, -157, -157, -157, -157, 881, - 65, 69, 70, 82, 67, 881, 881, 881, 881, 881, - 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, - 881, 881, 881, 881, 881, 881, 881, 881, 881, -157, - -157, 1924, 13, 87, -5, -4, 348, 127, -157, -157, - -157, 1924, 881, -157, -157, 1451, 1924, 56, -157, 68, - 881, 482, -5, -5, 533, 881, -157, -157, -157, -157, - -157, -157, 651, 513, -157, 513, 513, 1264, 513, 513, - -157, 651, 144, 1992, 113, 113, 1958, 594, 913, 1992, - 1992, 1992, 1992, 1992, 1992, 113, 113, 1924, 1958, 1992, - 113, 113, 14, 14, 98, 98, 98, -157, 881, -157, - -157, -157, -5, 974, 117, 111, 119, 749, 102, 96, - 881, 104, 1007, 116, -157, -157, 881, -157, -157, -157, - 61, -157, 1502, -157, 1706, 110, 112, -157, -157, 1924, - -10, -157, 513, 126, 0, 126, 126, 115, 126, 126, - -157, -157, 1790, -157, -37, 118, 120, 121, 881, 122, - -38, -157, 124, -5, 881, 123, 1075, -157, -157, 1109, - -157, 815, 131, -157, -157, -157, 68, 128, -157, 881, - 881, -157, -157, 881, 881, -157, 513, 513, -157, -5, - -157, -5, -5, -5, 1298, -5, 974, -157, -5, 134, - 1924, -157, 133, 137, 145, 1143, -157, -157, 881, 1840, - 1890, 1553, 1604, 126, 126, -157, -157, -157, -157, 130, - -157, -157, -157, -157, -157, -157, 146, 1655, -157, 881, - 881, 881, -5, -157, -157, 1706, 1332, 1177, -157, -157, - -157, 881, -157, 1366, -157 + 0, 1003, 32, 51, -25, -4, -179, -179, 17, -179, + 59, 1003, 1069, 1069, 1069, 68, 18, -179, -179, 1069, + 392, 458, 525, 721, 9, 22, 1186, 1003, -179, -179, + 1, -179, 15, 15, 1003, 51, 805, 1003, -179, -179, + 98, -8, 267, 6, 1153, 61, 45, -179, -179, 6, + -179, 104, 17, 95, 44, -179, 47, 66, 72, -34, + 55, 106, -179, -179, -179, -179, -179, -179, -179, -179, + -179, -179, -179, -179, -179, -179, -179, -179, -179, -179, + -179, 1003, 126, 131, 135, 157, 147, 1003, 1003, -179, + 1069, 1069, 1069, 1069, 1069, 1069, 1069, 1069, 1069, 1069, + 1069, 1069, 1069, 1069, 1069, 1069, 1069, 1069, 1069, 1069, + 1069, 1069, 209, 5, 160, -3, -179, 14, 151, 226, + -179, -179, -179, 209, 1003, -179, -179, 63, 209, 73, + -179, 1003, 142, 592, -3, -3, 659, 1003, -179, -179, + -179, -179, -179, -179, 1069, -179, 1069, 1069, 119, 1069, + 1069, -179, 776, 236, 209, -179, 1218, 315, 315, 1186, + 618, 88, 1218, 1218, 1218, 1218, 1218, 1218, 315, 315, + 1218, 315, 315, 181, 181, -179, -179, -179, -179, 1003, + -179, -179, -179, -3, 1131, 203, 198, 218, 871, 191, + 194, 1003, 202, 28, 225, -179, -179, 1003, -179, 67, + -179, -179, 111, -179, -179, 176, 199, 206, -179, -179, + 209, 1186, 214, 214, 214, 204, 214, 214, 208, -179, + -179, 185, -179, -41, 210, 211, 213, 1003, 219, -21, + -179, 220, -3, 1003, 207, 53, -179, -179, 58, -179, + 937, 227, -179, -179, -179, -179, 142, 221, 1003, 1003, + -179, -179, 1003, 1003, 1069, 1069, -179, -3, -179, -3, + -3, -3, 123, -3, 1131, -179, -3, 231, 209, -179, + 228, 229, 230, 60, -179, -179, 1003, -18, 24, 161, + 173, 214, 214, -179, -179, -179, -179, 222, -179, -179, + -179, -179, -179, -179, 232, 179, -179, 1003, 1003, 1003, + -3, -179, -179, 176, 137, 115, -179, -179, -179, 1003, + -179, 143, -179 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1050,54 +1052,54 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 4, 0, 0, 6, 110, 81, 108, 100, 102, 73, - 0, 0, 0, 0, 0, 0, 0, 109, 61, 0, - 0, 0, 0, 0, 0, 0, 0, 63, 101, 47, - 1, 0, 0, 8, 6, 0, 0, 77, 60, 0, - 0, 0, 0, 18, 0, 75, 74, 32, 0, 0, - 84, 0, 0, 83, 0, 105, 0, 0, 165, 164, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 166, 0, - 162, 167, 0, 156, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 6, 108, 69, 106, 89, 91, 61, + 0, 0, 0, 0, 0, 0, 0, 107, 52, 0, + 0, 0, 0, 0, 0, 0, 15, 0, 54, 90, + 38, 1, 0, 0, 8, 6, 0, 0, 65, 51, + 0, 0, 0, 38, 0, 104, 0, 63, 62, 92, + 72, 0, 0, 71, 0, 95, 0, 0, 0, 0, + 162, 161, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 163, 0, 159, 164, 0, 154, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, - 5, 10, 0, 80, 0, 0, 0, 0, 53, 52, - 3, 2, 8, 7, 48, 0, 118, 0, 116, 0, - 0, 0, 0, 0, 0, 0, 112, 103, 85, 79, - 113, 104, 0, 0, 115, 0, 0, 0, 0, 0, - 106, 0, 0, 40, 41, 42, 25, 24, 23, 27, - 31, 34, 36, 39, 26, 45, 46, 28, 29, 22, - 43, 44, 30, 33, 35, 37, 38, 64, 0, 62, - 76, 123, 0, 0, 0, 0, 122, 0, 82, 0, - 0, 91, 0, 0, 9, 49, 0, 111, 59, 58, - 0, 56, 0, 16, 0, 0, 0, 19, 17, 20, - 0, 158, 0, 169, 71, 159, 163, 0, 161, 160, - 157, 107, 0, 126, 0, 0, 0, 130, 0, 0, - 0, 128, 0, 0, 0, 93, 0, 78, 114, 0, - 90, 0, 87, 51, 50, 117, 0, 0, 54, 0, - 0, 68, 15, 0, 0, 70, 0, 0, 65, 0, - 124, 0, 0, 0, 0, 0, 0, 125, 0, 121, - 11, 92, 89, 99, 98, 0, 86, 57, 0, 0, - 0, 0, 0, 69, 168, 127, 136, 132, 131, 0, - 134, 129, 133, 88, 96, 95, 97, 0, 67, 0, - 0, 0, 0, 94, 55, 0, 0, 0, 135, 66, - 12, 0, 14, 0, 13 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 10, 0, 68, 0, 88, 0, 0, 0, + 44, 43, 3, 2, 8, 7, 39, 0, 116, 0, + 114, 0, 0, 0, 0, 0, 0, 0, 73, 67, + 111, 94, 110, 93, 0, 113, 0, 0, 0, 0, + 0, 96, 0, 0, 13, 14, 31, 32, 33, 16, + 19, 18, 21, 23, 25, 27, 30, 20, 36, 37, + 17, 34, 35, 22, 24, 26, 28, 29, 55, 0, + 53, 64, 121, 0, 0, 0, 0, 120, 0, 70, + 0, 0, 79, 0, 0, 9, 40, 0, 109, 0, + 50, 49, 0, 47, 101, 0, 0, 0, 103, 102, + 12, 168, 166, 156, 160, 0, 158, 157, 0, 155, + 105, 0, 124, 0, 0, 0, 128, 0, 0, 0, + 126, 0, 0, 0, 81, 0, 66, 112, 0, 78, + 0, 75, 42, 41, 115, 45, 0, 0, 0, 0, + 59, 100, 0, 0, 0, 0, 56, 0, 122, 0, + 0, 0, 0, 0, 0, 123, 0, 119, 11, 80, + 77, 87, 86, 0, 74, 48, 0, 0, 0, 0, + 0, 167, 165, 125, 134, 130, 129, 0, 132, 127, + 131, 76, 84, 83, 85, 0, 58, 0, 0, 0, + 0, 82, 46, 0, 0, 0, 133, 57, 97, 0, + 99, 0, 98 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -157, -157, -157, 169, 57, -1, -157, -157, 148, -13, - -157, -39, -157, -7, -157, -96, -101, -6, -157, 18, - -157, -66, -114, -157, -157, -56, -156, -102, -157 + -179, -179, -179, 255, 171, 16, 241, -179, -179, 266, + -32, -179, 64, -179, -19, -179, 8, -1, -179, 112, + -179, 65, -178, -179, -179, 48, -175, 164, -179, -104 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_uint8 yydefgoto[] = { - 0, 2, 3, 33, 120, 111, 34, 35, 117, 26, - 200, 201, 27, 28, 112, 252, 213, 29, 127, 128, - 184, 185, 186, 224, 230, 231, 81, 82, 83 + 0, 2, 3, 34, 122, 112, 26, 35, 36, 119, + 27, 202, 203, 28, 29, 113, 251, 43, 129, 130, + 185, 186, 187, 223, 229, 230, 83, 84, 85, 212 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1105,422 +1107,266 @@ static const yytype_uint8 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 25, 181, 1, 45, 52, 113, 41, 42, 46, 52, - 40, 266, 259, 43, 53, 30, 80, 113, 47, 49, - 122, 56, 113, 142, 118, 118, 114, 232, 36, 260, - 267, 132, 121, 38, 125, 126, 37, 143, 18, 142, - 211, 39, 144, 18, 215, 216, 44, 218, 219, 220, - 129, 84, 130, 143, 113, 134, 177, 178, 135, 179, - 182, 187, 183, 133, 115, 116, 205, 206, 223, 106, - 107, 108, 198, 109, 199, 138, 115, 116, 147, 31, - 32, 115, 116, 136, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 188, 122, - 232, 255, 139, 115, 116, 192, 196, 140, 197, 269, - 243, 246, 244, 247, -156, -156, 145, 146, 148, 202, - 204, 151, 149, 208, 209, 80, 152, 214, 150, 214, - 214, 193, 214, 214, 80, 285, 180, 286, 287, 288, - 221, 290, -156, -156, 292, 283, 284, 109, 233, 234, - -120, 237, 238, 240, -156, -156, 104, 105, 106, 107, - 108, 253, 109, 254, 256, -119, 229, 222, 257, 194, - 119, 261, 271, 262, 263, 265, 236, 268, 308, 239, - 276, 278, 293, 302, 48, 126, 294, 4, 5, 6, - 7, 8, 9, 123, 295, 303, 214, 277, 10, 309, - 291, 0, 11, 0, 245, 0, 12, 13, 0, 0, - 0, 14, 0, 15, 16, 17, 0, 264, 0, 0, - 0, 0, 0, 270, 0, 18, 0, 0, 0, 0, - 275, 0, 0, 0, 0, 0, 0, 19, 279, 280, - 214, 214, 281, 282, 20, 0, 0, 21, 22, 229, - 23, 0, 24, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 297, 0, 0, - 0, 0, -72, 50, 0, 0, 51, -72, 0, 0, - 52, 0, -72, -72, -72, -72, -72, 0, 305, 306, - 307, 0, -72, -72, -72, 0, 0, -72, -72, -72, - 313, -72, 0, 0, 0, -72, -72, -72, -72, -72, - -72, -72, -72, 0, 18, 0, 0, -72, 0, 0, - -72, -72, -72, -72, -72, -72, -72, -72, -72, -72, - 0, -72, -72, 0, -72, -72, -72, -72, -72, 189, - -72, 0, 4, 5, 6, 7, 8, 9, 0, 0, + 30, 53, 124, 182, 82, 222, 114, 296, 257, 231, + 30, 114, 133, 120, 120, 115, 1, 25, 49, 47, + 30, 30, 52, 52, 48, 258, 30, 41, 264, 144, + 87, 88, 31, 30, 145, 30, 30, 56, 58, 37, + 87, 88, 213, 214, 297, 216, 217, 265, 178, 179, + 123, 180, 127, 128, 267, 38, 18, 18, 183, 39, + 116, 117, 118, 40, 184, 116, 117, 118, 32, 33, + 87, 88, 87, 88, 46, 188, 87, 88, 86, 283, + 30, 284, 285, 286, 89, 288, 30, 30, 290, 231, + 136, 240, 124, 137, 241, 87, 88, 148, 189, 91, + 92, 87, 88, 154, 155, 138, 87, 88, 87, 88, + 140, 87, 88, 141, 94, 87, 88, 30, 146, 270, + 87, 88, 306, 30, 271, 196, 294, 102, 103, 245, + 30, 142, 30, 82, 193, 197, 30, 143, 198, 105, + 106, 107, 108, 109, 110, 111, 200, 199, 201, 205, + 281, 282, 190, 210, 139, 4, 5, 6, 7, 8, + 9, 131, 132, 87, 88, 228, 10, 87, 88, 147, + 11, 87, 88, 246, 12, 13, 247, 309, 30, 14, + 310, 15, 16, 17, 215, 87, 88, 30, 287, 149, + 30, 87, 88, 18, 150, 221, 30, 248, 249, 206, + 207, 250, 308, 151, 235, 19, 152, 238, 312, 87, + 88, 20, 21, 128, 191, 22, 153, 192, 23, 181, + 24, 87, 88, 298, 87, 88, 30, 87, 88, 242, + 256, 243, 30, 87, 88, 299, 109, 110, 111, 30, + 194, 302, 220, 262, 232, 228, 233, 30, 30, 268, + 236, 30, 30, 42, 44, 45, 273, 87, 88, -118, + 237, 239, 254, 252, 277, 278, 269, 255, 279, 280, + 253, 144, -117, 259, 260, 30, 261, 90, 91, 92, + 93, 134, 263, 266, 276, 300, 274, 291, 292, 293, + 125, 301, 295, 94, 95, 195, 30, 30, 30, 121, + 96, 97, 98, 99, 100, 101, 102, 103, 30, 244, + 275, 307, 289, 303, 304, 305, 219, 104, 105, 106, + 107, 108, 109, 110, 111, 311, -154, -154, 0, 0, + 0, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 0, -154, -154, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -154, -154, 107, 108, + 109, 110, 111, 0, 0, 0, 0, 209, 0, 0, + 0, 0, 0, 0, 0, 211, 0, 211, 211, 0, + 211, 211, -60, 50, 0, 0, 51, -60, 0, 0, + 52, 0, -60, -60, -60, -60, -60, 0, 0, 0, + 0, 0, -60, -60, -60, 0, 0, -60, -60, -60, + 0, -60, 0, 0, 0, -60, -60, -60, -60, -60, + -60, -60, -60, 0, 18, 0, 0, -60, 0, 0, + -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, + 0, -60, -60, -60, -60, -60, 0, -60, -60, 54, + -60, 0, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 12, 13, 0, 0, 0, 14, 0, 15, 16, - 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 0, 211, 211, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 19, 0, 0, 0, 0, 0, 0, 20, - 0, 190, 21, 22, 191, 23, 54, 24, 0, 4, + 0, 0, 19, 0, 0, 0, 0, 0, 20, 21, + 0, 0, 22, 0, 55, 23, 57, 24, 0, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 12, 13, 0, 0, 0, 14, 0, 15, 16, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, - 0, 0, 0, 0, 0, 0, 20, 0, 0, 21, - 22, 55, 23, 203, 24, 0, 4, 5, 6, 7, + 0, 0, 0, 0, 0, 20, 21, 0, 0, 22, + 0, 0, 23, 204, 24, 0, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 12, 13, 0, 0, 0, - 14, 0, 15, 16, 17, 0, 0, 4, 5, 6, - 7, 8, 9, 0, 18, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 207, 0, 19, 4, 5, 6, - 7, 8, 9, 20, 16, 17, 21, 22, 10, 23, - 0, 24, 11, 0, 0, 18, 12, 13, 0, 0, - 0, 14, 0, 15, 16, 17, 0, 212, 0, 0, - 0, 0, 0, 0, 20, 18, 0, 21, 22, 0, - 23, 0, 24, 0, 0, 0, 0, 19, 0, 0, - 0, 0, 0, 0, 20, 0, 57, 21, 22, 58, - 23, 59, 24, 52, 0, 86, 87, 0, 0, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 0, 0, - 0, 0, 0, 97, 98, 0, 0, 18, 0, 0, - 0, 0, 0, 0, 0, 102, 103, 104, 105, 106, - 107, 108, 210, 109, 0, 58, 79, 59, 0, 52, - 0, 0, 0, -155, 0, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 0, 0, 0, 4, 5, 6, - 7, 8, 9, 18, 0, 0, 0, 0, 10, 0, - 0, 0, 11, 0, 0, 0, 12, 13, 0, 0, - 0, 14, 79, 15, 16, 17, 0, 0, 0, -155, - 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, - 0, 0, 0, 124, 20, 0, 0, 21, 22, 0, - 23, 0, 24, 4, 5, 6, 7, 8, 9, 0, - 0, 0, 0, 0, 10, 0, 0, 0, 11, 0, - 0, 0, 12, 13, 0, 0, 0, 14, 0, 15, + 14, 0, 15, 16, 17, 0, 0, 0, 0, 91, + 92, 0, 0, 0, 18, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 20, 21, 0, 0, 22, 102, 103, 23, + 208, 24, 0, 4, 5, 6, 7, 8, 9, 105, + 106, 107, 108, 109, 110, 111, 0, 0, 11, 0, + 0, 0, 12, 13, 0, 0, 0, 14, 0, 0, 16, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, - 20, 0, 0, 21, 22, 235, 23, 0, 24, 4, - 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, + 0, 0, 0, 19, 0, 0, 0, 0, 0, 20, + 21, 0, 59, 22, 0, 60, 23, 61, 24, 52, + 0, 0, 0, 0, 0, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 218, 0, 0, + 60, 0, 61, 0, 52, 81, 0, 0, 0, -153, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 4, + 5, 6, 7, 8, 9, 0, 0, 0, 18, 0, 10, 0, 0, 0, 11, 0, 0, 0, 12, 13, 0, 0, 0, 14, 0, 15, 16, 17, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, + 81, 0, 0, 0, -153, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, - 0, 0, 0, 0, 0, 0, 20, 0, 0, 21, - 22, 274, 23, 0, 24, 4, 5, 6, 7, 8, + 0, 0, 0, 0, 0, 20, 21, 126, 0, 22, + 0, 0, 23, 0, 24, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 12, 13, 0, 0, 0, 14, - 0, 15, 16, 17, 0, 0, 4, 5, 6, 7, - 8, 9, 0, 18, 86, 87, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 19, 0, 0, 0, 89, - 0, 0, 20, 16, 17, 21, 22, 0, 23, 0, - 24, 0, 97, 98, 18, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 102, 103, 104, 105, 106, 107, - 108, 0, 109, 20, 0, 225, 21, 22, 226, 23, - 227, 24, 52, 0, 0, 0, 0, 0, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 18, 85, 86, 87, - 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 89, 90, 228, 0, 0, 0, 0, - 91, 92, 93, 94, 95, 96, 97, 98, 0, 0, - 0, 85, 86, 87, 88, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 0, 109, 89, 90, 0, - 241, 0, 0, 242, 91, 92, 93, 94, 95, 96, - 97, 98, 0, 0, 0, 85, 86, 87, 88, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 0, - 109, 89, 90, 0, 0, 0, 0, 141, 91, 92, - 93, 94, 95, 96, 97, 98, 0, 0, 0, 85, - 86, 87, 88, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 0, 109, 89, 90, 0, 0, 0, - 0, 272, 91, 92, 93, 94, 95, 96, 97, 98, - 0, 0, 0, 85, 86, 87, 88, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 0, 109, 89, - 90, 0, 0, 0, 0, 273, 91, 92, 93, 94, - 95, 96, 97, 98, 0, 0, 0, 85, 86, 87, - 88, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 0, 109, 89, 90, 0, 0, 0, 0, 296, - 91, 92, 93, 94, 95, 96, 97, 98, 0, 0, - 0, 0, 0, 0, 0, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 0, 109, 311, 0, 312, - 85, 86, 87, 88, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 89, 90, 0, 0, - 0, 0, 0, 91, 92, 93, 94, 95, 96, 97, - 98, 0, 0, 0, 85, 86, 87, 88, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 0, 109, - 89, 90, 137, 0, 0, 0, 0, 91, 92, 93, - 94, 95, 96, 97, 98, 0, 0, 0, 85, 86, - 87, 88, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 0, 109, 89, 90, 217, 0, 0, 0, - 0, 91, 92, 93, 94, 95, 96, 97, 98, 0, - 0, 0, 85, 86, 87, 88, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 0, 109, 89, 90, - 289, 0, 0, 0, 0, 91, 92, 93, 94, 95, - 96, 97, 98, 0, 0, 0, 85, 86, 87, 88, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 0, 109, 89, 90, 310, 0, 0, 0, 0, 91, - 92, 93, 94, 95, 96, 97, 98, 0, 0, 0, - 85, 86, 87, 88, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 0, 109, 89, 90, 314, 0, - 0, 0, 0, 91, 92, 93, 94, 95, 96, 97, - 98, 0, 0, 0, 0, 0, 0, 0, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 0, 109, - 110, 85, 86, 87, 88, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 89, 90, 0, - 0, 0, 0, 0, 91, 92, 93, 94, 95, 96, - 97, 98, 0, 0, 0, 0, 0, 0, 0, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 0, - 109, 195, 85, 86, 87, 88, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 89, 90, - 0, 0, 0, 0, 0, 91, 92, 93, 94, 95, - 96, 97, 98, 0, 0, 0, 0, 0, 0, 0, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 0, 109, 248, 85, 86, 87, 88, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, - 90, 0, 0, 0, 0, 0, 91, 92, 93, 94, - 95, 96, 97, 98, 0, 0, 0, 0, 0, 0, - 0, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 0, 109, 300, 85, 86, 87, 88, 0, 0, + 0, 15, 16, 17, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, + 0, 20, 21, 0, 0, 22, 0, 234, 23, 0, + 24, 4, 5, 6, 7, 8, 9, 0, 0, 0, + 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, + 12, 13, 0, 0, 0, 14, 0, 15, 16, 17, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 89, 90, 0, 0, 0, 0, 0, 91, 92, 93, - 94, 95, 96, 97, 98, 0, 0, 0, 0, 0, - 0, 0, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 0, 109, 301, 85, 86, 87, 88, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 89, 90, 0, 0, 0, 0, 0, 91, 92, - 93, 94, 95, 96, 97, 98, 0, 0, 0, 0, - 0, 0, 0, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 0, 109, 304, 85, 86, 87, 88, - 0, 0, 0, 0, 0, 0, 0, 249, 250, 0, - 0, 251, 89, 90, 0, 0, 0, 0, 0, 91, - 92, 93, 94, 95, 96, 97, 98, 0, 0, 0, - 0, 0, 0, 0, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 0, 109, 85, 86, 87, 88, - 0, 0, 0, 0, 0, 0, 131, 0, 0, 0, - 0, 0, 89, 90, 0, 0, 0, 0, 0, 91, - 92, 93, 94, 95, 96, 97, 98, 0, 0, 0, - 85, 86, 87, 88, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 0, 109, 89, 90, 0, 0, - 0, 0, 0, 91, 92, 93, 94, 95, 96, 97, - 98, 0, 0, 0, 0, 258, 0, 0, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 0, 109, - 85, 86, 87, 88, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 298, 89, 90, 0, 0, - 0, 0, 0, 91, 92, 93, 94, 95, 96, 97, - 98, 0, 0, 0, 0, 0, 0, 0, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 0, 109, - 85, 86, 87, 88, 0, 0, 0, 0, 0, 0, - 299, 0, 0, 0, 0, 0, 89, 90, 0, 0, - 0, 0, 0, 91, 92, 93, 94, 95, 96, 97, - 98, 0, 0, 0, 85, 86, 87, 88, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 0, 109, - 89, 90, 0, 0, 0, 0, 0, 91, 92, 93, - 94, 95, 96, 97, 98, 0, 0, 0, 85, 86, - 87, 88, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 0, 109, 89, 90, 0, 0, 0, 0, - 0, 91, 92, 93, 94, 95, 96, 97, 98, 0, - 0, 0, -156, 86, 87, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 108, 0, 109, 89, 90, - 0, 0, 0, 0, 0, -156, -156, -156, -156, -156, - -156, 97, 98, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -156, 102, 103, 104, 105, 106, 107, 108, - 0, 109 + 0, 19, 0, 0, 0, 0, 0, 20, 21, 0, + 0, 22, 0, 272, 23, 0, 24, 4, 5, 6, + 7, 8, 9, 0, 0, 0, 0, 0, 10, 0, + 0, 0, 11, 0, 0, 0, 12, 13, 0, 0, + 0, 14, 0, 15, 16, 17, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, + 0, 0, 0, 20, 21, 0, 0, 22, 0, 0, + 23, 0, 24, 4, 5, 6, 7, 8, 9, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, + 0, 0, 12, 13, 0, 0, 0, 14, 0, 0, + 16, 17, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 19, 0, 0, 0, 0, 0, 20, + 21, 0, 224, 22, 0, 225, 23, 226, 24, 52, + 0, 0, 0, 0, 0, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 90, 91, 92, 93, 135, 0, 0, + 0, 0, 0, 18, 0, 0, 0, 0, 0, 94, + 95, 0, 0, 0, 0, 0, 96, 97, 98, 99, + 100, 101, 102, 103, 0, 227, 90, 91, 92, 93, + 0, 0, 0, 104, 105, 106, 107, 108, 109, 110, + 111, 0, 94, 95, 0, 0, 0, 0, 0, 96, + 97, 98, 99, 100, 101, 102, 103, 0, -154, 91, + 92, 0, 0, 0, 0, 0, 104, 105, 106, 107, + 108, 109, 110, 111, 94, 95, 0, 0, 0, 0, + 0, -154, -154, -154, -154, -154, -154, 102, 103, 0, + 0, 0, 0, 0, 0, 0, 0, 0, -154, 105, + 106, 107, 108, 109, 110, 111 }; static const yytype_int16 yycheck[] = { - 1, 6, 16, 1, 8, 5, 12, 13, 6, 8, - 11, 49, 49, 14, 21, 0, 23, 5, 19, 20, - 33, 22, 5, 49, 31, 32, 14, 183, 61, 66, - 68, 14, 33, 42, 35, 36, 59, 63, 42, 49, - 142, 4, 68, 42, 145, 146, 6, 148, 149, 151, - 61, 69, 63, 63, 5, 29, 43, 44, 48, 46, - 65, 65, 67, 14, 64, 65, 132, 133, 182, 55, - 56, 57, 4, 59, 6, 1, 64, 65, 79, 17, - 18, 64, 65, 62, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 115, 122, - 266, 212, 59, 64, 65, 116, 60, 66, 62, 233, - 4, 60, 6, 62, 11, 12, 63, 63, 63, 130, - 131, 49, 63, 134, 135, 142, 69, 143, 68, 145, - 146, 14, 148, 149, 151, 259, 59, 261, 262, 263, - 6, 265, 39, 40, 268, 256, 257, 59, 41, 48, - 41, 59, 66, 59, 51, 52, 53, 54, 55, 56, - 57, 61, 59, 61, 48, 41, 183, 178, 63, 122, - 32, 63, 59, 63, 63, 63, 187, 63, 302, 190, - 59, 63, 59, 63, 1, 196, 59, 4, 5, 6, - 7, 8, 9, 34, 59, 59, 212, 246, 15, 305, - 266, -1, 19, -1, 196, -1, 23, 24, -1, -1, - -1, 28, -1, 30, 31, 32, -1, 228, -1, -1, - -1, -1, -1, 234, -1, 42, -1, -1, -1, -1, - 241, -1, -1, -1, -1, -1, -1, 54, 249, 250, - 256, 257, 253, 254, 61, -1, -1, 64, 65, 266, - 67, -1, 69, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 278, -1, -1, - -1, -1, 0, 1, -1, -1, 4, 5, -1, -1, - 8, -1, 10, 11, 12, 13, 14, -1, 299, 300, - 301, -1, 20, 21, 22, -1, -1, 25, 26, 27, - 311, 29, -1, -1, -1, 33, 34, 35, 36, 37, + 1, 20, 34, 6, 23, 183, 5, 25, 49, 184, + 11, 5, 20, 32, 33, 14, 16, 1, 19, 1, + 21, 22, 8, 8, 6, 66, 27, 11, 49, 63, + 48, 49, 0, 34, 68, 36, 37, 21, 22, 64, + 48, 49, 146, 147, 20, 149, 150, 68, 43, 44, + 34, 46, 36, 37, 232, 59, 42, 42, 61, 42, + 59, 60, 61, 4, 67, 59, 60, 61, 17, 18, + 48, 49, 48, 49, 6, 61, 48, 49, 69, 257, + 81, 259, 260, 261, 62, 263, 87, 88, 266, 264, + 29, 63, 124, 48, 66, 48, 49, 81, 117, 11, + 12, 48, 49, 87, 88, 1, 48, 49, 48, 49, + 66, 48, 49, 66, 26, 48, 49, 118, 63, 66, + 48, 49, 300, 124, 66, 62, 66, 39, 40, 62, + 131, 65, 133, 152, 118, 62, 137, 65, 65, 51, + 52, 53, 54, 55, 56, 57, 4, 131, 6, 133, + 254, 255, 1, 137, 59, 4, 5, 6, 7, 8, + 9, 63, 64, 48, 49, 184, 15, 48, 49, 63, + 19, 48, 49, 62, 23, 24, 65, 62, 179, 28, + 65, 30, 31, 32, 65, 48, 49, 188, 65, 63, + 191, 48, 49, 42, 63, 179, 197, 21, 22, 134, + 135, 25, 65, 68, 188, 54, 49, 191, 65, 48, + 49, 60, 61, 197, 63, 64, 69, 66, 67, 59, + 69, 48, 49, 62, 48, 49, 227, 48, 49, 4, + 45, 6, 233, 48, 49, 62, 55, 56, 57, 240, + 14, 62, 6, 227, 41, 264, 48, 248, 249, 233, + 59, 252, 253, 12, 13, 14, 240, 48, 49, 41, + 66, 59, 48, 64, 248, 249, 59, 63, 252, 253, + 64, 63, 41, 63, 63, 276, 63, 10, 11, 12, + 13, 14, 63, 63, 63, 63, 59, 59, 59, 59, + 35, 59, 276, 26, 27, 124, 297, 298, 299, 33, + 33, 34, 35, 36, 37, 38, 39, 40, 309, 197, + 246, 303, 264, 297, 298, 299, 152, 50, 51, 52, + 53, 54, 55, 56, 57, 309, 11, 12, -1, -1, + -1, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, -1, 39, 40, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, + 55, 56, 57, -1, -1, -1, -1, 136, -1, -1, + -1, -1, -1, -1, -1, 144, -1, 146, 147, -1, + 149, 150, 0, 1, -1, -1, 4, 5, -1, -1, + 8, -1, 10, 11, 12, 13, 14, -1, -1, -1, + -1, -1, 20, 21, 22, -1, -1, 25, 26, 27, + -1, 29, -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, -1, 42, -1, -1, 45, -1, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - -1, 59, 60, -1, 62, 63, 64, 65, 66, 1, + -1, 59, 60, 61, 62, 63, -1, 65, 66, 1, 68, -1, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, 15, -1, -1, -1, 19, -1, -1, -1, 23, 24, -1, -1, -1, 28, -1, 30, 31, - 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 32, -1, -1, -1, -1, 254, 255, -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 54, -1, -1, -1, -1, -1, -1, 61, - -1, 63, 64, 65, 66, 67, 1, 69, -1, 4, + -1, -1, 54, -1, -1, -1, -1, -1, 60, 61, + -1, -1, 64, -1, 66, 67, 1, 69, -1, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, 15, -1, -1, -1, 19, -1, -1, -1, 23, 24, -1, -1, -1, 28, -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 54, - -1, -1, -1, -1, -1, -1, 61, -1, -1, 64, - 65, 66, 67, 1, 69, -1, 4, 5, 6, 7, + -1, -1, -1, -1, -1, 60, 61, -1, -1, 64, + -1, -1, 67, 1, 69, -1, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, 15, -1, -1, -1, 19, -1, -1, -1, 23, 24, -1, -1, -1, - 28, -1, 30, 31, 32, -1, -1, 4, 5, 6, - 7, 8, 9, -1, 42, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 1, -1, 54, 4, 5, 6, - 7, 8, 9, 61, 31, 32, 64, 65, 15, 67, - -1, 69, 19, -1, -1, 42, 23, 24, -1, -1, - -1, 28, -1, 30, 31, 32, -1, 54, -1, -1, - -1, -1, -1, -1, 61, 42, -1, 64, 65, -1, - 67, -1, 69, -1, -1, -1, -1, 54, -1, -1, - -1, -1, -1, -1, 61, -1, 1, 64, 65, 4, - 67, 6, 69, 8, -1, 11, 12, -1, -1, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, - -1, -1, -1, 39, 40, -1, -1, 42, -1, -1, - -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, - 56, 57, 1, 59, -1, 4, 61, 6, -1, 8, - -1, -1, -1, 68, -1, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, -1, -1, -1, 4, 5, 6, - 7, 8, 9, 42, -1, -1, -1, -1, 15, -1, - -1, -1, 19, -1, -1, -1, 23, 24, -1, -1, - -1, 28, 61, 30, 31, 32, -1, -1, -1, 68, - -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 54, -1, -1, - -1, -1, -1, 60, 61, -1, -1, 64, 65, -1, - 67, -1, 69, 4, 5, 6, 7, 8, 9, -1, - -1, -1, -1, -1, 15, -1, -1, -1, 19, -1, - -1, -1, 23, 24, -1, -1, -1, 28, -1, 30, + 28, -1, 30, 31, 32, -1, -1, -1, -1, 11, + 12, -1, -1, -1, 42, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 54, -1, -1, -1, + -1, -1, 60, 61, -1, -1, 64, 39, 40, 67, + 1, 69, -1, 4, 5, 6, 7, 8, 9, 51, + 52, 53, 54, 55, 56, 57, -1, -1, 19, -1, + -1, -1, 23, 24, -1, -1, -1, 28, -1, -1, 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 54, -1, -1, -1, -1, -1, -1, - 61, -1, -1, 64, 65, 66, 67, -1, 69, 4, - 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, + -1, -1, -1, 54, -1, -1, -1, -1, -1, 60, + 61, -1, 1, 64, -1, 4, 67, 6, 69, 8, + -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, + 4, -1, 6, -1, 8, 64, -1, -1, -1, 68, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 4, + 5, 6, 7, 8, 9, -1, -1, -1, 42, -1, 15, -1, -1, -1, 19, -1, -1, -1, 23, 24, -1, -1, -1, 28, -1, 30, 31, 32, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 42, -1, -1, + 64, -1, -1, -1, 68, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 54, - -1, -1, -1, -1, -1, -1, 61, -1, -1, 64, - 65, 66, 67, -1, 69, 4, 5, 6, 7, 8, + -1, -1, -1, -1, -1, 60, 61, 62, -1, 64, + -1, -1, 67, -1, 69, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, 15, -1, -1, -1, 19, -1, -1, -1, 23, 24, -1, -1, -1, 28, - -1, 30, 31, 32, -1, -1, 4, 5, 6, 7, - 8, 9, -1, 42, 11, 12, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 54, -1, -1, -1, 26, - -1, -1, 61, 31, 32, 64, 65, -1, 67, -1, - 69, -1, 39, 40, 42, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, - 57, -1, 59, 61, -1, 1, 64, 65, 4, 67, - 6, 69, 8, -1, -1, -1, -1, -1, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 42, 10, 11, 12, - 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 26, 27, 61, -1, -1, -1, -1, - 33, 34, 35, 36, 37, 38, 39, 40, -1, -1, - -1, 10, 11, 12, 13, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, -1, 59, 26, 27, -1, - 63, -1, -1, 66, 33, 34, 35, 36, 37, 38, - 39, 40, -1, -1, -1, 10, 11, 12, 13, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, - 59, 26, 27, -1, -1, -1, -1, 66, 33, 34, - 35, 36, 37, 38, 39, 40, -1, -1, -1, 10, - 11, 12, 13, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, -1, 59, 26, 27, -1, -1, -1, - -1, 66, 33, 34, 35, 36, 37, 38, 39, 40, - -1, -1, -1, 10, 11, 12, 13, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, -1, 59, 26, - 27, -1, -1, -1, -1, 66, 33, 34, 35, 36, - 37, 38, 39, 40, -1, -1, -1, 10, 11, 12, - 13, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, -1, 59, 26, 27, -1, -1, -1, -1, 66, - 33, 34, 35, 36, 37, 38, 39, 40, -1, -1, - -1, -1, -1, -1, -1, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, -1, 59, 60, -1, 62, - 10, 11, 12, 13, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 26, 27, -1, -1, - -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, - 40, -1, -1, -1, 10, 11, 12, 13, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 26, 27, 62, -1, -1, -1, -1, 33, 34, 35, - 36, 37, 38, 39, 40, -1, -1, -1, 10, 11, - 12, 13, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 26, 27, 62, -1, -1, -1, - -1, 33, 34, 35, 36, 37, 38, 39, 40, -1, - -1, -1, 10, 11, 12, 13, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, -1, 59, 26, 27, - 62, -1, -1, -1, -1, 33, 34, 35, 36, 37, - 38, 39, 40, -1, -1, -1, 10, 11, 12, 13, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - -1, 59, 26, 27, 62, -1, -1, -1, -1, 33, - 34, 35, 36, 37, 38, 39, 40, -1, -1, -1, - 10, 11, 12, 13, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, -1, 59, 26, 27, 62, -1, - -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, - 40, -1, -1, -1, -1, -1, -1, -1, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 60, 10, 11, 12, 13, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 26, 27, -1, - -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, - 39, 40, -1, -1, -1, -1, -1, -1, -1, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, -1, - 59, 60, 10, 11, 12, 13, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 26, 27, - -1, -1, -1, -1, -1, 33, 34, 35, 36, 37, - 38, 39, 40, -1, -1, -1, -1, -1, -1, -1, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - -1, 59, 60, 10, 11, 12, 13, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 26, - 27, -1, -1, -1, -1, -1, 33, 34, 35, 36, - 37, 38, 39, 40, -1, -1, -1, -1, -1, -1, - -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, -1, 59, 60, 10, 11, 12, 13, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 26, 27, -1, -1, -1, -1, -1, 33, 34, 35, - 36, 37, 38, 39, 40, -1, -1, -1, -1, -1, - -1, -1, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 60, 10, 11, 12, 13, -1, + -1, 30, 31, 32, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 54, -1, -1, -1, -1, + -1, 60, 61, -1, -1, 64, -1, 66, 67, -1, + 69, 4, 5, 6, 7, 8, 9, -1, -1, -1, + -1, -1, 15, -1, -1, -1, 19, -1, -1, -1, + 23, 24, -1, -1, -1, 28, -1, 30, 31, 32, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 26, 27, -1, -1, -1, -1, -1, 33, 34, - 35, 36, 37, 38, 39, 40, -1, -1, -1, -1, - -1, -1, -1, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, -1, 59, 60, 10, 11, 12, 13, - -1, -1, -1, -1, -1, -1, -1, 21, 22, -1, - -1, 25, 26, 27, -1, -1, -1, -1, -1, 33, - 34, 35, 36, 37, 38, 39, 40, -1, -1, -1, - -1, -1, -1, -1, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, -1, 59, 10, 11, 12, 13, - -1, -1, -1, -1, -1, -1, 20, -1, -1, -1, - -1, -1, 26, 27, -1, -1, -1, -1, -1, 33, - 34, 35, 36, 37, 38, 39, 40, -1, -1, -1, - 10, 11, 12, 13, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, -1, 59, 26, 27, -1, -1, - -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, - 40, -1, -1, -1, -1, 45, -1, -1, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 10, 11, 12, 13, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 25, 26, 27, -1, -1, - -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, - 40, -1, -1, -1, -1, -1, -1, -1, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 10, 11, 12, 13, -1, -1, -1, -1, -1, -1, - 20, -1, -1, -1, -1, -1, 26, 27, -1, -1, - -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, - 40, -1, -1, -1, 10, 11, 12, 13, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, -1, 59, - 26, 27, -1, -1, -1, -1, -1, 33, 34, 35, - 36, 37, 38, 39, 40, -1, -1, -1, 10, 11, - 12, 13, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, -1, 59, 26, 27, -1, -1, -1, -1, + -1, 54, -1, -1, -1, -1, -1, 60, 61, -1, + -1, 64, -1, 66, 67, -1, 69, 4, 5, 6, + 7, 8, 9, -1, -1, -1, -1, -1, 15, -1, + -1, -1, 19, -1, -1, -1, 23, 24, -1, -1, + -1, 28, -1, 30, 31, 32, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 54, -1, -1, + -1, -1, -1, 60, 61, -1, -1, 64, -1, -1, + 67, -1, 69, 4, 5, 6, 7, 8, 9, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 19, -1, + -1, -1, 23, 24, -1, -1, -1, 28, -1, -1, + 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 54, -1, -1, -1, -1, -1, 60, + 61, -1, 1, 64, -1, 4, 67, 6, 69, 8, + -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 10, 11, 12, 13, 14, -1, -1, + -1, -1, -1, 42, -1, -1, -1, -1, -1, 26, + 27, -1, -1, -1, -1, -1, 33, 34, 35, 36, + 37, 38, 39, 40, -1, 64, 10, 11, 12, 13, + -1, -1, -1, 50, 51, 52, 53, 54, 55, 56, + 57, -1, 26, 27, -1, -1, -1, -1, -1, 33, + 34, 35, 36, 37, 38, 39, 40, -1, 10, 11, + 12, -1, -1, -1, -1, -1, 50, 51, 52, 53, + 54, 55, 56, 57, 26, 27, -1, -1, -1, -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, -1, - -1, -1, 10, 11, 12, -1, -1, -1, 50, 51, - 52, 53, 54, 55, 56, 57, -1, 59, 26, 27, - -1, -1, -1, -1, -1, 33, 34, 35, 36, 37, - 38, 39, 40, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 50, 51, 52, 53, 54, 55, 56, 57, - -1, 59 + -1, -1, -1, -1, -1, -1, -1, -1, 50, 51, + 52, 53, 54, 55, 56, 57 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of @@ -1529,80 +1375,80 @@ static const yytype_int8 yystos[] = { 0, 16, 71, 72, 4, 5, 6, 7, 8, 9, 15, 19, 23, 24, 28, 30, 31, 32, 42, 54, - 61, 64, 65, 67, 69, 75, 79, 82, 83, 87, - 0, 17, 18, 73, 76, 77, 61, 59, 42, 4, - 75, 87, 87, 75, 6, 1, 6, 75, 1, 75, - 1, 4, 8, 83, 1, 66, 75, 1, 4, 6, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 61, - 83, 96, 97, 98, 69, 10, 11, 12, 13, 26, - 27, 33, 34, 35, 36, 37, 38, 39, 40, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, - 60, 75, 84, 5, 14, 64, 65, 78, 83, 78, - 74, 75, 79, 73, 60, 75, 75, 88, 89, 61, - 63, 20, 14, 14, 29, 48, 62, 62, 1, 59, - 66, 66, 49, 63, 68, 63, 63, 75, 63, 63, - 68, 49, 69, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 43, 44, 46, - 59, 6, 65, 67, 90, 91, 92, 65, 83, 1, - 63, 66, 75, 14, 74, 60, 60, 62, 4, 6, - 80, 81, 75, 1, 75, 91, 91, 1, 75, 75, - 1, 97, 54, 86, 87, 86, 86, 62, 86, 86, - 97, 6, 75, 92, 93, 1, 4, 6, 61, 83, - 94, 95, 96, 41, 48, 66, 75, 59, 66, 75, - 59, 63, 66, 4, 6, 89, 60, 62, 60, 21, - 22, 25, 85, 61, 61, 86, 48, 63, 45, 49, - 66, 63, 63, 63, 75, 63, 49, 68, 63, 92, - 75, 59, 66, 66, 66, 75, 59, 81, 63, 75, - 75, 75, 75, 86, 86, 92, 92, 92, 92, 62, - 92, 95, 92, 59, 59, 59, 66, 75, 25, 20, - 60, 60, 63, 59, 60, 75, 75, 75, 92, 85, - 62, 60, 62, 75, 62 + 60, 61, 64, 67, 69, 75, 76, 80, 83, 84, + 87, 0, 17, 18, 73, 77, 78, 64, 59, 42, + 4, 75, 76, 87, 76, 76, 6, 1, 6, 87, + 1, 4, 8, 84, 1, 66, 75, 1, 75, 1, + 4, 6, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 64, 84, 96, 97, 98, 69, 48, 49, 62, + 10, 11, 12, 13, 26, 27, 33, 34, 35, 36, + 37, 38, 39, 40, 50, 51, 52, 53, 54, 55, + 56, 57, 75, 85, 5, 14, 59, 60, 61, 79, + 84, 79, 74, 75, 80, 73, 62, 75, 75, 88, + 89, 63, 64, 20, 14, 14, 29, 48, 1, 59, + 66, 66, 65, 65, 63, 68, 63, 63, 75, 63, + 63, 68, 49, 69, 75, 75, 76, 76, 76, 76, + 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, + 76, 76, 76, 76, 76, 76, 76, 76, 43, 44, + 46, 59, 6, 61, 67, 90, 91, 92, 61, 84, + 1, 63, 66, 75, 14, 74, 62, 62, 65, 75, + 4, 6, 81, 82, 1, 75, 91, 91, 1, 76, + 75, 76, 99, 99, 99, 65, 99, 99, 1, 97, + 6, 75, 92, 93, 1, 4, 6, 64, 84, 94, + 95, 96, 41, 48, 66, 75, 59, 66, 75, 59, + 63, 66, 4, 6, 89, 62, 62, 65, 21, 22, + 25, 86, 64, 64, 48, 63, 45, 49, 66, 63, + 63, 63, 75, 63, 49, 68, 63, 92, 75, 59, + 66, 66, 66, 75, 59, 82, 63, 75, 75, 75, + 75, 99, 99, 92, 92, 92, 92, 65, 92, 95, + 92, 59, 59, 59, 66, 75, 25, 20, 62, 62, + 63, 59, 62, 75, 75, 75, 92, 86, 65, 62, + 65, 75, 65 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int8 yyr1[] = { 0, 70, 71, 71, 72, 72, 73, 73, 74, 74, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 76, 76, - 77, 77, 77, 78, 79, 79, 80, 80, 81, 81, - 82, 82, 83, 84, 84, 84, 85, 85, 85, 86, - 86, 86, 87, 87, 87, 87, 87, 87, 87, 87, + 75, 75, 75, 75, 75, 75, 76, 76, 76, 76, + 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, + 76, 76, 76, 76, 76, 76, 76, 76, 76, 77, + 77, 78, 78, 78, 79, 80, 80, 81, 81, 82, + 82, 83, 83, 84, 85, 85, 85, 86, 86, 86, + 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, 87, 88, 88, 89, 90, - 90, 91, 91, 92, 92, 92, 93, 93, 94, 94, - 95, 95, 95, 95, 95, 95, 95, 96, 96, 96, + 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 88, 88, 89, 90, 90, 91, + 91, 92, 92, 92, 93, 93, 94, 94, 95, 95, + 95, 95, 95, 95, 95, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, - 96, 96, 96, 96, 96, 97, 97, 97, 97, 98, - 98, 98, 98, 98, 98, 98, 98, 98, 98, 98 + 96, 96, 96, 97, 97, 97, 98, 98, 98, 98, + 98, 98, 98, 98, 98, 98, 98, 99, 99 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 3, 3, 0, 3, 0, 2, 0, 2, - 2, 5, 9, 11, 9, 5, 4, 4, 2, 4, - 4, 2, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 1, 2, 3, - 4, 4, 2, 1, 5, 8, 1, 3, 1, 1, - 2, 1, 3, 0, 2, 4, 5, 3, 1, 3, - 2, 1, 1, 1, 2, 2, 3, 2, 4, 3, - 2, 1, 3, 2, 2, 3, 5, 4, 6, 5, - 4, 3, 5, 4, 7, 6, 6, 6, 5, 5, - 1, 1, 1, 3, 3, 2, 3, 4, 1, 1, - 1, 4, 3, 3, 4, 3, 1, 3, 1, 3, - 1, 3, 1, 1, 3, 3, 1, 3, 1, 3, - 1, 3, 3, 3, 3, 5, 3, 1, 1, 1, + 2, 5, 4, 3, 3, 1, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 1, 2, + 3, 4, 4, 2, 1, 5, 8, 1, 3, 1, + 1, 2, 1, 3, 0, 2, 4, 5, 3, 1, + 1, 1, 2, 2, 3, 2, 4, 3, 2, 1, + 3, 2, 2, 3, 5, 4, 6, 5, 4, 3, + 5, 4, 7, 6, 6, 6, 5, 5, 2, 1, + 1, 1, 2, 3, 3, 2, 3, 9, 11, 9, + 5, 4, 4, 4, 2, 4, 1, 1, 1, 4, + 3, 3, 4, 3, 1, 3, 1, 3, 1, 3, + 1, 1, 3, 3, 1, 3, 1, 3, 1, 3, + 3, 3, 3, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0, 1, 3, 3, 3, - 3, 3, 1, 3, 1, 1, 1, 1, 5, 3 + 1, 1, 1, 0, 1, 3, 3, 3, 3, 1, + 3, 1, 1, 1, 1, 5, 3, 3, 1 }; @@ -2172,199 +2018,205 @@ yydestruct (const char *yymsg, case YYSYMBOL_IDENT: /* IDENT */ #line 37 "src/parser.y" { jv_free(((*yyvaluep).literal)); } -#line 2176 "src/parser.c" +#line 2022 "src/parser.c" break; case YYSYMBOL_FIELD: /* FIELD */ #line 37 "src/parser.y" { jv_free(((*yyvaluep).literal)); } -#line 2182 "src/parser.c" +#line 2028 "src/parser.c" break; case YYSYMBOL_BINDING: /* BINDING */ #line 37 "src/parser.y" { jv_free(((*yyvaluep).literal)); } -#line 2188 "src/parser.c" +#line 2034 "src/parser.c" break; case YYSYMBOL_LITERAL: /* LITERAL */ #line 37 "src/parser.y" { jv_free(((*yyvaluep).literal)); } -#line 2194 "src/parser.c" +#line 2040 "src/parser.c" break; case YYSYMBOL_FORMAT: /* FORMAT */ #line 37 "src/parser.y" { jv_free(((*yyvaluep).literal)); } -#line 2200 "src/parser.c" +#line 2046 "src/parser.c" break; case YYSYMBOL_QQSTRING_TEXT: /* QQSTRING_TEXT */ #line 37 "src/parser.y" { jv_free(((*yyvaluep).literal)); } -#line 2206 "src/parser.c" +#line 2052 "src/parser.c" break; case YYSYMBOL_Module: /* Module */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2212 "src/parser.c" +#line 2058 "src/parser.c" break; case YYSYMBOL_Imports: /* Imports */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2218 "src/parser.c" +#line 2064 "src/parser.c" break; case YYSYMBOL_FuncDefs: /* FuncDefs */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2224 "src/parser.c" +#line 2070 "src/parser.c" + break; + + case YYSYMBOL_Query: /* Query */ +#line 38 "src/parser.y" + { block_free(((*yyvaluep).blk)); } +#line 2076 "src/parser.c" break; - case YYSYMBOL_Exp: /* Exp */ + case YYSYMBOL_Expr: /* Expr */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2230 "src/parser.c" +#line 2082 "src/parser.c" break; case YYSYMBOL_Import: /* Import */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2236 "src/parser.c" +#line 2088 "src/parser.c" break; case YYSYMBOL_ImportWhat: /* ImportWhat */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2242 "src/parser.c" +#line 2094 "src/parser.c" break; case YYSYMBOL_ImportFrom: /* ImportFrom */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2248 "src/parser.c" +#line 2100 "src/parser.c" break; case YYSYMBOL_FuncDef: /* FuncDef */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2254 "src/parser.c" +#line 2106 "src/parser.c" break; case YYSYMBOL_Params: /* Params */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2260 "src/parser.c" +#line 2112 "src/parser.c" break; case YYSYMBOL_Param: /* Param */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2266 "src/parser.c" +#line 2118 "src/parser.c" break; case YYSYMBOL_StringStart: /* StringStart */ #line 37 "src/parser.y" { jv_free(((*yyvaluep).literal)); } -#line 2272 "src/parser.c" +#line 2124 "src/parser.c" break; case YYSYMBOL_String: /* String */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2278 "src/parser.c" +#line 2130 "src/parser.c" break; case YYSYMBOL_QQString: /* QQString */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2284 "src/parser.c" +#line 2136 "src/parser.c" break; case YYSYMBOL_ElseBody: /* ElseBody */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2290 "src/parser.c" - break; - - case YYSYMBOL_ExpD: /* ExpD */ -#line 38 "src/parser.y" - { block_free(((*yyvaluep).blk)); } -#line 2296 "src/parser.c" +#line 2142 "src/parser.c" break; case YYSYMBOL_Term: /* Term */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2302 "src/parser.c" +#line 2148 "src/parser.c" break; case YYSYMBOL_Args: /* Args */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2308 "src/parser.c" +#line 2154 "src/parser.c" break; case YYSYMBOL_Arg: /* Arg */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2314 "src/parser.c" +#line 2160 "src/parser.c" break; case YYSYMBOL_RepPatterns: /* RepPatterns */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2320 "src/parser.c" +#line 2166 "src/parser.c" break; case YYSYMBOL_Patterns: /* Patterns */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2326 "src/parser.c" +#line 2172 "src/parser.c" break; case YYSYMBOL_Pattern: /* Pattern */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2332 "src/parser.c" +#line 2178 "src/parser.c" break; case YYSYMBOL_ArrayPats: /* ArrayPats */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2338 "src/parser.c" +#line 2184 "src/parser.c" break; case YYSYMBOL_ObjPats: /* ObjPats */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2344 "src/parser.c" +#line 2190 "src/parser.c" break; case YYSYMBOL_ObjPat: /* ObjPat */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2350 "src/parser.c" +#line 2196 "src/parser.c" break; case YYSYMBOL_Keyword: /* Keyword */ #line 37 "src/parser.y" { jv_free(((*yyvaluep).literal)); } -#line 2356 "src/parser.c" +#line 2202 "src/parser.c" + break; + + case YYSYMBOL_DictPairs: /* DictPairs */ +#line 38 "src/parser.y" + { block_free(((*yyvaluep).blk)); } +#line 2208 "src/parser.c" break; - case YYSYMBOL_MkDict: /* MkDict */ + case YYSYMBOL_DictPair: /* DictPair */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2362 "src/parser.c" +#line 2214 "src/parser.c" break; - case YYSYMBOL_MkDictPair: /* MkDictPair */ + case YYSYMBOL_DictExpr: /* DictExpr */ #line 38 "src/parser.y" { block_free(((*yyvaluep).blk)); } -#line 2368 "src/parser.c" +#line 2220 "src/parser.c" break; default: @@ -2667,12 +2519,12 @@ YYLTYPE yylloc = yyloc_default; YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: /* TopLevel: Module Imports Exp */ + case 2: /* TopLevel: Module Imports Query */ #line 290 "src/parser.y" - { + { *answer = BLOCK((yyvsp[-2].blk), (yyvsp[-1].blk), gen_op_simple(TOP), (yyvsp[0].blk)); } -#line 2676 "src/parser.c" +#line 2528 "src/parser.c" break; case 3: /* TopLevel: Module Imports FuncDefs */ @@ -2680,7 +2532,7 @@ YYLTYPE yylloc = yyloc_default; { *answer = BLOCK((yyvsp[-2].blk), (yyvsp[-1].blk), (yyvsp[0].blk)); } -#line 2684 "src/parser.c" +#line 2536 "src/parser.c" break; case 4: /* Module: %empty */ @@ -2688,12 +2540,12 @@ YYLTYPE yylloc = yyloc_default; { (yyval.blk) = gen_noop(); } -#line 2692 "src/parser.c" +#line 2544 "src/parser.c" break; - case 5: /* Module: "module" Exp ';' */ + case 5: /* Module: "module" Query ';' */ #line 301 "src/parser.y" - { + { if (!block_is_const((yyvsp[-1].blk))) { FAIL((yyloc), "Module metadata must be constant"); (yyval.blk) = gen_noop(); @@ -2706,7 +2558,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.blk) = gen_module((yyvsp[-1].blk)); } } -#line 2710 "src/parser.c" +#line 2562 "src/parser.c" break; case 6: /* Imports: %empty */ @@ -2714,7 +2566,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.blk) = gen_noop(); } -#line 2718 "src/parser.c" +#line 2570 "src/parser.c" break; case 7: /* Imports: Import Imports */ @@ -2722,7 +2574,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.blk) = BLOCK((yyvsp[-1].blk), (yyvsp[0].blk)); } -#line 2726 "src/parser.c" +#line 2578 "src/parser.c" break; case 8: /* FuncDefs: %empty */ @@ -2730,7 +2582,7 @@ YYLTYPE yylloc = yyloc_default; { (yyval.blk) = gen_noop(); } -#line 2734 "src/parser.c" +#line 2586 "src/parser.c" break; case 9: /* FuncDefs: FuncDef FuncDefs */ @@ -2738,329 +2590,255 @@ YYLTYPE yylloc = yyloc_default; { (yyval.blk) = block_join((yyvsp[-1].blk), (yyvsp[0].blk)); } -#line 2742 "src/parser.c" +#line 2594 "src/parser.c" break; - case 10: /* Exp: FuncDef Exp */ -#line 332 "src/parser.y" - { + case 10: /* Query: FuncDef Query */ +#line 333 "src/parser.y" + { (yyval.blk) = block_bind_referenced((yyvsp[-1].blk), (yyvsp[0].blk), OP_IS_CALL_PSEUDO); } -#line 2750 "src/parser.c" +#line 2602 "src/parser.c" break; - case 11: /* Exp: Term "as" Patterns '|' Exp */ + case 11: /* Query: Term "as" Patterns '|' Query */ #line 336 "src/parser.y" - { + { (yyval.blk) = gen_destructure((yyvsp[-4].blk), (yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 2758 "src/parser.c" +#line 2610 "src/parser.c" break; - case 12: /* Exp: "reduce" Term "as" Patterns '(' Exp ';' Exp ')' */ + case 12: /* Query: "label" BINDING '|' Query */ #line 339 "src/parser.y" - { - (yyval.blk) = gen_reduce((yyvsp[-7].blk), (yyvsp[-5].blk), (yyvsp[-3].blk), (yyvsp[-1].blk)); + { + jv v = jv_string_fmt("*label-%s", jv_string_value((yyvsp[-2].literal))); + (yyval.blk) = gen_location((yyloc), locations, gen_label(jv_string_value(v), (yyvsp[0].blk))); + jv_free((yyvsp[-2].literal)); + jv_free(v); } -#line 2766 "src/parser.c" +#line 2621 "src/parser.c" break; - case 13: /* Exp: "foreach" Term "as" Patterns '(' Exp ';' Exp ';' Exp ')' */ -#line 343 "src/parser.y" - { - (yyval.blk) = gen_foreach((yyvsp[-9].blk), (yyvsp[-7].blk), (yyvsp[-5].blk), (yyvsp[-3].blk), (yyvsp[-1].blk)); + case 13: /* Query: Query '|' Query */ +#line 345 "src/parser.y" + { + (yyval.blk) = block_join((yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 2774 "src/parser.c" +#line 2629 "src/parser.c" break; - case 14: /* Exp: "foreach" Term "as" Patterns '(' Exp ';' Exp ')' */ -#line 347 "src/parser.y" - { - (yyval.blk) = gen_foreach((yyvsp[-7].blk), (yyvsp[-5].blk), (yyvsp[-3].blk), (yyvsp[-1].blk), gen_noop()); + case 14: /* Query: Query ',' Query */ +#line 348 "src/parser.y" + { + (yyval.blk) = gen_both((yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 2782 "src/parser.c" +#line 2637 "src/parser.c" break; - case 15: /* Exp: "if" Exp "then" Exp ElseBody */ + case 15: /* Query: Expr */ #line 351 "src/parser.y" - { - (yyval.blk) = gen_cond((yyvsp[-3].blk), (yyvsp[-1].blk), (yyvsp[0].blk)); -} -#line 2790 "src/parser.c" - break; - - case 16: /* Exp: "if" Exp "then" error */ -#line 354 "src/parser.y" - { - FAIL((yyloc), "Possibly unterminated 'if' statement"); - (yyval.blk) = (yyvsp[-2].blk); -} -#line 2799 "src/parser.c" - break; - - case 17: /* Exp: "try" Exp "catch" Exp */ -#line 359 "src/parser.y" - { - (yyval.blk) = gen_try((yyvsp[-2].blk), (yyvsp[0].blk)); -} -#line 2807 "src/parser.c" - break; - - case 18: /* Exp: "try" Exp */ -#line 362 "src/parser.y" - { - (yyval.blk) = gen_try((yyvsp[0].blk), gen_op_simple(BACKTRACK)); -} -#line 2815 "src/parser.c" - break; - - case 19: /* Exp: "try" Exp "catch" error */ -#line 365 "src/parser.y" - { - FAIL((yyloc), "Possibly unterminated 'try' statement"); - (yyval.blk) = (yyvsp[-2].blk); -} -#line 2824 "src/parser.c" - break; - - case 20: /* Exp: "label" BINDING '|' Exp */ -#line 370 "src/parser.y" - { - jv v = jv_string_fmt("*label-%s", jv_string_value((yyvsp[-2].literal))); - (yyval.blk) = gen_location((yyloc), locations, gen_label(jv_string_value(v), (yyvsp[0].blk))); - jv_free((yyvsp[-2].literal)); - jv_free(v); + { + (yyval.blk) = (yyvsp[0].blk); } -#line 2835 "src/parser.c" +#line 2645 "src/parser.c" break; - case 21: /* Exp: Exp '?' */ -#line 377 "src/parser.y" - { - (yyval.blk) = gen_try((yyvsp[-1].blk), gen_op_simple(BACKTRACK)); + case 16: /* Expr: Expr "//" Expr */ +#line 357 "src/parser.y" + { + (yyval.blk) = gen_definedor((yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 2843 "src/parser.c" +#line 2653 "src/parser.c" break; - case 22: /* Exp: Exp '=' Exp */ -#line 381 "src/parser.y" - { + case 17: /* Expr: Expr '=' Expr */ +#line 360 "src/parser.y" + { (yyval.blk) = gen_call("_assign", BLOCK(gen_lambda((yyvsp[-2].blk)), gen_lambda((yyvsp[0].blk)))); } -#line 2851 "src/parser.c" +#line 2661 "src/parser.c" break; - case 23: /* Exp: Exp "or" Exp */ -#line 385 "src/parser.y" - { + case 18: /* Expr: Expr "or" Expr */ +#line 363 "src/parser.y" + { (yyval.blk) = gen_or((yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 2859 "src/parser.c" +#line 2669 "src/parser.c" break; - case 24: /* Exp: Exp "and" Exp */ -#line 389 "src/parser.y" - { + case 19: /* Expr: Expr "and" Expr */ +#line 366 "src/parser.y" + { (yyval.blk) = gen_and((yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 2867 "src/parser.c" - break; - - case 25: /* Exp: Exp "//" Exp */ -#line 393 "src/parser.y" - { - (yyval.blk) = gen_definedor((yyvsp[-2].blk), (yyvsp[0].blk)); -} -#line 2875 "src/parser.c" +#line 2677 "src/parser.c" break; - case 26: /* Exp: Exp "//=" Exp */ -#line 397 "src/parser.y" - { + case 20: /* Expr: Expr "//=" Expr */ +#line 369 "src/parser.y" + { (yyval.blk) = gen_definedor_assign((yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 2883 "src/parser.c" +#line 2685 "src/parser.c" break; - case 27: /* Exp: Exp "|=" Exp */ -#line 401 "src/parser.y" - { + case 21: /* Expr: Expr "|=" Expr */ +#line 372 "src/parser.y" + { (yyval.blk) = gen_call("_modify", BLOCK(gen_lambda((yyvsp[-2].blk)), gen_lambda((yyvsp[0].blk)))); } -#line 2891 "src/parser.c" +#line 2693 "src/parser.c" break; - case 28: /* Exp: Exp '|' Exp */ -#line 405 "src/parser.y" - { - (yyval.blk) = block_join((yyvsp[-2].blk), (yyvsp[0].blk)); -} -#line 2899 "src/parser.c" - break; - - case 29: /* Exp: Exp ',' Exp */ -#line 409 "src/parser.y" - { - (yyval.blk) = gen_both((yyvsp[-2].blk), (yyvsp[0].blk)); -} -#line 2907 "src/parser.c" - break; - - case 30: /* Exp: Exp '+' Exp */ -#line 413 "src/parser.y" - { + case 22: /* Expr: Expr '+' Expr */ +#line 375 "src/parser.y" + { (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), '+'); } -#line 2915 "src/parser.c" +#line 2701 "src/parser.c" break; - case 31: /* Exp: Exp "+=" Exp */ -#line 417 "src/parser.y" - { + case 23: /* Expr: Expr "+=" Expr */ +#line 378 "src/parser.y" + { (yyval.blk) = gen_update((yyvsp[-2].blk), (yyvsp[0].blk), '+'); } -#line 2923 "src/parser.c" +#line 2709 "src/parser.c" break; - case 32: /* Exp: '-' Exp */ -#line 421 "src/parser.y" - { - (yyval.blk) = BLOCK((yyvsp[0].blk), gen_call("_negate", gen_noop())); -} -#line 2931 "src/parser.c" - break; - - case 33: /* Exp: Exp '-' Exp */ -#line 425 "src/parser.y" - { + case 24: /* Expr: Expr '-' Expr */ +#line 381 "src/parser.y" + { (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), '-'); } -#line 2939 "src/parser.c" +#line 2717 "src/parser.c" break; - case 34: /* Exp: Exp "-=" Exp */ -#line 429 "src/parser.y" - { + case 25: /* Expr: Expr "-=" Expr */ +#line 384 "src/parser.y" + { (yyval.blk) = gen_update((yyvsp[-2].blk), (yyvsp[0].blk), '-'); } -#line 2947 "src/parser.c" +#line 2725 "src/parser.c" break; - case 35: /* Exp: Exp '*' Exp */ -#line 433 "src/parser.y" - { + case 26: /* Expr: Expr '*' Expr */ +#line 387 "src/parser.y" + { (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), '*'); } -#line 2955 "src/parser.c" +#line 2733 "src/parser.c" break; - case 36: /* Exp: Exp "*=" Exp */ -#line 437 "src/parser.y" - { + case 27: /* Expr: Expr "*=" Expr */ +#line 390 "src/parser.y" + { (yyval.blk) = gen_update((yyvsp[-2].blk), (yyvsp[0].blk), '*'); } -#line 2963 "src/parser.c" +#line 2741 "src/parser.c" break; - case 37: /* Exp: Exp '/' Exp */ -#line 441 "src/parser.y" - { + case 28: /* Expr: Expr '/' Expr */ +#line 393 "src/parser.y" + { (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), '/'); } -#line 2971 "src/parser.c" +#line 2749 "src/parser.c" break; - case 38: /* Exp: Exp '%' Exp */ -#line 445 "src/parser.y" - { + case 29: /* Expr: Expr '%' Expr */ +#line 396 "src/parser.y" + { (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), '%'); } -#line 2979 "src/parser.c" +#line 2757 "src/parser.c" break; - case 39: /* Exp: Exp "/=" Exp */ -#line 449 "src/parser.y" - { + case 30: /* Expr: Expr "/=" Expr */ +#line 399 "src/parser.y" + { (yyval.blk) = gen_update((yyvsp[-2].blk), (yyvsp[0].blk), '/'); } -#line 2987 "src/parser.c" +#line 2765 "src/parser.c" break; - case 40: /* Exp: Exp "%=" Exp */ -#line 453 "src/parser.y" - { + case 31: /* Expr: Expr "%=" Expr */ +#line 402 "src/parser.y" + { (yyval.blk) = gen_update((yyvsp[-2].blk), (yyvsp[0].blk), '%'); } -#line 2995 "src/parser.c" +#line 2773 "src/parser.c" break; - case 41: /* Exp: Exp "==" Exp */ -#line 457 "src/parser.y" - { + case 32: /* Expr: Expr "==" Expr */ +#line 405 "src/parser.y" + { (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), EQ); } -#line 3003 "src/parser.c" +#line 2781 "src/parser.c" break; - case 42: /* Exp: Exp "!=" Exp */ -#line 461 "src/parser.y" - { + case 33: /* Expr: Expr "!=" Expr */ +#line 408 "src/parser.y" + { (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), NEQ); } -#line 3011 "src/parser.c" +#line 2789 "src/parser.c" break; - case 43: /* Exp: Exp '<' Exp */ -#line 465 "src/parser.y" - { + case 34: /* Expr: Expr '<' Expr */ +#line 411 "src/parser.y" + { (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), '<'); } -#line 3019 "src/parser.c" +#line 2797 "src/parser.c" break; - case 44: /* Exp: Exp '>' Exp */ -#line 469 "src/parser.y" - { + case 35: /* Expr: Expr '>' Expr */ +#line 414 "src/parser.y" + { (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), '>'); } -#line 3027 "src/parser.c" +#line 2805 "src/parser.c" break; - case 45: /* Exp: Exp "<=" Exp */ -#line 473 "src/parser.y" - { + case 36: /* Expr: Expr "<=" Expr */ +#line 417 "src/parser.y" + { (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), LESSEQ); } -#line 3035 "src/parser.c" +#line 2813 "src/parser.c" break; - case 46: /* Exp: Exp ">=" Exp */ -#line 477 "src/parser.y" - { + case 37: /* Expr: Expr ">=" Expr */ +#line 420 "src/parser.y" + { (yyval.blk) = gen_binop((yyvsp[-2].blk), (yyvsp[0].blk), GREATEREQ); } -#line 3043 "src/parser.c" +#line 2821 "src/parser.c" break; - case 47: /* Exp: Term */ -#line 481 "src/parser.y" - { + case 38: /* Expr: Term */ +#line 423 "src/parser.y" + { (yyval.blk) = (yyvsp[0].blk); } -#line 3051 "src/parser.c" +#line 2829 "src/parser.c" break; - case 48: /* Import: ImportWhat ';' */ -#line 486 "src/parser.y" + case 39: /* Import: ImportWhat ';' */ +#line 429 "src/parser.y" { (yyval.blk) = (yyvsp[-1].blk); } -#line 3059 "src/parser.c" +#line 2837 "src/parser.c" break; - case 49: /* Import: ImportWhat Exp ';' */ -#line 489 "src/parser.y" - { + case 40: /* Import: ImportWhat Query ';' */ +#line 432 "src/parser.y" + { if (!block_is_const((yyvsp[-1].blk))) { FAIL((yyloc), "Module metadata must be constant"); (yyval.blk) = gen_noop(); @@ -3075,11 +2853,11 @@ YYLTYPE yylloc = yyloc_default; (yyval.blk) = gen_import_meta((yyvsp[-2].blk), (yyvsp[-1].blk)); } } -#line 3079 "src/parser.c" +#line 2857 "src/parser.c" break; - case 50: /* ImportWhat: "import" ImportFrom "as" BINDING */ -#line 506 "src/parser.y" + case 41: /* ImportWhat: "import" ImportFrom "as" BINDING */ +#line 449 "src/parser.y" { jv v = block_const((yyvsp[-2].blk)); // XXX Make gen_import take only blocks and the int is_data so we @@ -3089,11 +2867,11 @@ YYLTYPE yylloc = yyloc_default; jv_free((yyvsp[0].literal)); jv_free(v); } -#line 3093 "src/parser.c" +#line 2871 "src/parser.c" break; - case 51: /* ImportWhat: "import" ImportFrom "as" IDENT */ -#line 515 "src/parser.y" + case 42: /* ImportWhat: "import" ImportFrom "as" IDENT */ +#line 458 "src/parser.y" { jv v = block_const((yyvsp[-2].blk)); (yyval.blk) = gen_import(jv_string_value(v), jv_string_value((yyvsp[0].literal)), 0); @@ -3101,22 +2879,22 @@ YYLTYPE yylloc = yyloc_default; jv_free((yyvsp[0].literal)); jv_free(v); } -#line 3105 "src/parser.c" +#line 2883 "src/parser.c" break; - case 52: /* ImportWhat: "include" ImportFrom */ -#line 522 "src/parser.y" + case 43: /* ImportWhat: "include" ImportFrom */ +#line 465 "src/parser.y" { jv v = block_const((yyvsp[0].blk)); (yyval.blk) = gen_import(jv_string_value(v), NULL, 0); block_free((yyvsp[0].blk)); jv_free(v); } -#line 3116 "src/parser.c" +#line 2894 "src/parser.c" break; - case 53: /* ImportFrom: String */ -#line 530 "src/parser.y" + case 44: /* ImportFrom: String */ +#line 473 "src/parser.y" { if (!block_is_const((yyvsp[0].blk))) { FAIL((yyloc), "Import path must be constant"); @@ -3126,176 +2904,152 @@ YYLTYPE yylloc = yyloc_default; (yyval.blk) = (yyvsp[0].blk); } } -#line 3130 "src/parser.c" +#line 2908 "src/parser.c" break; - case 54: /* FuncDef: "def" IDENT ':' Exp ';' */ -#line 541 "src/parser.y" - { + case 45: /* FuncDef: "def" IDENT ':' Query ';' */ +#line 484 "src/parser.y" + { (yyval.blk) = gen_function(jv_string_value((yyvsp[-3].literal)), gen_noop(), (yyvsp[-1].blk)); jv_free((yyvsp[-3].literal)); } -#line 3139 "src/parser.c" +#line 2917 "src/parser.c" break; - case 55: /* FuncDef: "def" IDENT '(' Params ')' ':' Exp ';' */ -#line 546 "src/parser.y" - { + case 46: /* FuncDef: "def" IDENT '(' Params ')' ':' Query ';' */ +#line 489 "src/parser.y" + { (yyval.blk) = gen_function(jv_string_value((yyvsp[-6].literal)), (yyvsp[-4].blk), (yyvsp[-1].blk)); jv_free((yyvsp[-6].literal)); } -#line 3148 "src/parser.c" +#line 2926 "src/parser.c" break; - case 56: /* Params: Param */ -#line 552 "src/parser.y" + case 47: /* Params: Param */ +#line 495 "src/parser.y" { (yyval.blk) = (yyvsp[0].blk); } -#line 3156 "src/parser.c" +#line 2934 "src/parser.c" break; - case 57: /* Params: Params ';' Param */ -#line 555 "src/parser.y" + case 48: /* Params: Params ';' Param */ +#line 498 "src/parser.y" { (yyval.blk) = BLOCK((yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 3164 "src/parser.c" +#line 2942 "src/parser.c" break; - case 58: /* Param: BINDING */ -#line 560 "src/parser.y" + case 49: /* Param: BINDING */ +#line 503 "src/parser.y" { (yyval.blk) = gen_param_regular(jv_string_value((yyvsp[0].literal))); jv_free((yyvsp[0].literal)); } -#line 3173 "src/parser.c" +#line 2951 "src/parser.c" break; - case 59: /* Param: IDENT */ -#line 564 "src/parser.y" + case 50: /* Param: IDENT */ +#line 507 "src/parser.y" { (yyval.blk) = gen_param(jv_string_value((yyvsp[0].literal))); jv_free((yyvsp[0].literal)); } -#line 3182 "src/parser.c" +#line 2960 "src/parser.c" break; - case 60: /* StringStart: FORMAT QQSTRING_START */ -#line 571 "src/parser.y" + case 51: /* StringStart: FORMAT QQSTRING_START */ +#line 514 "src/parser.y" { (yyval.literal) = (yyvsp[-1].literal); } -#line 3190 "src/parser.c" +#line 2968 "src/parser.c" break; - case 61: /* StringStart: QQSTRING_START */ -#line 574 "src/parser.y" + case 52: /* StringStart: QQSTRING_START */ +#line 517 "src/parser.y" { (yyval.literal) = jv_string("text"); } -#line 3198 "src/parser.c" +#line 2976 "src/parser.c" break; - case 62: /* String: StringStart QQString QQSTRING_END */ -#line 580 "src/parser.y" + case 53: /* String: StringStart QQString QQSTRING_END */ +#line 523 "src/parser.y" { (yyval.blk) = (yyvsp[-1].blk); jv_free((yyvsp[-2].literal)); } -#line 3207 "src/parser.c" +#line 2985 "src/parser.c" break; - case 63: /* QQString: %empty */ -#line 587 "src/parser.y" + case 54: /* QQString: %empty */ +#line 530 "src/parser.y" { (yyval.blk) = gen_const(jv_string("")); } -#line 3215 "src/parser.c" +#line 2993 "src/parser.c" break; - case 64: /* QQString: QQString QQSTRING_TEXT */ -#line 590 "src/parser.y" + case 55: /* QQString: QQString QQSTRING_TEXT */ +#line 533 "src/parser.y" { (yyval.blk) = gen_binop((yyvsp[-1].blk), gen_const((yyvsp[0].literal)), '+'); } -#line 3223 "src/parser.c" +#line 3001 "src/parser.c" break; - case 65: /* QQString: QQString QQSTRING_INTERP_START Exp QQSTRING_INTERP_END */ -#line 593 "src/parser.y" - { + case 56: /* QQString: QQString QQSTRING_INTERP_START Query QQSTRING_INTERP_END */ +#line 536 "src/parser.y" + { (yyval.blk) = gen_binop((yyvsp[-3].blk), gen_format((yyvsp[-1].blk), jv_copy((yyvsp[-4].literal))), '+'); } -#line 3231 "src/parser.c" +#line 3009 "src/parser.c" break; - case 66: /* ElseBody: "elif" Exp "then" Exp ElseBody */ -#line 599 "src/parser.y" - { + case 57: /* ElseBody: "elif" Query "then" Query ElseBody */ +#line 542 "src/parser.y" + { (yyval.blk) = gen_cond((yyvsp[-3].blk), (yyvsp[-1].blk), (yyvsp[0].blk)); } -#line 3239 "src/parser.c" +#line 3017 "src/parser.c" break; - case 67: /* ElseBody: "else" Exp "end" */ -#line 602 "src/parser.y" - { + case 58: /* ElseBody: "else" Query "end" */ +#line 545 "src/parser.y" + { (yyval.blk) = (yyvsp[-1].blk); } -#line 3247 "src/parser.c" +#line 3025 "src/parser.c" break; - case 68: /* ElseBody: "end" */ -#line 605 "src/parser.y" + case 59: /* ElseBody: "end" */ +#line 548 "src/parser.y" { (yyval.blk) = gen_noop(); } -#line 3255 "src/parser.c" - break; - - case 69: /* ExpD: ExpD '|' ExpD */ -#line 610 "src/parser.y" - { - (yyval.blk) = block_join((yyvsp[-2].blk), (yyvsp[0].blk)); -} -#line 3263 "src/parser.c" +#line 3033 "src/parser.c" break; - case 70: /* ExpD: '-' ExpD */ -#line 613 "src/parser.y" - { - (yyval.blk) = BLOCK((yyvsp[0].blk), gen_call("_negate", gen_noop())); -} -#line 3271 "src/parser.c" - break; - - case 71: /* ExpD: Term */ -#line 616 "src/parser.y" - { - (yyval.blk) = (yyvsp[0].blk); -} -#line 3279 "src/parser.c" - break; - - case 72: /* Term: '.' */ -#line 622 "src/parser.y" + case 60: /* Term: '.' */ +#line 554 "src/parser.y" { (yyval.blk) = gen_noop(); } -#line 3287 "src/parser.c" +#line 3041 "src/parser.c" break; - case 73: /* Term: ".." */ -#line 625 "src/parser.y" + case 61: /* Term: ".." */ +#line 557 "src/parser.y" { (yyval.blk) = gen_call("recurse", gen_noop()); } -#line 3295 "src/parser.c" +#line 3049 "src/parser.c" break; - case 74: /* Term: "break" BINDING */ -#line 628 "src/parser.y" + case 62: /* Term: "break" BINDING */ +#line 560 "src/parser.y" { jv v = jv_string_fmt("*label-%s", jv_string_value((yyvsp[0].literal))); // impossible symbol (yyval.blk) = gen_location((yyloc), locations, @@ -3304,301 +3058,383 @@ YYLTYPE yylloc = yyloc_default; jv_free(v); jv_free((yyvsp[0].literal)); } -#line 3308 "src/parser.c" +#line 3062 "src/parser.c" break; - case 75: /* Term: "break" error */ -#line 636 "src/parser.y" + case 63: /* Term: "break" error */ +#line 568 "src/parser.y" { FAIL((yyloc), "break requires a label to break to"); (yyval.blk) = gen_noop(); } -#line 3317 "src/parser.c" +#line 3071 "src/parser.c" break; - case 76: /* Term: Term FIELD '?' */ -#line 640 "src/parser.y" + case 64: /* Term: Term FIELD '?' */ +#line 572 "src/parser.y" { (yyval.blk) = gen_index_opt((yyvsp[-2].blk), gen_const((yyvsp[-1].literal))); } -#line 3325 "src/parser.c" +#line 3079 "src/parser.c" break; - case 77: /* Term: FIELD '?' */ -#line 643 "src/parser.y" + case 65: /* Term: FIELD '?' */ +#line 575 "src/parser.y" { (yyval.blk) = gen_index_opt(gen_noop(), gen_const((yyvsp[-1].literal))); } -#line 3333 "src/parser.c" +#line 3087 "src/parser.c" break; - case 78: /* Term: Term '.' String '?' */ -#line 646 "src/parser.y" + case 66: /* Term: Term '.' String '?' */ +#line 578 "src/parser.y" { (yyval.blk) = gen_index_opt((yyvsp[-3].blk), (yyvsp[-1].blk)); } -#line 3341 "src/parser.c" +#line 3095 "src/parser.c" break; - case 79: /* Term: '.' String '?' */ -#line 649 "src/parser.y" + case 67: /* Term: '.' String '?' */ +#line 581 "src/parser.y" { (yyval.blk) = gen_index_opt(gen_noop(), (yyvsp[-1].blk)); } -#line 3349 "src/parser.c" +#line 3103 "src/parser.c" break; - case 80: /* Term: Term FIELD */ -#line 652 "src/parser.y" + case 68: /* Term: Term FIELD */ +#line 584 "src/parser.y" { (yyval.blk) = gen_index((yyvsp[-1].blk), gen_const((yyvsp[0].literal))); } -#line 3357 "src/parser.c" +#line 3111 "src/parser.c" break; - case 81: /* Term: FIELD */ -#line 655 "src/parser.y" + case 69: /* Term: FIELD */ +#line 587 "src/parser.y" { (yyval.blk) = gen_index(gen_noop(), gen_const((yyvsp[0].literal))); } -#line 3365 "src/parser.c" +#line 3119 "src/parser.c" break; - case 82: /* Term: Term '.' String */ -#line 658 "src/parser.y" + case 70: /* Term: Term '.' String */ +#line 590 "src/parser.y" { (yyval.blk) = gen_index((yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 3373 "src/parser.c" +#line 3127 "src/parser.c" break; - case 83: /* Term: '.' String */ -#line 661 "src/parser.y" + case 71: /* Term: '.' String */ +#line 593 "src/parser.y" { (yyval.blk) = gen_index(gen_noop(), (yyvsp[0].blk)); } -#line 3381 "src/parser.c" +#line 3135 "src/parser.c" break; - case 84: /* Term: '.' error */ -#line 664 "src/parser.y" + case 72: /* Term: '.' error */ +#line 596 "src/parser.y" { FAIL((yyloc), "try .[\"field\"] instead of .field for unusually named fields"); (yyval.blk) = gen_noop(); } -#line 3390 "src/parser.c" +#line 3144 "src/parser.c" break; - case 85: /* Term: '.' IDENT error */ -#line 668 "src/parser.y" + case 73: /* Term: '.' IDENT error */ +#line 600 "src/parser.y" { jv_free((yyvsp[-1].literal)); FAIL((yyloc), "try .[\"field\"] instead of .field for unusually named fields"); (yyval.blk) = gen_noop(); } -#line 3400 "src/parser.c" +#line 3154 "src/parser.c" break; - case 86: /* Term: Term '[' Exp ']' '?' */ -#line 674 "src/parser.y" - { + case 74: /* Term: Term '[' Query ']' '?' */ +#line 606 "src/parser.y" + { (yyval.blk) = gen_index_opt((yyvsp[-4].blk), (yyvsp[-2].blk)); } -#line 3408 "src/parser.c" +#line 3162 "src/parser.c" break; - case 87: /* Term: Term '[' Exp ']' */ -#line 677 "src/parser.y" - { + case 75: /* Term: Term '[' Query ']' */ +#line 609 "src/parser.y" + { (yyval.blk) = gen_index((yyvsp[-3].blk), (yyvsp[-1].blk)); } -#line 3416 "src/parser.c" +#line 3170 "src/parser.c" break; - case 88: /* Term: Term '.' '[' Exp ']' '?' */ -#line 680 "src/parser.y" - { + case 76: /* Term: Term '.' '[' Query ']' '?' */ +#line 612 "src/parser.y" + { (yyval.blk) = gen_index_opt((yyvsp[-5].blk), (yyvsp[-2].blk)); } -#line 3424 "src/parser.c" +#line 3178 "src/parser.c" break; - case 89: /* Term: Term '.' '[' Exp ']' */ -#line 683 "src/parser.y" - { + case 77: /* Term: Term '.' '[' Query ']' */ +#line 615 "src/parser.y" + { (yyval.blk) = gen_index((yyvsp[-4].blk), (yyvsp[-1].blk)); } -#line 3432 "src/parser.c" +#line 3186 "src/parser.c" break; - case 90: /* Term: Term '[' ']' '?' */ -#line 686 "src/parser.y" + case 78: /* Term: Term '[' ']' '?' */ +#line 618 "src/parser.y" { (yyval.blk) = block_join((yyvsp[-3].blk), gen_op_simple(EACH_OPT)); } -#line 3440 "src/parser.c" +#line 3194 "src/parser.c" break; - case 91: /* Term: Term '[' ']' */ -#line 689 "src/parser.y" + case 79: /* Term: Term '[' ']' */ +#line 621 "src/parser.y" { (yyval.blk) = block_join((yyvsp[-2].blk), gen_op_simple(EACH)); } -#line 3448 "src/parser.c" +#line 3202 "src/parser.c" break; - case 92: /* Term: Term '.' '[' ']' '?' */ -#line 692 "src/parser.y" + case 80: /* Term: Term '.' '[' ']' '?' */ +#line 624 "src/parser.y" { (yyval.blk) = block_join((yyvsp[-4].blk), gen_op_simple(EACH_OPT)); } -#line 3456 "src/parser.c" +#line 3210 "src/parser.c" break; - case 93: /* Term: Term '.' '[' ']' */ -#line 695 "src/parser.y" + case 81: /* Term: Term '.' '[' ']' */ +#line 627 "src/parser.y" { (yyval.blk) = block_join((yyvsp[-3].blk), gen_op_simple(EACH)); } -#line 3464 "src/parser.c" +#line 3218 "src/parser.c" break; - case 94: /* Term: Term '[' Exp ':' Exp ']' '?' */ -#line 698 "src/parser.y" - { + case 82: /* Term: Term '[' Query ':' Query ']' '?' */ +#line 630 "src/parser.y" + { (yyval.blk) = gen_slice_index((yyvsp[-6].blk), (yyvsp[-4].blk), (yyvsp[-2].blk), INDEX_OPT); } -#line 3472 "src/parser.c" +#line 3226 "src/parser.c" break; - case 95: /* Term: Term '[' Exp ':' ']' '?' */ -#line 701 "src/parser.y" - { + case 83: /* Term: Term '[' Query ':' ']' '?' */ +#line 633 "src/parser.y" + { (yyval.blk) = gen_slice_index((yyvsp[-5].blk), (yyvsp[-3].blk), gen_const(jv_null()), INDEX_OPT); } -#line 3480 "src/parser.c" +#line 3234 "src/parser.c" break; - case 96: /* Term: Term '[' ':' Exp ']' '?' */ -#line 704 "src/parser.y" - { + case 84: /* Term: Term '[' ':' Query ']' '?' */ +#line 636 "src/parser.y" + { (yyval.blk) = gen_slice_index((yyvsp[-5].blk), gen_const(jv_null()), (yyvsp[-2].blk), INDEX_OPT); } -#line 3488 "src/parser.c" +#line 3242 "src/parser.c" break; - case 97: /* Term: Term '[' Exp ':' Exp ']' */ -#line 707 "src/parser.y" - { + case 85: /* Term: Term '[' Query ':' Query ']' */ +#line 639 "src/parser.y" + { (yyval.blk) = gen_slice_index((yyvsp[-5].blk), (yyvsp[-3].blk), (yyvsp[-1].blk), INDEX); } -#line 3496 "src/parser.c" +#line 3250 "src/parser.c" break; - case 98: /* Term: Term '[' Exp ':' ']' */ -#line 710 "src/parser.y" - { + case 86: /* Term: Term '[' Query ':' ']' */ +#line 642 "src/parser.y" + { (yyval.blk) = gen_slice_index((yyvsp[-4].blk), (yyvsp[-2].blk), gen_const(jv_null()), INDEX); } -#line 3504 "src/parser.c" +#line 3258 "src/parser.c" break; - case 99: /* Term: Term '[' ':' Exp ']' */ -#line 713 "src/parser.y" - { + case 87: /* Term: Term '[' ':' Query ']' */ +#line 645 "src/parser.y" + { (yyval.blk) = gen_slice_index((yyvsp[-4].blk), gen_const(jv_null()), (yyvsp[-1].blk), INDEX); } -#line 3512 "src/parser.c" +#line 3266 "src/parser.c" break; - case 100: /* Term: LITERAL */ -#line 716 "src/parser.y" + case 88: /* Term: Term '?' */ +#line 648 "src/parser.y" + { + (yyval.blk) = gen_try((yyvsp[-1].blk), gen_op_simple(BACKTRACK)); +} +#line 3274 "src/parser.c" + break; + + case 89: /* Term: LITERAL */ +#line 651 "src/parser.y" { (yyval.blk) = gen_const((yyvsp[0].literal)); } -#line 3520 "src/parser.c" +#line 3282 "src/parser.c" break; - case 101: /* Term: String */ -#line 719 "src/parser.y" + case 90: /* Term: String */ +#line 654 "src/parser.y" { (yyval.blk) = (yyvsp[0].blk); } -#line 3528 "src/parser.c" +#line 3290 "src/parser.c" break; - case 102: /* Term: FORMAT */ -#line 722 "src/parser.y" + case 91: /* Term: FORMAT */ +#line 657 "src/parser.y" { (yyval.blk) = gen_format(gen_noop(), (yyvsp[0].literal)); } -#line 3536 "src/parser.c" +#line 3298 "src/parser.c" break; - case 103: /* Term: '(' Exp ')' */ -#line 725 "src/parser.y" - { + case 92: /* Term: '-' Term */ +#line 660 "src/parser.y" + { + (yyval.blk) = BLOCK((yyvsp[0].blk), gen_call("_negate", gen_noop())); +} +#line 3306 "src/parser.c" + break; + + case 93: /* Term: '(' Query ')' */ +#line 663 "src/parser.y" + { (yyval.blk) = (yyvsp[-1].blk); } -#line 3544 "src/parser.c" +#line 3314 "src/parser.c" break; - case 104: /* Term: '[' Exp ']' */ -#line 728 "src/parser.y" - { + case 94: /* Term: '[' Query ']' */ +#line 666 "src/parser.y" + { (yyval.blk) = gen_collect((yyvsp[-1].blk)); } -#line 3552 "src/parser.c" +#line 3322 "src/parser.c" break; - case 105: /* Term: '[' ']' */ -#line 731 "src/parser.y" + case 95: /* Term: '[' ']' */ +#line 669 "src/parser.y" { (yyval.blk) = gen_const(jv_array()); } -#line 3560 "src/parser.c" +#line 3330 "src/parser.c" break; - case 106: /* Term: '{' MkDict '}' */ -#line 734 "src/parser.y" - { + case 96: /* Term: '{' DictPairs '}' */ +#line 672 "src/parser.y" + { block o = gen_const_object((yyvsp[-1].blk)); if (o.first != NULL) (yyval.blk) = o; else (yyval.blk) = BLOCK(gen_subexp(gen_const(jv_object())), (yyvsp[-1].blk), gen_op_simple(POP)); } -#line 3572 "src/parser.c" +#line 3342 "src/parser.c" break; - case 107: /* Term: '$' '$' '$' BINDING */ -#line 756 "src/parser.y" + case 97: /* Term: "reduce" Expr "as" Patterns '(' Query ';' Query ')' */ +#line 679 "src/parser.y" + { + (yyval.blk) = gen_reduce((yyvsp[-7].blk), (yyvsp[-5].blk), (yyvsp[-3].blk), (yyvsp[-1].blk)); +} +#line 3350 "src/parser.c" + break; + + case 98: /* Term: "foreach" Expr "as" Patterns '(' Query ';' Query ';' Query ')' */ +#line 682 "src/parser.y" + { + (yyval.blk) = gen_foreach((yyvsp[-9].blk), (yyvsp[-7].blk), (yyvsp[-5].blk), (yyvsp[-3].blk), (yyvsp[-1].blk)); +} +#line 3358 "src/parser.c" + break; + + case 99: /* Term: "foreach" Expr "as" Patterns '(' Query ';' Query ')' */ +#line 685 "src/parser.y" + { + (yyval.blk) = gen_foreach((yyvsp[-7].blk), (yyvsp[-5].blk), (yyvsp[-3].blk), (yyvsp[-1].blk), gen_noop()); +} +#line 3366 "src/parser.c" + break; + + case 100: /* Term: "if" Query "then" Query ElseBody */ +#line 688 "src/parser.y" + { + (yyval.blk) = gen_cond((yyvsp[-3].blk), (yyvsp[-1].blk), (yyvsp[0].blk)); +} +#line 3374 "src/parser.c" + break; + + case 101: /* Term: "if" Query "then" error */ +#line 691 "src/parser.y" + { + FAIL((yyloc), "Possibly unterminated 'if' statement"); + (yyval.blk) = (yyvsp[-2].blk); +} +#line 3383 "src/parser.c" + break; + + case 102: /* Term: "try" Expr "catch" Expr */ +#line 695 "src/parser.y" + { + (yyval.blk) = gen_try((yyvsp[-2].blk), (yyvsp[0].blk)); +} +#line 3391 "src/parser.c" + break; + + case 103: /* Term: "try" Expr "catch" error */ +#line 698 "src/parser.y" + { + FAIL((yyloc), "Possibly unterminated 'try' statement"); + (yyval.blk) = (yyvsp[-2].blk); +} +#line 3400 "src/parser.c" + break; + + case 104: /* Term: "try" Expr */ +#line 702 "src/parser.y" + { + (yyval.blk) = gen_try((yyvsp[0].blk), gen_op_simple(BACKTRACK)); +} +#line 3408 "src/parser.c" + break; + + case 105: /* Term: '$' '$' '$' BINDING */ +#line 720 "src/parser.y" { (yyval.blk) = gen_location((yyloc), locations, gen_op_unbound(LOADVN, jv_string_value((yyvsp[0].literal)))); jv_free((yyvsp[0].literal)); } -#line 3581 "src/parser.c" +#line 3417 "src/parser.c" break; - case 108: /* Term: BINDING */ -#line 760 "src/parser.y" + case 106: /* Term: BINDING */ +#line 724 "src/parser.y" { (yyval.blk) = gen_location((yyloc), locations, gen_op_unbound(LOADV, jv_string_value((yyvsp[0].literal)))); jv_free((yyvsp[0].literal)); } -#line 3590 "src/parser.c" +#line 3426 "src/parser.c" break; - case 109: /* Term: "$__loc__" */ -#line 764 "src/parser.y" + case 107: /* Term: "$__loc__" */ +#line 728 "src/parser.y" { (yyval.blk) = gen_loc_object(&(yyloc), locations); } -#line 3598 "src/parser.c" +#line 3434 "src/parser.c" break; - case 110: /* Term: IDENT */ -#line 767 "src/parser.y" + case 108: /* Term: IDENT */ +#line 731 "src/parser.y" { const char *s = jv_string_value((yyvsp[0].literal)); if (strcmp(s, "false") == 0) @@ -3611,199 +3447,199 @@ YYLTYPE yylloc = yyloc_default; (yyval.blk) = gen_location((yyloc), locations, gen_call(s, gen_noop())); jv_free((yyvsp[0].literal)); } -#line 3615 "src/parser.c" +#line 3451 "src/parser.c" break; - case 111: /* Term: IDENT '(' Args ')' */ -#line 779 "src/parser.y" + case 109: /* Term: IDENT '(' Args ')' */ +#line 743 "src/parser.y" { (yyval.blk) = gen_call(jv_string_value((yyvsp[-3].literal)), (yyvsp[-1].blk)); (yyval.blk) = gen_location((yylsp[-3]), locations, (yyval.blk)); jv_free((yyvsp[-3].literal)); } -#line 3625 "src/parser.c" +#line 3461 "src/parser.c" break; - case 112: /* Term: '(' error ')' */ -#line 784 "src/parser.y" + case 110: /* Term: '(' error ')' */ +#line 748 "src/parser.y" { (yyval.blk) = gen_noop(); } -#line 3631 "src/parser.c" +#line 3467 "src/parser.c" break; - case 113: /* Term: '[' error ']' */ -#line 785 "src/parser.y" + case 111: /* Term: '[' error ']' */ +#line 749 "src/parser.y" { (yyval.blk) = gen_noop(); } -#line 3637 "src/parser.c" +#line 3473 "src/parser.c" break; - case 114: /* Term: Term '[' error ']' */ -#line 786 "src/parser.y" + case 112: /* Term: Term '[' error ']' */ +#line 750 "src/parser.y" { (yyval.blk) = (yyvsp[-3].blk); } -#line 3643 "src/parser.c" +#line 3479 "src/parser.c" break; - case 115: /* Term: '{' error '}' */ -#line 787 "src/parser.y" + case 113: /* Term: '{' error '}' */ +#line 751 "src/parser.y" { (yyval.blk) = gen_noop(); } -#line 3649 "src/parser.c" +#line 3485 "src/parser.c" break; - case 116: /* Args: Arg */ -#line 790 "src/parser.y" + case 114: /* Args: Arg */ +#line 754 "src/parser.y" { (yyval.blk) = (yyvsp[0].blk); } -#line 3657 "src/parser.c" +#line 3493 "src/parser.c" break; - case 117: /* Args: Args ';' Arg */ -#line 793 "src/parser.y" + case 115: /* Args: Args ';' Arg */ +#line 757 "src/parser.y" { (yyval.blk) = BLOCK((yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 3665 "src/parser.c" +#line 3501 "src/parser.c" break; - case 118: /* Arg: Exp */ -#line 798 "src/parser.y" - { + case 116: /* Arg: Query */ +#line 762 "src/parser.y" + { (yyval.blk) = gen_lambda((yyvsp[0].blk)); } -#line 3673 "src/parser.c" +#line 3509 "src/parser.c" break; - case 119: /* RepPatterns: RepPatterns "?//" Pattern */ -#line 803 "src/parser.y" + case 117: /* RepPatterns: RepPatterns "?//" Pattern */ +#line 767 "src/parser.y" { (yyval.blk) = BLOCK((yyvsp[-2].blk), gen_destructure_alt((yyvsp[0].blk))); } -#line 3681 "src/parser.c" +#line 3517 "src/parser.c" break; - case 120: /* RepPatterns: Pattern */ -#line 806 "src/parser.y" + case 118: /* RepPatterns: Pattern */ +#line 770 "src/parser.y" { (yyval.blk) = gen_destructure_alt((yyvsp[0].blk)); } -#line 3689 "src/parser.c" +#line 3525 "src/parser.c" break; - case 121: /* Patterns: RepPatterns "?//" Pattern */ -#line 811 "src/parser.y" + case 119: /* Patterns: RepPatterns "?//" Pattern */ +#line 775 "src/parser.y" { (yyval.blk) = BLOCK((yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 3697 "src/parser.c" +#line 3533 "src/parser.c" break; - case 122: /* Patterns: Pattern */ -#line 814 "src/parser.y" + case 120: /* Patterns: Pattern */ +#line 778 "src/parser.y" { (yyval.blk) = (yyvsp[0].blk); } -#line 3705 "src/parser.c" +#line 3541 "src/parser.c" break; - case 123: /* Pattern: BINDING */ -#line 819 "src/parser.y" + case 121: /* Pattern: BINDING */ +#line 783 "src/parser.y" { (yyval.blk) = gen_op_unbound(STOREV, jv_string_value((yyvsp[0].literal))); jv_free((yyvsp[0].literal)); } -#line 3714 "src/parser.c" +#line 3550 "src/parser.c" break; - case 124: /* Pattern: '[' ArrayPats ']' */ -#line 823 "src/parser.y" + case 122: /* Pattern: '[' ArrayPats ']' */ +#line 787 "src/parser.y" { (yyval.blk) = BLOCK((yyvsp[-1].blk), gen_op_simple(POP)); } -#line 3722 "src/parser.c" +#line 3558 "src/parser.c" break; - case 125: /* Pattern: '{' ObjPats '}' */ -#line 826 "src/parser.y" + case 123: /* Pattern: '{' ObjPats '}' */ +#line 790 "src/parser.y" { (yyval.blk) = BLOCK((yyvsp[-1].blk), gen_op_simple(POP)); } -#line 3730 "src/parser.c" +#line 3566 "src/parser.c" break; - case 126: /* ArrayPats: Pattern */ -#line 831 "src/parser.y" + case 124: /* ArrayPats: Pattern */ +#line 795 "src/parser.y" { (yyval.blk) = gen_array_matcher(gen_noop(), (yyvsp[0].blk)); } -#line 3738 "src/parser.c" +#line 3574 "src/parser.c" break; - case 127: /* ArrayPats: ArrayPats ',' Pattern */ -#line 834 "src/parser.y" + case 125: /* ArrayPats: ArrayPats ',' Pattern */ +#line 798 "src/parser.y" { (yyval.blk) = gen_array_matcher((yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 3746 "src/parser.c" +#line 3582 "src/parser.c" break; - case 128: /* ObjPats: ObjPat */ -#line 839 "src/parser.y" + case 126: /* ObjPats: ObjPat */ +#line 803 "src/parser.y" { (yyval.blk) = (yyvsp[0].blk); } -#line 3754 "src/parser.c" +#line 3590 "src/parser.c" break; - case 129: /* ObjPats: ObjPats ',' ObjPat */ -#line 842 "src/parser.y" + case 127: /* ObjPats: ObjPats ',' ObjPat */ +#line 806 "src/parser.y" { (yyval.blk) = BLOCK((yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 3762 "src/parser.c" +#line 3598 "src/parser.c" break; - case 130: /* ObjPat: BINDING */ -#line 847 "src/parser.y" + case 128: /* ObjPat: BINDING */ +#line 811 "src/parser.y" { (yyval.blk) = gen_object_matcher(gen_const((yyvsp[0].literal)), gen_op_unbound(STOREV, jv_string_value((yyvsp[0].literal)))); } -#line 3770 "src/parser.c" +#line 3606 "src/parser.c" break; - case 131: /* ObjPat: BINDING ':' Pattern */ -#line 850 "src/parser.y" + case 129: /* ObjPat: BINDING ':' Pattern */ +#line 814 "src/parser.y" { (yyval.blk) = gen_object_matcher(gen_const((yyvsp[-2].literal)), BLOCK(gen_op_simple(DUP), gen_op_unbound(STOREV, jv_string_value((yyvsp[-2].literal))), (yyvsp[0].blk))); } -#line 3778 "src/parser.c" +#line 3614 "src/parser.c" break; - case 132: /* ObjPat: IDENT ':' Pattern */ -#line 853 "src/parser.y" + case 130: /* ObjPat: IDENT ':' Pattern */ +#line 817 "src/parser.y" { (yyval.blk) = gen_object_matcher(gen_const((yyvsp[-2].literal)), (yyvsp[0].blk)); } -#line 3786 "src/parser.c" +#line 3622 "src/parser.c" break; - case 133: /* ObjPat: Keyword ':' Pattern */ -#line 856 "src/parser.y" + case 131: /* ObjPat: Keyword ':' Pattern */ +#line 820 "src/parser.y" { (yyval.blk) = gen_object_matcher(gen_const((yyvsp[-2].literal)), (yyvsp[0].blk)); } -#line 3794 "src/parser.c" +#line 3630 "src/parser.c" break; - case 134: /* ObjPat: String ':' Pattern */ -#line 859 "src/parser.y" + case 132: /* ObjPat: String ':' Pattern */ +#line 823 "src/parser.y" { (yyval.blk) = gen_object_matcher((yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 3802 "src/parser.c" +#line 3638 "src/parser.c" break; - case 135: /* ObjPat: '(' Exp ')' ':' Pattern */ -#line 862 "src/parser.y" - { + case 133: /* ObjPat: '(' Query ')' ':' Pattern */ +#line 826 "src/parser.y" + { jv msg = check_object_key((yyvsp[-3].blk)); if (jv_is_valid(msg)) { FAIL((yyloc), jv_string_value(msg)); @@ -3811,291 +3647,305 @@ YYLTYPE yylloc = yyloc_default; jv_free(msg); (yyval.blk) = gen_object_matcher((yyvsp[-3].blk), (yyvsp[0].blk)); } -#line 3815 "src/parser.c" +#line 3651 "src/parser.c" break; - case 136: /* ObjPat: error ':' Pattern */ -#line 870 "src/parser.y" + case 134: /* ObjPat: error ':' Pattern */ +#line 834 "src/parser.y" { FAIL((yyloc), "May need parentheses around object key expression"); (yyval.blk) = (yyvsp[0].blk); } -#line 3824 "src/parser.c" +#line 3660 "src/parser.c" break; - case 137: /* Keyword: "as" */ -#line 876 "src/parser.y" + case 135: /* Keyword: "as" */ +#line 840 "src/parser.y" { (yyval.literal) = jv_string("as"); } -#line 3832 "src/parser.c" +#line 3668 "src/parser.c" break; - case 138: /* Keyword: "def" */ -#line 879 "src/parser.y" + case 136: /* Keyword: "def" */ +#line 843 "src/parser.y" { (yyval.literal) = jv_string("def"); } -#line 3840 "src/parser.c" +#line 3676 "src/parser.c" break; - case 139: /* Keyword: "module" */ -#line 882 "src/parser.y" + case 137: /* Keyword: "module" */ +#line 846 "src/parser.y" { (yyval.literal) = jv_string("module"); } -#line 3848 "src/parser.c" +#line 3684 "src/parser.c" break; - case 140: /* Keyword: "import" */ -#line 885 "src/parser.y" + case 138: /* Keyword: "import" */ +#line 849 "src/parser.y" { (yyval.literal) = jv_string("import"); } -#line 3856 "src/parser.c" +#line 3692 "src/parser.c" break; - case 141: /* Keyword: "include" */ -#line 888 "src/parser.y" + case 139: /* Keyword: "include" */ +#line 852 "src/parser.y" { (yyval.literal) = jv_string("include"); } -#line 3864 "src/parser.c" +#line 3700 "src/parser.c" break; - case 142: /* Keyword: "if" */ -#line 891 "src/parser.y" + case 140: /* Keyword: "if" */ +#line 855 "src/parser.y" { (yyval.literal) = jv_string("if"); } -#line 3872 "src/parser.c" +#line 3708 "src/parser.c" break; - case 143: /* Keyword: "then" */ -#line 894 "src/parser.y" + case 141: /* Keyword: "then" */ +#line 858 "src/parser.y" { (yyval.literal) = jv_string("then"); } -#line 3880 "src/parser.c" +#line 3716 "src/parser.c" break; - case 144: /* Keyword: "else" */ -#line 897 "src/parser.y" + case 142: /* Keyword: "else" */ +#line 861 "src/parser.y" { (yyval.literal) = jv_string("else"); } -#line 3888 "src/parser.c" +#line 3724 "src/parser.c" break; - case 145: /* Keyword: "elif" */ -#line 900 "src/parser.y" + case 143: /* Keyword: "elif" */ +#line 864 "src/parser.y" { (yyval.literal) = jv_string("elif"); } -#line 3896 "src/parser.c" +#line 3732 "src/parser.c" break; - case 146: /* Keyword: "reduce" */ -#line 903 "src/parser.y" + case 144: /* Keyword: "reduce" */ +#line 867 "src/parser.y" { (yyval.literal) = jv_string("reduce"); } -#line 3904 "src/parser.c" +#line 3740 "src/parser.c" break; - case 147: /* Keyword: "foreach" */ -#line 906 "src/parser.y" + case 145: /* Keyword: "foreach" */ +#line 870 "src/parser.y" { (yyval.literal) = jv_string("foreach"); } -#line 3912 "src/parser.c" +#line 3748 "src/parser.c" break; - case 148: /* Keyword: "end" */ -#line 909 "src/parser.y" + case 146: /* Keyword: "end" */ +#line 873 "src/parser.y" { (yyval.literal) = jv_string("end"); } -#line 3920 "src/parser.c" +#line 3756 "src/parser.c" break; - case 149: /* Keyword: "and" */ -#line 912 "src/parser.y" + case 147: /* Keyword: "and" */ +#line 876 "src/parser.y" { (yyval.literal) = jv_string("and"); } -#line 3928 "src/parser.c" +#line 3764 "src/parser.c" break; - case 150: /* Keyword: "or" */ -#line 915 "src/parser.y" + case 148: /* Keyword: "or" */ +#line 879 "src/parser.y" { (yyval.literal) = jv_string("or"); } -#line 3936 "src/parser.c" +#line 3772 "src/parser.c" break; - case 151: /* Keyword: "try" */ -#line 918 "src/parser.y" + case 149: /* Keyword: "try" */ +#line 882 "src/parser.y" { (yyval.literal) = jv_string("try"); } -#line 3944 "src/parser.c" +#line 3780 "src/parser.c" break; - case 152: /* Keyword: "catch" */ -#line 921 "src/parser.y" + case 150: /* Keyword: "catch" */ +#line 885 "src/parser.y" { (yyval.literal) = jv_string("catch"); } -#line 3952 "src/parser.c" +#line 3788 "src/parser.c" break; - case 153: /* Keyword: "label" */ -#line 924 "src/parser.y" + case 151: /* Keyword: "label" */ +#line 888 "src/parser.y" { (yyval.literal) = jv_string("label"); } -#line 3960 "src/parser.c" +#line 3796 "src/parser.c" break; - case 154: /* Keyword: "break" */ -#line 927 "src/parser.y" + case 152: /* Keyword: "break" */ +#line 891 "src/parser.y" { (yyval.literal) = jv_string("break"); } -#line 3968 "src/parser.c" +#line 3804 "src/parser.c" break; - case 155: /* MkDict: %empty */ -#line 932 "src/parser.y" + case 153: /* DictPairs: %empty */ +#line 897 "src/parser.y" { - (yyval.blk)=gen_noop(); + (yyval.blk) = gen_noop(); } -#line 3976 "src/parser.c" +#line 3812 "src/parser.c" break; - case 156: /* MkDict: MkDictPair */ -#line 935 "src/parser.y" - { (yyval.blk) = (yyvsp[0].blk); } -#line 3982 "src/parser.c" - break; - - case 157: /* MkDict: MkDictPair ',' MkDict */ -#line 936 "src/parser.y" - { (yyval.blk)=block_join((yyvsp[-2].blk), (yyvsp[0].blk)); } -#line 3988 "src/parser.c" + case 154: /* DictPairs: DictPair */ +#line 900 "src/parser.y" + { + (yyval.blk) = (yyvsp[0].blk); +} +#line 3820 "src/parser.c" break; - case 158: /* MkDict: error ',' MkDict */ -#line 937 "src/parser.y" - { (yyval.blk) = (yyvsp[0].blk); } -#line 3994 "src/parser.c" + case 155: /* DictPairs: DictPair ',' DictPairs */ +#line 903 "src/parser.y" + { + (yyval.blk) = block_join((yyvsp[-2].blk), (yyvsp[0].blk)); +} +#line 3828 "src/parser.c" break; - case 159: /* MkDictPair: IDENT ':' ExpD */ -#line 940 "src/parser.y" - { + case 156: /* DictPair: IDENT ':' DictExpr */ +#line 908 "src/parser.y" + { (yyval.blk) = gen_dictpair(gen_const((yyvsp[-2].literal)), (yyvsp[0].blk)); - } -#line 4002 "src/parser.c" +} +#line 3836 "src/parser.c" break; - case 160: /* MkDictPair: Keyword ':' ExpD */ -#line 943 "src/parser.y" - { + case 157: /* DictPair: Keyword ':' DictExpr */ +#line 911 "src/parser.y" + { (yyval.blk) = gen_dictpair(gen_const((yyvsp[-2].literal)), (yyvsp[0].blk)); - } -#line 4010 "src/parser.c" +} +#line 3844 "src/parser.c" break; - case 161: /* MkDictPair: String ':' ExpD */ -#line 946 "src/parser.y" - { + case 158: /* DictPair: String ':' DictExpr */ +#line 914 "src/parser.y" + { (yyval.blk) = gen_dictpair((yyvsp[-2].blk), (yyvsp[0].blk)); - } -#line 4018 "src/parser.c" +} +#line 3852 "src/parser.c" break; - case 162: /* MkDictPair: String */ -#line 949 "src/parser.y" - { + case 159: /* DictPair: String */ +#line 917 "src/parser.y" + { (yyval.blk) = gen_dictpair((yyvsp[0].blk), BLOCK(gen_op_simple(POP), gen_op_simple(DUP2), gen_op_simple(DUP2), gen_op_simple(INDEX))); - } -#line 4027 "src/parser.c" +} +#line 3861 "src/parser.c" break; - case 163: /* MkDictPair: BINDING ':' ExpD */ -#line 953 "src/parser.y" - { + case 160: /* DictPair: BINDING ':' DictExpr */ +#line 921 "src/parser.y" + { (yyval.blk) = gen_dictpair(gen_location((yyloc), locations, gen_op_unbound(LOADV, jv_string_value((yyvsp[-2].literal)))), (yyvsp[0].blk)); jv_free((yyvsp[-2].literal)); - } -#line 4037 "src/parser.c" +} +#line 3871 "src/parser.c" break; - case 164: /* MkDictPair: BINDING */ -#line 958 "src/parser.y" - { + case 161: /* DictPair: BINDING */ +#line 926 "src/parser.y" + { (yyval.blk) = gen_dictpair(gen_const((yyvsp[0].literal)), gen_location((yyloc), locations, gen_op_unbound(LOADV, jv_string_value((yyvsp[0].literal))))); - } -#line 4046 "src/parser.c" +} +#line 3880 "src/parser.c" break; - case 165: /* MkDictPair: IDENT */ -#line 962 "src/parser.y" - { + case 162: /* DictPair: IDENT */ +#line 930 "src/parser.y" + { (yyval.blk) = gen_dictpair(gen_const(jv_copy((yyvsp[0].literal))), gen_index(gen_noop(), gen_const((yyvsp[0].literal)))); - } -#line 4055 "src/parser.c" +} +#line 3889 "src/parser.c" break; - case 166: /* MkDictPair: "$__loc__" */ -#line 966 "src/parser.y" - { + case 163: /* DictPair: "$__loc__" */ +#line 934 "src/parser.y" + { (yyval.blk) = gen_dictpair(gen_const(jv_string("__loc__")), gen_loc_object(&(yyloc), locations)); - } -#line 4064 "src/parser.c" +} +#line 3898 "src/parser.c" break; - case 167: /* MkDictPair: Keyword */ -#line 970 "src/parser.y" - { + case 164: /* DictPair: Keyword */ +#line 938 "src/parser.y" + { (yyval.blk) = gen_dictpair(gen_const(jv_copy((yyvsp[0].literal))), gen_index(gen_noop(), gen_const((yyvsp[0].literal)))); - } -#line 4073 "src/parser.c" +} +#line 3907 "src/parser.c" break; - case 168: /* MkDictPair: '(' Exp ')' ':' ExpD */ -#line 974 "src/parser.y" - { + case 165: /* DictPair: '(' Query ')' ':' DictExpr */ +#line 942 "src/parser.y" + { jv msg = check_object_key((yyvsp[-3].blk)); if (jv_is_valid(msg)) { FAIL((yyloc), jv_string_value(msg)); } jv_free(msg); (yyval.blk) = gen_dictpair((yyvsp[-3].blk), (yyvsp[0].blk)); - } -#line 4086 "src/parser.c" +} +#line 3920 "src/parser.c" break; - case 169: /* MkDictPair: error ':' ExpD */ -#line 982 "src/parser.y" - { + case 166: /* DictPair: error ':' DictExpr */ +#line 950 "src/parser.y" + { FAIL((yyloc), "May need parentheses around object key expression"); (yyval.blk) = (yyvsp[0].blk); - } -#line 4095 "src/parser.c" +} +#line 3929 "src/parser.c" break; + case 167: /* DictExpr: DictExpr '|' DictExpr */ +#line 956 "src/parser.y" + { + (yyval.blk) = block_join((yyvsp[-2].blk), (yyvsp[0].blk)); +} +#line 3937 "src/parser.c" + break; -#line 4099 "src/parser.c" + case 168: /* DictExpr: Expr */ +#line 959 "src/parser.y" + { + (yyval.blk) = (yyvsp[0].blk); +} +#line 3945 "src/parser.c" + break; + + +#line 3949 "src/parser.c" default: break; } @@ -4324,7 +4174,7 @@ YYLTYPE yylloc = yyloc_default; return yyresult; } -#line 986 "src/parser.y" +#line 962 "src/parser.y" int jq_parse(struct locfile* locations, block* answer) { diff --git a/src/parser.y b/src/parser.y index 3d24689552..297301716e 100644 --- a/src/parser.y +++ b/src/parser.y @@ -108,14 +108,14 @@ struct lexer_param; %left '+' '-' %left '*' '/' '%' %precedence NONOPT /* non-optional; rules for which a specialized - '?' rule should be preferred over Exp '?' */ -%precedence '?' + '?' rule should be preferred over Expr '?' */ +%precedence '?' '.' '[' FIELD %precedence "try" %precedence "catch" -%type Exp Term -%type MkDict MkDictPair ExpD +%type Query Expr Term +%type DictPairs DictPair DictExpr %type ElseBody %type String QQString %type FuncDef FuncDefs @@ -287,7 +287,7 @@ static block gen_loc_object(location *loc, struct locfile *locations) { %% TopLevel: -Module Imports Exp { +Module Imports Query { *answer = BLOCK($1, $2, gen_op_simple(TOP), $3); } | Module Imports FuncDefs { @@ -298,7 +298,7 @@ Module: %empty { $$ = gen_noop(); } | -"module" Exp ';' { +"module" Query ';' { if (!block_is_const($2)) { FAIL(@$, "Module metadata must be constant"); $$ = gen_noop(); @@ -328,165 +328,108 @@ FuncDef FuncDefs { $$ = block_join($1, $2); } -Exp: -FuncDef Exp %prec FUNCDEF { + +Query: +FuncDef Query %prec FUNCDEF { $$ = block_bind_referenced($1, $2, OP_IS_CALL_PSEUDO); } | - -Term "as" Patterns '|' Exp { +Term "as" Patterns '|' Query { $$ = gen_destructure($1, $3, $5); } | -"reduce" Term "as" Patterns '(' Exp ';' Exp ')' { - $$ = gen_reduce($2, $4, $6, $8); -} | - -"foreach" Term "as" Patterns '(' Exp ';' Exp ';' Exp ')' { - $$ = gen_foreach($2, $4, $6, $8, $10); -} | - -"foreach" Term "as" Patterns '(' Exp ';' Exp ')' { - $$ = gen_foreach($2, $4, $6, $8, gen_noop()); -} | - -"if" Exp "then" Exp ElseBody { - $$ = gen_cond($2, $4, $5); -} | -"if" Exp "then" error { - FAIL(@$, "Possibly unterminated 'if' statement"); - $$ = $2; -} | - -"try" Exp "catch" Exp { - $$ = gen_try($2, $4); -} | -"try" Exp { - $$ = gen_try($2, gen_op_simple(BACKTRACK)); -} | -"try" Exp "catch" error { - FAIL(@$, "Possibly unterminated 'try' statement"); - $$ = $2; -} | - -"label" BINDING '|' Exp { +"label" BINDING '|' Query { jv v = jv_string_fmt("*label-%s", jv_string_value($2)); $$ = gen_location(@$, locations, gen_label(jv_string_value(v), $4)); jv_free($2); jv_free(v); } | - -Exp '?' { - $$ = gen_try($1, gen_op_simple(BACKTRACK)); +Query '|' Query { + $$ = block_join($1, $3); +} | +Query ',' Query { + $$ = gen_both($1, $3); } | +Expr { + $$ = $1; +} -Exp '=' Exp { + +Expr: +Expr "//" Expr { + $$ = gen_definedor($1, $3); +} | +Expr '=' Expr { $$ = gen_call("_assign", BLOCK(gen_lambda($1), gen_lambda($3))); } | - -Exp "or" Exp { +Expr "or" Expr { $$ = gen_or($1, $3); } | - -Exp "and" Exp { +Expr "and" Expr { $$ = gen_and($1, $3); } | - -Exp "//" Exp { - $$ = gen_definedor($1, $3); -} | - -Exp "//=" Exp { +Expr "//=" Expr { $$ = gen_definedor_assign($1, $3); } | - -Exp "|=" Exp { +Expr "|=" Expr { $$ = gen_call("_modify", BLOCK(gen_lambda($1), gen_lambda($3))); } | - -Exp '|' Exp { - $$ = block_join($1, $3); -} | - -Exp ',' Exp { - $$ = gen_both($1, $3); -} | - -Exp '+' Exp { +Expr '+' Expr { $$ = gen_binop($1, $3, '+'); } | - -Exp "+=" Exp { +Expr "+=" Expr { $$ = gen_update($1, $3, '+'); } | - -'-' Exp { - $$ = BLOCK($2, gen_call("_negate", gen_noop())); -} | - -Exp '-' Exp { +Expr '-' Expr { $$ = gen_binop($1, $3, '-'); } | - -Exp "-=" Exp { +Expr "-=" Expr { $$ = gen_update($1, $3, '-'); } | - -Exp '*' Exp { +Expr '*' Expr { $$ = gen_binop($1, $3, '*'); } | - -Exp "*=" Exp { +Expr "*=" Expr { $$ = gen_update($1, $3, '*'); } | - -Exp '/' Exp { +Expr '/' Expr { $$ = gen_binop($1, $3, '/'); } | - -Exp '%' Exp { +Expr '%' Expr { $$ = gen_binop($1, $3, '%'); } | - -Exp "/=" Exp { +Expr "/=" Expr { $$ = gen_update($1, $3, '/'); } | - -Exp SETMOD Exp { +Expr SETMOD Expr { $$ = gen_update($1, $3, '%'); } | - -Exp "==" Exp { +Expr "==" Expr { $$ = gen_binop($1, $3, EQ); } | - -Exp "!=" Exp { +Expr "!=" Expr { $$ = gen_binop($1, $3, NEQ); } | - -Exp '<' Exp { +Expr '<' Expr { $$ = gen_binop($1, $3, '<'); } | - -Exp '>' Exp { +Expr '>' Expr { $$ = gen_binop($1, $3, '>'); } | - -Exp "<=" Exp { +Expr "<=" Expr { $$ = gen_binop($1, $3, LESSEQ); } | - -Exp ">=" Exp { +Expr ">=" Expr { $$ = gen_binop($1, $3, GREATEREQ); } | - -Term { +Term %prec NONOPT { $$ = $1; } + Import: ImportWhat ';' { $$ = $1; } | -ImportWhat Exp ';' { +ImportWhat Query ';' { if (!block_is_const($2)) { FAIL(@$, "Module metadata must be constant"); $$ = gen_noop(); @@ -538,12 +481,12 @@ String { } FuncDef: -"def" IDENT ':' Exp ';' { +"def" IDENT ':' Query ';' { $$ = gen_function(jv_string_value($2), gen_noop(), $4); jv_free($2); } | -"def" IDENT '(' Params ')' ':' Exp ';' { +"def" IDENT '(' Params ')' ':' Query ';' { $$ = gen_function(jv_string_value($2), $4, $7); jv_free($2); } @@ -590,33 +533,22 @@ QQString: QQString QQSTRING_TEXT { $$ = gen_binop($1, gen_const($2), '+'); } | -QQString QQSTRING_INTERP_START Exp QQSTRING_INTERP_END { +QQString QQSTRING_INTERP_START Query QQSTRING_INTERP_END { $$ = gen_binop($1, gen_format($3, jv_copy($0)), '+'); } ElseBody: -"elif" Exp "then" Exp ElseBody { +"elif" Query "then" Query ElseBody { $$ = gen_cond($2, $4, $5); } | -"else" Exp "end" { +"else" Query "end" { $$ = $2; } | "end" { $$ = gen_noop(); } -ExpD: -ExpD '|' ExpD { - $$ = block_join($1, $3); -} | -'-' ExpD { - $$ = BLOCK($2, gen_call("_negate", gen_noop())); -} | -Term { - $$ = $1; -} - Term: '.' { @@ -671,16 +603,16 @@ Term '.' String %prec NONOPT { $$ = gen_noop(); } | /* FIXME: string literals */ -Term '[' Exp ']' '?' { +Term '[' Query ']' '?' { $$ = gen_index_opt($1, $3); } | -Term '[' Exp ']' %prec NONOPT { +Term '[' Query ']' %prec NONOPT { $$ = gen_index($1, $3); } | -Term '.' '[' Exp ']' '?' { +Term '.' '[' Query ']' '?' { $$ = gen_index_opt($1, $4); } | -Term '.' '[' Exp ']' %prec NONOPT { +Term '.' '[' Query ']' %prec NONOPT { $$ = gen_index($1, $4); } | Term '[' ']' '?' { @@ -695,24 +627,27 @@ Term '.' '[' ']' '?' { Term '.' '[' ']' %prec NONOPT { $$ = block_join($1, gen_op_simple(EACH)); } | -Term '[' Exp ':' Exp ']' '?' { +Term '[' Query ':' Query ']' '?' { $$ = gen_slice_index($1, $3, $5, INDEX_OPT); } | -Term '[' Exp ':' ']' '?' { +Term '[' Query ':' ']' '?' { $$ = gen_slice_index($1, $3, gen_const(jv_null()), INDEX_OPT); } | -Term '[' ':' Exp ']' '?' { +Term '[' ':' Query ']' '?' { $$ = gen_slice_index($1, gen_const(jv_null()), $4, INDEX_OPT); } | -Term '[' Exp ':' Exp ']' %prec NONOPT { +Term '[' Query ':' Query ']' %prec NONOPT { $$ = gen_slice_index($1, $3, $5, INDEX); } | -Term '[' Exp ':' ']' %prec NONOPT { +Term '[' Query ':' ']' %prec NONOPT { $$ = gen_slice_index($1, $3, gen_const(jv_null()), INDEX); } | -Term '[' ':' Exp ']' %prec NONOPT { +Term '[' ':' Query ']' %prec NONOPT { $$ = gen_slice_index($1, gen_const(jv_null()), $4, INDEX); } | +Term '?' { + $$ = gen_try($1, gen_op_simple(BACKTRACK)); +} | LITERAL { $$ = gen_const($1); } | @@ -722,22 +657,51 @@ String { FORMAT { $$ = gen_format(gen_noop(), $1); } | -'(' Exp ')' { +'-' Term { + $$ = BLOCK($2, gen_call("_negate", gen_noop())); +} | +'(' Query ')' { $$ = $2; } | -'[' Exp ']' { +'[' Query ']' { $$ = gen_collect($2); } | '[' ']' { $$ = gen_const(jv_array()); } | -'{' MkDict '}' { +'{' DictPairs '}' { block o = gen_const_object($2); if (o.first != NULL) $$ = o; else $$ = BLOCK(gen_subexp(gen_const(jv_object())), $2, gen_op_simple(POP)); } | +"reduce" Expr "as" Patterns '(' Query ';' Query ')' { + $$ = gen_reduce($2, $4, $6, $8); +} | +"foreach" Expr "as" Patterns '(' Query ';' Query ';' Query ')' { + $$ = gen_foreach($2, $4, $6, $8, $10); +} | +"foreach" Expr "as" Patterns '(' Query ';' Query ')' { + $$ = gen_foreach($2, $4, $6, $8, gen_noop()); +} | +"if" Query "then" Query ElseBody { + $$ = gen_cond($2, $4, $5); +} | +"if" Query "then" error { + FAIL(@$, "Possibly unterminated 'if' statement"); + $$ = $2; +} | +"try" Expr "catch" Expr { + $$ = gen_try($2, $4); +} | +"try" Expr "catch" error { + FAIL(@$, "Possibly unterminated 'try' statement"); + $$ = $2; +} | +"try" Expr { + $$ = gen_try($2, gen_op_simple(BACKTRACK)); +} | /* * This `$$$$varname` hack is strictly private to jq builtins. DO NOT USE!! * @@ -795,7 +759,7 @@ Args ';' Arg { } Arg: -Exp { +Query { $$ = gen_lambda($1); } @@ -859,7 +823,7 @@ Keyword ':' Pattern { String ':' Pattern { $$ = gen_object_matcher($1, $3); } | -'(' Exp ')' ':' Pattern { +'(' Query ')' ':' Pattern { jv msg = check_object_key($2); if (jv_is_valid(msg)) { FAIL(@$, jv_string_value(msg)); @@ -928,61 +892,73 @@ Keyword: $$ = jv_string("break"); } -MkDict: + +DictPairs: %empty { - $$=gen_noop(); + $$ = gen_noop(); } | - MkDictPair { $$ = $1; } -| MkDictPair ',' MkDict { $$=block_join($1, $3); } -| error ',' MkDict { $$ = $3; } +DictPair { + $$ = $1; +} | +DictPair ',' DictPairs { + $$ = block_join($1, $3); +} -MkDictPair: -IDENT ':' ExpD { +DictPair: +IDENT ':' DictExpr { $$ = gen_dictpair(gen_const($1), $3); - } -| Keyword ':' ExpD { +} | +Keyword ':' DictExpr { $$ = gen_dictpair(gen_const($1), $3); - } -| String ':' ExpD { +} | +String ':' DictExpr { $$ = gen_dictpair($1, $3); - } -| String { +} | +String { $$ = gen_dictpair($1, BLOCK(gen_op_simple(POP), gen_op_simple(DUP2), gen_op_simple(DUP2), gen_op_simple(INDEX))); - } -| BINDING ':' ExpD { +} | +BINDING ':' DictExpr { $$ = gen_dictpair(gen_location(@$, locations, gen_op_unbound(LOADV, jv_string_value($1))), $3); jv_free($1); - } -| BINDING { +} | +BINDING { $$ = gen_dictpair(gen_const($1), gen_location(@$, locations, gen_op_unbound(LOADV, jv_string_value($1)))); - } -| IDENT { +} | +IDENT { $$ = gen_dictpair(gen_const(jv_copy($1)), gen_index(gen_noop(), gen_const($1))); - } -| "$__loc__" { +} | +"$__loc__" { $$ = gen_dictpair(gen_const(jv_string("__loc__")), gen_loc_object(&@$, locations)); - } -| Keyword { +} | +Keyword { $$ = gen_dictpair(gen_const(jv_copy($1)), gen_index(gen_noop(), gen_const($1))); - } -| '(' Exp ')' ':' ExpD { +} | +'(' Query ')' ':' DictExpr { jv msg = check_object_key($2); if (jv_is_valid(msg)) { FAIL(@$, jv_string_value(msg)); } jv_free(msg); $$ = gen_dictpair($2, $5); - } -| error ':' ExpD { +} | +error ':' DictExpr { FAIL(@$, "May need parentheses around object key expression"); $$ = $3; - } +} + +DictExpr: +DictExpr '|' DictExpr { + $$ = block_join($1, $3); +} | +Expr { + $$ = $1; +} %% int jq_parse(struct locfile* locations, block* answer) { diff --git a/tests/jq.test b/tests/jq.test index b94f29d245..71c2b2992e 100644 --- a/tests/jq.test +++ b/tests/jq.test @@ -36,9 +36,11 @@ null null [] -{x: -1} -null -{"x": -1} +{x:-1},{x:-.},{x:-.|abs} +1 +{"x":-1} +{"x":-1} +{"x":1} # The input line starts with a 0xFEFF (byte order mark) codepoint # No, there is no reason to have a byte order mark in UTF8 text. @@ -312,6 +314,18 @@ null [{"a":1}, {"b":2}, {"a":3, "b":4}] [-1, -1, -4] +[-foreach -.[] as $x (0; . + $x)] +[1,2,3] +[1,3,6] + +[foreach .[] / .[] as $i (0; . + $i)] +[1,2] +[1,3,3.5,4.5] + +[foreach .[] as $x (0; . + $x) as $x | $x] +[1,2,3] +[1,3,6] + [limit(3; .[])] [11,22,33,44,55,66,77,88,99] [11,22,33] @@ -536,6 +550,10 @@ null 1 [2,4] +[-1 as $x | 1,$x] +null +[1,-1] + [10 * 20, 20 / .] 4 [200, 5] @@ -769,6 +787,18 @@ reduce [[1,2,10], [3,4,10]][] as [$i,$j] (0; . + $i * $j) null 14 +[-reduce -.[] as $x (0; . + $x)] +[1,2,3] +[6] + +[reduce .[] / .[] as $i (0; . + $i)] +[1,2] +[4.5] + +reduce .[] as $x (0; . + $x) as $x | $x +[1,2,3] +6 + # This, while useless, should still compile. reduce . as $n (.; .) null @@ -1196,6 +1226,18 @@ null 7 [7] +[-if true then 1 else 2 end] +null +[-1] + +{x: if true then 1 else 2 end} +null +{"x":1} + +if true then [.] else . end [] +null +null + [.[] | [.foo[] // .bar]] [{"foo":[1,2], "bar": 42}, {"foo":[1], "bar": null}, {"foo":[null,false,3], "bar": 18}, {"foo":[], "bar":42}, {"foo": [null,false,null], "bar": 41}] [[1,2], [1], [3], [42], [41]] @@ -1286,6 +1328,39 @@ null [null,true,{"a":1}] [] +[if error then 1 else 2 end?] +"foo" +[] + +try error(0) // 1 +null +1 + +1, try error(2), 3 +null +1 +3 + +1 + try 2 catch 3 + 4 +null +7 + +[-try .] +1 +[-1] + +try -.? catch . +"foo" +"string (\"foo\") cannot be negated" + +{x: try 1, y: try error catch 2, z: if true then 3 end} +null +{"x":1,"y":2,"z":3} + +{x: 1 + 2, y: false or true, z: null // 3} +null +{"x":3,"y":true,"z":3} + .[] | try error catch . [1,null,2] 1