diff --git a/src/gwion.y b/src/gwion.y index 7583ba3f..4872d2ce 100644 --- a/src/gwion.y +++ b/src/gwion.y @@ -205,7 +205,16 @@ ast section : stmt_list { $$ = MK_SECTION(stmt, stmt_list, $1); } - | func_def { $$ = MK_SECTION(func, func_def, $1); } + | func_def { + // temporarly disallow const generics in templates func + if($1->base->tmpl) { + if($1->base->tmpl->list->len != tmplarg_ntypes($1->base->tmpl->list)) { + parser_error(&@1, arg, "const generics not allowed in templates (for now)", 0); + YYERROR; + } + } + $$ = MK_SECTION(func, func_def, $1); + } | class_def { $$ = MK_SECTION(class, class_def, $1); } | trait_def { $$ = MK_SECTION(trait, trait_def, $1); } | extend_def { $$ = MK_SECTION(extend, extend_def, $1); } @@ -1141,11 +1150,11 @@ basic_exp | FLOATT { $$ = new_prim_float( mpool(arg), $1, @$); } | STRING_LIT { $$ = new_prim_string( mpool(arg), $1, 0, @$); } | CHAR_LIT { $$ = new_prim_char( mpool(arg), $1, @$); } + | interp { $$ = !$1->next ? $1 : new_prim_interp(mpool(arg), $1, @$); } prim_exp : ID { $$ = new_prim_id( mpool(arg), $1, @$); } | basic_exp - | interp { $$ = !$1->next ? $1 : new_prim_interp(mpool(arg), $1, @$); } | "[" opt_exp array_lit_end { if(!$2) { parser_error(&@1, arg, "must provide values/expressions for array [...]", 0); diff --git a/src/parser.c b/src/parser.c index f9e550dc..7fe8b696 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.7.6. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C @@ -46,10 +46,10 @@ USER NAME SPACE" below. */ /* Identify Bison output, and Bison version. */ -#define YYBISON 30706 +#define YYBISON 30802 /* Bison version string. */ -#define YYBISON_VERSION "3.7.6" +#define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -547,12 +547,18 @@ typedef int yy_state_fast_t; # define YY_USE(E) /* empty */ #endif -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else @@ -782,45 +788,45 @@ static const yytype_int8 yytranslate[] = }; #if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 193, 193, 194, 197, 201, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 219, 221, 228, 237, - 237, 237, 239, 245, 252, 259, 263, 263, 264, 264, - 266, 271, 276, 282, 289, 297, 301, 306, 310, 315, - 318, 318, 319, 319, 321, 324, 330, 330, 331, 331, - 332, 341, 341, 343, 347, 352, 356, 361, 366, 375, - 386, 394, 395, 405, 407, 411, 417, 419, 423, 424, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, - 437, 438, 440, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 457, 457, 467, 472, 472, 473, - 478, 494, 499, 499, 500, 500, 503, 504, 510, 515, - 521, 526, 526, 529, 541, 545, 550, 561, 572, 573, - 577, 586, 596, 606, 617, 630, 648, 657, 671, 685, - 694, 705, 705, 707, 712, 716, 721, 727, 732, 738, - 739, 750, 751, 752, 753, 756, 756, 758, 758, 758, - 758, 758, 761, 762, 765, 769, 770, 771, 775, 776, - 779, 780, 781, 785, 785, 786, 787, 788, 794, 794, - 795, 795, 797, 798, 804, 809, 811, 812, 812, 814, - 814, 816, 817, 820, 821, 822, 823, 826, 826, 828, - 828, 831, 836, 843, 849, 857, 866, 866, 866, 866, - 866, 868, 878, 887, 897, 903, 903, 905, 907, 909, - 912, 912, 912, 913, 919, 926, 935, 936, 950, 951, - 955, 956, 959, 959, 959, 960, 961, 961, 964, 965, - 967, 967, 969, 969, 972, 976, 978, 982, 988, 997, - 999, 1000, 1000, 1002, 1002, 1003, 1003, 1003, 1003, 1004, - 1004, 1005, 1005, 1006, 1006, 1006, 1008, 1008, 1009, 1010, - 1012, 1015, 1015, 1016, 1016, 1017, 1017, 1018, 1018, 1019, - 1019, 1020, 1020, 1021, 1021, 1022, 1022, 1023, 1023, 1024, - 1024, 1025, 1025, 1027, 1027, 1030, 1030, 1030, 1031, 1031, - 1034, 1035, 1036, 1037, 1038, 1041, 1042, 1043, 1044, 1045, - 1046, 1049, 1054, 1059, 1059, 1067, 1068, 1071, 1076, 1080, - 1086, 1086, 1088, 1088, 1090, 1099, 1100, 1102, 1104, 1107, - 1109, 1113, 1114, 1115, 1117, 1118, 1129, 1129, 1131, 1132, - 1133, 1133, 1134, 1134, 1137, 1141, 1142, 1143, 1146, 1147, - 1148, 1149, 1157, 1158, 1159, 1160, 1161, 1167, 1168, 1169, - 1170, 1171 + 0, 193, 193, 194, 197, 201, 207, 208, 218, 219, + 220, 221, 222, 223, 224, 225, 228, 230, 237, 246, + 246, 246, 248, 254, 261, 268, 272, 272, 273, 273, + 275, 280, 285, 291, 298, 306, 310, 315, 319, 324, + 327, 327, 328, 328, 330, 333, 339, 339, 340, 340, + 341, 350, 350, 352, 356, 361, 365, 370, 375, 384, + 395, 403, 404, 414, 416, 420, 426, 428, 432, 433, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 449, 453, 454, 455, 456, 457, 458, 459, + 460, 461, 462, 463, 466, 466, 476, 481, 481, 482, + 487, 503, 508, 508, 509, 509, 512, 513, 519, 524, + 530, 535, 535, 538, 550, 554, 559, 570, 581, 582, + 586, 595, 605, 615, 626, 639, 657, 666, 680, 694, + 703, 714, 714, 716, 721, 725, 730, 736, 741, 747, + 748, 759, 760, 761, 762, 765, 765, 767, 767, 767, + 767, 767, 770, 771, 774, 778, 779, 780, 784, 785, + 788, 789, 790, 794, 794, 795, 796, 797, 803, 803, + 804, 804, 806, 807, 813, 818, 820, 821, 821, 823, + 823, 825, 826, 829, 830, 831, 832, 835, 835, 837, + 837, 840, 845, 852, 858, 866, 875, 875, 875, 875, + 875, 877, 887, 896, 906, 912, 912, 914, 916, 918, + 921, 921, 921, 922, 928, 935, 944, 945, 959, 960, + 964, 965, 968, 968, 968, 969, 970, 970, 973, 974, + 976, 976, 978, 978, 981, 985, 987, 991, 997, 1006, + 1008, 1009, 1009, 1011, 1011, 1012, 1012, 1012, 1012, 1013, + 1013, 1014, 1014, 1015, 1015, 1015, 1017, 1017, 1018, 1019, + 1021, 1024, 1024, 1025, 1025, 1026, 1026, 1027, 1027, 1028, + 1028, 1029, 1029, 1030, 1030, 1031, 1031, 1032, 1032, 1033, + 1033, 1034, 1034, 1036, 1036, 1039, 1039, 1039, 1040, 1040, + 1043, 1044, 1045, 1046, 1047, 1050, 1051, 1052, 1053, 1054, + 1055, 1058, 1063, 1068, 1068, 1076, 1077, 1080, 1085, 1089, + 1095, 1095, 1097, 1097, 1099, 1108, 1109, 1111, 1113, 1116, + 1118, 1122, 1123, 1124, 1126, 1127, 1138, 1138, 1140, 1141, + 1142, 1142, 1143, 1143, 1146, 1150, 1151, 1152, 1153, 1156, + 1157, 1158, 1166, 1167, 1168, 1169, 1170, 1176, 1177, 1178, + 1179, 1180 }; #endif @@ -886,27 +892,6 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_int16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381 -}; -#endif - #define YYPACT_NINF (-461) #define yypact_value_is_default(Yyn) \ @@ -917,8 +902,8 @@ static const yytype_int16 yytoknum[] = #define yytable_value_is_error(Yyn) \ 0 - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ static const yytype_int16 yypact[] = { 840, -461, 1516, 1673, 948, 314, -461, 83, -461, 1377, @@ -934,61 +919,61 @@ static const yytype_int16 yypact[] = -461, 261, -461, -461, -461, 314, -461, -461, 12, 162, 172, 163, 176, 52, 263, -41, 112, 154, 195, 208, 2421, -461, 207, -461, -461, 96, 244, -461, -461, -461, - 2221, -461, 311, 317, -461, -461, -461, -461, -461, -461, - -461, -461, -461, -461, -461, -461, -461, 327, -461, 332, + 2221, -461, 317, 327, -461, -461, -461, -461, -461, -461, + -461, -461, -461, -461, -461, -461, -461, 332, -461, 349, -461, -461, -461, -461, 2221, 226, 273, -461, 1056, 35, - 344, -461, -461, -461, -461, 320, -461, -461, 232, 266, - 2221, 202, 2317, 1475, 274, 349, 277, -461, 358, 331, - -461, -461, -461, 282, 289, 290, -461, 293, 314, -461, - 41, -461, 287, 275, 347, 200, -461, 381, 24, -461, - 312, 392, 60, 315, 305, -461, -461, 318, 398, 326, - 1769, 1632, -461, 346, -461, -461, -461, 409, 1164, -24, - -461, -461, 410, -461, -461, 410, 321, -461, -461, -461, - 60, 2221, -461, -461, 421, -461, 2221, 2221, 2221, 2221, + 346, -461, -461, -461, -461, 320, -461, -461, 232, 266, + 2221, 202, 2317, 1475, 276, 350, 278, -461, 360, 333, + -461, -461, -461, 290, 289, 293, -461, 298, 314, -461, + 41, -461, 294, 275, 347, 200, -461, 388, 24, -461, + 315, 392, 60, 316, 307, -461, -461, 326, 398, 330, + 1769, 1632, -461, 353, -461, -461, -461, 409, 1164, -24, + -461, -461, 412, -461, -461, 412, 323, -461, -461, -461, + 60, 2221, -461, -461, 426, -461, 2221, 2221, 2221, 2221, 340, 320, 471, 103, 60, 60, 2221, 2421, 2421, 2421, 2421, 2421, 2421, -461, -461, 2421, 2421, 2421, -461, 2421, - -461, 2421, 2421, 60, -461, 419, 1673, 348, 251, 427, + -461, 2421, 2421, 60, -461, 421, 1673, 351, 251, 427, -461, -461, -461, 1632, 131, -461, -461, 425, 1810, -461, -461, -461, -461, 2221, -461, 194, 106, -461, 60, -461, - 60, 428, 2221, 434, 28, 1475, 36, 417, 431, -461, - -461, -461, 331, 328, 400, -461, -461, 328, 352, 60, - 275, 364, -461, 24, -461, -461, -461, 1906, -461, 441, - -461, -461, 389, 283, 423, 369, 328, 364, -461, 60, - 450, -461, 399, -461, 1632, 2221, -461, 1272, -461, 376, - -461, -21, 1164, -461, -461, -461, 377, 455, -461, -461, - -461, -461, -461, 320, 459, 206, 320, 328, 328, -461, - -461, 328, 51, -461, 371, -461, 162, 172, 163, 176, + 60, 432, 2221, 436, 28, 1475, 36, 418, 433, -461, + -461, -461, 333, 331, 400, -461, -461, 331, 354, 60, + 275, 364, -461, 24, -461, -461, -461, 1906, -461, 443, + -461, -461, 391, 283, 423, 372, 331, 364, -461, 60, + 453, -461, 401, -461, 1632, 2221, -461, 1272, -461, 376, + -461, -21, 1164, -461, -461, -461, 378, 456, -461, -461, + -461, -461, -461, 320, 462, 206, 320, 331, 331, -461, + -461, 331, 51, -461, 373, -461, 162, 172, 163, 176, 52, 263, -41, 112, 154, 195, 208, -461, 1164, -461, 33, -461, -461, -461, -461, 111, -461, 1947, -461, -461, - -461, -461, 458, 66, -461, 384, -461, 230, -461, -461, - 386, 387, 1377, 469, 2221, 1377, 2043, 390, 463, 2221, - -461, 63, 15, 34, -461, 11, 435, -461, 352, 364, - 220, 328, -461, -461, 337, -461, -461, 472, 2084, -461, - 474, -461, 384, -461, 247, 401, 402, 479, 328, 473, - 75, -461, 482, 483, 60, -461, -461, 484, -461, -461, - -461, -461, 328, 1377, 485, -461, -461, -461, -461, 486, - 489, 490, 2221, -461, -461, 2421, 39, 491, 251, -461, - -461, 494, -461, 2221, -461, 403, 60, -461, 328, 328, - 488, -461, 69, -461, 1377, 498, 411, -461, 2221, 492, - 481, -461, -461, 388, -461, 508, 1377, 60, 505, 352, - -461, 129, 60, 352, 220, 510, -461, 608, -461, 392, - -461, 432, -461, -461, -461, -461, 60, -461, -461, -461, - -461, -461, 304, -461, 60, 410, 512, -461, 495, -461, - -461, 60, 60, 60, 514, -461, -461, 2180, -461, -461, + -461, -461, 458, 66, -461, 386, -461, 230, -461, -461, + 387, 389, 1377, 470, 2221, 1377, 2043, 393, 464, 2221, + -461, 63, 15, 34, -461, 11, 435, -461, 354, 364, + 220, 331, -461, -461, 337, -461, -461, 472, 2084, -461, + 479, -461, 386, -461, 247, 402, 403, 480, 331, 474, + 75, -461, 484, 483, 60, -461, -461, 485, -461, -461, + -461, -461, 331, 1377, 487, -461, -461, -461, -461, 489, + 490, 492, 2221, -461, -461, 2421, 39, 491, 251, -461, + -461, 494, -461, 2221, -461, 410, 60, -461, 331, 331, + 488, -461, 69, -461, 1377, 499, 413, -461, 2221, 482, + 493, -461, -461, 394, -461, 508, 1377, 60, 506, 354, + -461, 129, 60, 354, 220, 511, -461, 608, -461, 392, + -461, 437, -461, -461, -461, -461, 60, -461, -461, -461, + -461, -461, 304, -461, 60, 412, 510, -461, 495, -461, + -461, 60, 60, 60, 515, -461, -461, 2180, -461, -461, -461, -461, 2221, -461, 392, -461, 1377, 1377, -461, 1377, - 463, 71, 2221, 429, 1377, 438, 15, 513, -461, 442, + 464, 71, 2221, 429, 1377, 441, 15, 514, -461, 445, -461, -461, 19, -461, -461, 220, -461, -461, 724, 423, - -461, -461, 523, 445, -461, 31, 451, -461, -461, 410, - 2221, 526, 527, 528, 529, 449, -461, 113, 530, -461, + -461, -461, 523, 446, -461, 31, 451, -461, -461, 412, + 2221, 528, 529, 526, 530, 452, -461, 113, 531, -461, -461, -461, 2221, 1377, -461, 1377, -461, -461, -461, -461, -461, 533, -461, -461, -461, 536, -461, 540, -461, -461, -461, -461, 113, -461, 60, -461, -461, -461, -461, 76, -461, 1377, -461, -461, -461, 538, 1377, -461, -461 }; - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_int16 yydefact[] = { 3, 138, 0, 257, 0, 186, 232, 0, 118, 0, @@ -996,14 +981,14 @@ static const yytype_int16 yydefact[] = 103, 0, 186, 186, 178, 0, 205, 186, 48, 49, 186, 186, 229, 0, 0, 304, 0, 0, 228, 23, 335, 336, 337, 0, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 338, 312, 285, 313, 286, + 76, 77, 78, 79, 80, 339, 312, 285, 313, 286, 0, 0, 0, 0, 0, 289, 288, 346, 0, 2, 4, 8, 9, 334, 15, 10, 6, 13, 186, 14, 86, 89, 37, 93, 92, 91, 11, 87, 0, 84, 90, 85, 0, 88, 83, 0, 139, 343, 141, 210, 211, 0, 212, 7, 233, 186, 12, 165, 258, 261, 263, 265, 267, 269, 271, 273, 275, 277, 279, 281, - 0, 283, 331, 287, 320, 290, 340, 339, 315, 351, + 0, 283, 331, 287, 320, 290, 338, 340, 315, 351, 0, 251, 285, 286, 254, 255, 151, 147, 248, 246, 247, 245, 148, 249, 250, 149, 150, 0, 196, 0, 198, 197, 200, 199, 0, 256, 0, 66, 0, 139, @@ -1020,7 +1005,7 @@ static const yytype_int16 yydefact[] = 253, 0, 0, 0, 291, 0, 0, 0, 0, 0, 316, 317, 319, 0, 0, 345, 349, 0, 0, 333, 332, 341, 67, 0, 342, 0, 0, 185, 0, 187, - 0, 0, 0, 338, 0, 0, 0, 0, 0, 133, + 0, 0, 0, 339, 0, 0, 0, 0, 0, 133, 97, 99, 101, 175, 188, 190, 16, 175, 28, 0, 146, 0, 218, 0, 222, 223, 225, 0, 163, 164, 51, 227, 0, 0, 42, 0, 175, 0, 302, 62, @@ -1056,27 +1041,27 @@ static const yytype_int16 yydefact[] = 124, 113, 173, 217, 235, 0, 0, 201, 125 }; - /* YYPGOTO[NTERM-NUM]. */ +/* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -461, -461, 29, -66, 187, -461, -460, -461, -85, 224, - -461, -461, -325, -461, -294, -15, -461, -3, -461, -461, - -20, -461, -461, -461, -461, -461, -53, 46, -5, -272, - -461, -461, 107, 37, -461, -461, -57, -461, -9, -461, - -461, -461, 260, -461, -461, -461, 150, -461, 9, -461, - -461, -461, 155, -461, -461, 396, -461, -461, -461, -461, - -461, -147, 2, 8, -165, -461, -188, -461, 95, 444, + -461, -461, 40, -66, 187, -461, -460, -461, -85, 224, + -461, -461, -325, -461, -294, -14, -461, -3, -461, -461, + -20, -461, -461, -461, -461, -461, -53, 49, -5, -272, + -461, -461, 109, 46, -461, -461, -57, -461, -9, -461, + -461, -461, 264, -461, -461, -461, 150, -461, 9, -461, + -461, -461, 156, -461, -461, 397, -461, -461, -461, -461, + -461, -147, 2, 8, -165, -461, -188, -461, 98, 444, -461, 58, -183, -452, -277, 167, -461, 404, -461, 17, - -153, -461, -461, -461, 329, 333, -461, -461, -461, 393, - -461, 269, -461, 395, -461, -23, 44, -461, 10, -461, + -153, -461, -461, -461, 341, 342, -461, -461, -461, 383, + -461, 272, -461, 395, -461, -23, 37, -461, 20, -461, -461, 1, 165, -461, -461, -100, -98, -101, -96, -235, - -224, -461, 339, 350, 345, 351, 353, 341, 342, 357, - 372, 343, 354, -77, -2, -461, -461, -461, 135, -461, - -461, -90, -461, -461, -184, -461, 265, -461, -12, -461, + -224, -461, 348, 345, 352, 355, 356, 343, 358, 344, + 357, 338, 361, -77, -2, -461, -461, -461, 135, -461, + -461, -90, -461, -461, -184, -461, 268, -461, -12, -461, -249, -461 }; - /* YYDEFGOTO[NTERM-NUM]. */ +/* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { 0, 68, 69, 70, 183, 71, 508, 72, 73, 234, @@ -1096,9 +1081,9 @@ static const yytype_int16 yydefgoto[] = 127, 128 }; - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 171, 158, 198, 228, 147, 155, 223, 233, 216, 318, @@ -1132,39 +1117,39 @@ static const yytype_int16 yytable[] = 392, 279, 280, 400, 250, 401, 198, 252, 188, 431, 262, 393, 314, 315, 403, 350, 351, 352, 457, 263, 198, 219, 240, 32, 421, 190, 198, 288, 289, 188, - 273, 38, 39, 32, 40, 41, 42, -252, 432, 427, - 278, 38, 177, -253, 2, 285, 3, 493, 229, 130, - 304, 289, 6, 275, 189, 32, 213, 363, 276, 337, + 273, 38, 39, 32, 40, 41, 42, 43, 432, 427, + 278, 38, 177, -252, 2, 285, 3, 493, 229, 130, + 304, 289, 6, -253, 189, 32, 213, 363, 275, 337, 510, 511, 625, 38, 189, 188, 56, 57, 58, 59, - 20, 161, 162, 163, 164, 284, 32, 296, 241, 297, - 298, 299, 190, 300, 38, 303, 189, 138, 139, 140, - 141, 32, 190, 307, 35, 337, 308, 65, 66, 38, - 39, 311, 40, 41, 42, 43, 466, 572, 317, 471, - 268, 313, 32, 480, 190, 322, 483, 323, 326, 327, - 38, 328, 55, 329, 56, 57, 58, 59, 485, 330, - 60, 489, 482, 334, 335, 190, 61, 62, 63, 64, - 342, 198, 345, 189, 348, 56, 57, 58, 59, 378, - 427, 381, 387, 390, 402, 65, 66, 353, 404, 67, - 409, 412, 289, 415, 529, 198, 419, 423, 428, 216, - 39, 190, 438, 198, 435, 444, 65, 66, 445, 449, - 452, 453, 455, 382, 363, 465, 472, 474, 578, 478, - 479, 493, 481, 486, 198, 548, 487, 513, 502, 198, - 467, 274, 520, 522, 518, 519, 524, 558, 530, 525, - 527, 531, 559, 198, 532, 533, 551, 542, 537, 198, - 540, 198, 228, 546, 549, 550, 554, 555, 198, 198, - 198, 432, 556, 560, 511, 570, 552, 573, 579, 580, - 585, 597, 611, 595, 599, 600, 606, 356, 607, 613, - 610, 614, 463, 618, 615, 616, 568, 589, 590, 427, - 591, 622, 623, 624, 627, 596, 430, 602, 564, 605, - 587, 526, 198, 571, 594, 131, 56, 258, 58, 260, - 134, 135, 414, 496, 136, 598, 491, 292, 541, 271, - 573, 357, 287, 354, 137, 138, 139, 140, 141, 142, - 143, 144, 425, 310, 620, 609, 617, 366, 612, 145, - 146, 198, 621, 321, 592, 368, 371, 514, 372, 367, - 619, 0, 369, 539, 375, 370, 451, 0, 0, 0, - 0, 1, 229, 2, 373, 3, 376, 628, 4, 567, - 5, 6, 7, 0, 8, 9, 10, 11, 12, 13, - 14, 374, 0, 0, 15, 16, 17, 18, 19, 20, + 20, 161, 162, 163, 164, 276, 32, 284, 241, 296, + 297, 298, 190, 299, 38, 300, 189, 138, 139, 140, + 141, 32, 190, 303, 35, 337, 307, 65, 66, 38, + 39, 308, 40, 41, 42, 43, 466, 572, 311, 471, + 268, 313, 32, 480, 190, 317, 483, 323, 322, 326, + 38, 327, 55, 329, 56, 57, 58, 59, 485, 328, + 60, 489, 482, 330, 335, 190, 61, 62, 63, 64, + 334, 198, 342, 189, 345, 56, 57, 58, 59, 348, + 427, 378, 387, 390, 381, 65, 66, 353, 402, 67, + 404, 409, 289, 412, 529, 198, 415, 423, 419, 216, + 428, 190, 39, 198, 435, 438, 65, 66, 444, 449, + 445, 452, 453, 382, 363, 455, 472, 465, 578, 474, + 478, 493, 479, 481, 198, 548, 486, 487, 502, 198, + 467, 274, 513, 520, 522, 518, 519, 558, 524, 525, + 530, 527, 559, 198, 531, 532, 551, 533, 537, 198, + 540, 198, 228, 546, 542, 549, 552, 550, 198, 198, + 198, 432, 556, 555, 560, 511, 579, 573, 554, 580, + 570, 585, 611, 595, 597, 599, 606, 356, 600, 607, + 610, 613, 615, 614, 618, 463, 616, 589, 590, 427, + 591, 622, 623, 624, 627, 596, 430, 568, 602, 605, + 587, 564, 198, 526, 594, 131, 56, 258, 58, 260, + 134, 135, 571, 496, 136, 598, 414, 491, 292, 271, + 573, 541, 287, 310, 137, 138, 139, 140, 141, 142, + 143, 144, 354, 357, 620, 425, 617, 592, 612, 145, + 146, 198, 621, 321, 367, 609, 366, 514, 371, 375, + 619, 373, 368, 539, 0, 0, 369, 0, 370, 451, + 0, 1, 229, 2, 372, 3, 374, 628, 4, 567, + 5, 6, 7, 376, 8, 9, 10, 11, 12, 13, + 14, 0, 0, 0, 15, 16, 17, 18, 19, 20, 0, 21, 22, 23, 24, 0, 0, 0, 0, 0, 0, 25, 0, 26, 27, 28, 29, 30, 0, 31, 32, 33, 34, 35, 0, 36, 37, 0, 38, 39, @@ -1391,39 +1376,39 @@ static const yytype_int16 yycheck[] = 278, 8, 9, 288, 112, 290, 309, 111, 5, 6, 95, 283, 92, 93, 292, 237, 238, 239, 355, 91, 323, 94, 41, 52, 309, 111, 329, 41, 42, 5, - 66, 60, 61, 52, 63, 64, 65, 6, 323, 317, + 66, 60, 61, 52, 63, 64, 65, 66, 323, 317, 94, 60, 3, 6, 5, 5, 7, 412, 337, 10, 41, 42, 13, 6, 83, 52, 334, 335, 6, 342, 3, 4, 614, 60, 83, 5, 85, 86, 87, 88, - 31, 37, 38, 39, 40, 11, 52, 83, 97, 10, - 83, 3, 111, 32, 60, 83, 83, 104, 105, 106, + 31, 37, 38, 39, 40, 6, 52, 11, 97, 83, + 10, 83, 111, 3, 60, 32, 83, 104, 105, 106, 107, 52, 111, 83, 55, 378, 83, 116, 117, 60, - 61, 94, 63, 64, 65, 66, 378, 83, 7, 387, - 115, 44, 52, 402, 111, 83, 405, 5, 83, 94, - 60, 83, 83, 5, 85, 86, 87, 88, 406, 83, - 91, 409, 404, 67, 5, 111, 97, 98, 99, 100, - 10, 444, 101, 83, 3, 85, 86, 87, 88, 10, - 428, 83, 5, 8, 6, 116, 117, 97, 4, 120, - 23, 10, 42, 115, 453, 468, 94, 83, 7, 502, - 61, 111, 83, 476, 31, 5, 116, 117, 59, 83, - 83, 6, 3, 468, 462, 94, 8, 83, 525, 83, - 83, 556, 3, 83, 497, 484, 13, 3, 43, 502, - 8, 473, 3, 10, 83, 83, 4, 496, 3, 6, - 6, 5, 497, 516, 5, 5, 488, 94, 7, 522, - 6, 524, 568, 15, 6, 94, 25, 119, 531, 532, - 533, 516, 4, 8, 4, 83, 24, 522, 6, 24, - 6, 83, 579, 94, 11, 83, 3, 56, 83, 3, - 79, 4, 83, 3, 6, 6, 507, 546, 547, 537, - 549, 8, 6, 3, 6, 554, 322, 562, 502, 569, - 542, 444, 575, 516, 552, 84, 85, 86, 87, 88, - 89, 90, 302, 413, 93, 556, 411, 171, 473, 125, - 575, 242, 168, 240, 103, 104, 105, 106, 107, 108, - 109, 110, 313, 190, 593, 575, 585, 248, 580, 118, - 119, 614, 595, 198, 550, 250, 255, 432, 256, 249, - 592, -1, 251, 468, 261, 252, 341, -1, -1, -1, - -1, 3, 621, 5, 257, 7, 262, 626, 10, 11, - 12, 13, 14, -1, 16, 17, 18, 19, 20, 21, - 22, 259, -1, -1, 26, 27, 28, 29, 30, 31, + 61, 83, 63, 64, 65, 66, 378, 83, 94, 387, + 115, 44, 52, 402, 111, 7, 405, 5, 83, 83, + 60, 94, 83, 5, 85, 86, 87, 88, 406, 83, + 91, 409, 404, 83, 5, 111, 97, 98, 99, 100, + 67, 444, 10, 83, 101, 85, 86, 87, 88, 3, + 428, 10, 5, 8, 83, 116, 117, 97, 6, 120, + 4, 23, 42, 10, 453, 468, 115, 83, 94, 502, + 7, 111, 61, 476, 31, 83, 116, 117, 5, 83, + 59, 83, 6, 468, 462, 3, 8, 94, 525, 83, + 83, 556, 83, 3, 497, 484, 83, 13, 43, 502, + 8, 473, 3, 3, 10, 83, 83, 496, 4, 6, + 3, 6, 497, 516, 5, 5, 488, 5, 7, 522, + 6, 524, 568, 15, 94, 6, 24, 94, 531, 532, + 533, 516, 4, 119, 8, 4, 6, 522, 25, 24, + 83, 6, 579, 94, 83, 11, 3, 56, 83, 83, + 79, 3, 6, 4, 3, 83, 6, 546, 547, 537, + 549, 8, 6, 3, 6, 554, 322, 507, 562, 569, + 542, 502, 575, 444, 552, 84, 85, 86, 87, 88, + 89, 90, 516, 413, 93, 556, 302, 411, 171, 125, + 575, 473, 168, 190, 103, 104, 105, 106, 107, 108, + 109, 110, 240, 242, 593, 313, 585, 550, 580, 118, + 119, 614, 595, 198, 249, 575, 248, 432, 255, 261, + 592, 257, 250, 468, -1, -1, 251, -1, 252, 341, + -1, 3, 621, 5, 256, 7, 259, 626, 10, 11, + 12, 13, 14, 262, 16, 17, 18, 19, 20, 21, + 22, -1, -1, -1, 26, 27, 28, 29, 30, 31, -1, 33, 34, 35, 36, -1, -1, -1, -1, -1, -1, 43, -1, 45, 46, 47, 48, 49, -1, 51, 52, 53, 54, 55, -1, 57, 58, -1, 60, 61, @@ -1617,8 +1602,8 @@ static const yytype_int16 yycheck[] = -1, 120 }; - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ static const yytype_int16 yystos[] = { 0, 3, 5, 7, 10, 12, 13, 14, 16, 17, @@ -1686,7 +1671,7 @@ static const yytype_int16 yystos[] = 165, 144, 8, 6, 3, 156, 6, 6, 165 }; - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int16 yyr1[] = { 0, 127, 128, 128, 129, 129, 130, 130, 130, 130, @@ -1722,12 +1707,12 @@ static const yytype_int16 yyr1[] = 251, 252, 252, 253, 253, 254, 255, 255, 256, 256, 257, 257, 258, 258, 259, 260, 260, 260, 260, 260, 260, 261, 261, 261, 262, 262, 263, 263, 264, 264, - 265, 265, 266, 266, 267, 267, 267, 267, 268, 268, + 265, 265, 266, 266, 267, 267, 267, 267, 267, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268, 268 }; - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 1, 0, 1, 2, 1, 1, 1, 1, @@ -1777,6 +1762,7 @@ enum { YYENOMEM = -2 }; #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) @@ -1844,12 +1830,19 @@ do { \ } while (0) -/* YY_LOCATION_PRINT -- Print the location on the stream. +/* YYLOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ -# ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# ifndef YYLOCATION_PRINT + +# if defined YY_LOCATION_PRINT + + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc)) + +# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ @@ -1877,15 +1870,23 @@ yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) res += YYFPRINTF (yyo, "-%d", end_col); } return res; - } +} -# define YY_LOCATION_PRINT(File, Loc) \ - yy_location_print_ (File, &(Loc)) +# define YYLOCATION_PRINT yy_location_print_ + + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc)) # else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) + +# define YYLOCATION_PRINT(File, Loc) ((void) 0) + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ +# define YY_LOCATION_PRINT YYLOCATION_PRINT + # endif -# endif /* !defined YY_LOCATION_PRINT */ +# endif /* !defined YYLOCATION_PRINT */ # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ @@ -1914,10 +1915,6 @@ yy_symbol_value_print (FILE *yyo, YY_USE (arg); if (!yyvaluep) return; -# ifdef YYPRINT - if (yykind < YYNTOKENS) - YYPRINT (yyo, yytoknum[yykind], *yyvaluep); -# endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END @@ -1935,7 +1932,7 @@ yy_symbol_print (FILE *yyo, YYFPRINTF (yyo, "%s %s (", yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); - YY_LOCATION_PRINT (yyo, *yylocationp); + YYLOCATION_PRINT (yyo, yylocationp); YYFPRINTF (yyo, ": "); yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, arg); YYFPRINTF (yyo, ")"); @@ -2352,6 +2349,7 @@ YYLTYPE yylloc = yyloc_default; YYDPRINTF ((stderr, "Starting parse\n")); yychar = YYEMPTY; /* Cause a token to be read. */ + yylsp[0] = yylloc; goto yysetstate; @@ -2378,7 +2376,7 @@ YYLTYPE yylloc = yyloc_default; if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; + YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ @@ -2409,7 +2407,7 @@ YYLTYPE yylloc = yyloc_default; # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; @@ -2420,7 +2418,7 @@ YYLTYPE yylloc = yyloc_default; YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) - goto yyexhaustedlab; + YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); YYSTACK_RELOCATE (yyls_alloc, yyls); @@ -2444,6 +2442,7 @@ YYLTYPE yylloc = yyloc_default; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + if (yystate == YYFINAL) YYACCEPT; @@ -2562,13 +2561,13 @@ YYLTYPE yylloc = yyloc_default; case 2: /* prg: ast */ #line 193 "src/gwion.y" { arg->ppa->ast = (yyval.ast) = (yyvsp[0].ast); } -#line 2566 "src/parser.c" +#line 2565 "src/parser.c" break; case 3: /* prg: %empty */ #line 194 "src/gwion.y" { loc_t loc = { {1, 1}, {1,1} }; parser_error(&loc, arg, "file is empty.", 0201); YYERROR; } -#line 2572 "src/parser.c" +#line 2571 "src/parser.c" break; case 4: /* ast: section */ @@ -2577,7 +2576,7 @@ YYLTYPE yylloc = yyloc_default; (yyval.ast) = new_mp_vector(mpool(arg), Section, 1); mp_vector_set((yyval.ast), Section, 0, (yyvsp[0].section)); } -#line 2581 "src/parser.c" +#line 2580 "src/parser.c" break; case 5: /* ast: ast section */ @@ -2586,88 +2585,97 @@ YYLTYPE yylloc = yyloc_default; mp_vector_add(mpool(arg), &((yyvsp[-1].ast)), Section, (yyvsp[0].section)); (yyval.ast) = (yyvsp[-1].ast); } -#line 2590 "src/parser.c" +#line 2589 "src/parser.c" break; case 6: /* section: stmt_list */ #line 207 "src/gwion.y" { (yyval.section) = MK_SECTION(stmt, stmt_list, (yyvsp[0].stmt_list)); } -#line 2596 "src/parser.c" +#line 2595 "src/parser.c" break; case 7: /* section: func_def */ #line 208 "src/gwion.y" - { (yyval.section) = MK_SECTION(func, func_def, (yyvsp[0].func_def)); } -#line 2602 "src/parser.c" + { + // temporarly disallow const generics in templates func + if((yyvsp[0].func_def)->base->tmpl) { + if((yyvsp[0].func_def)->base->tmpl->list->len != tmplarg_ntypes((yyvsp[0].func_def)->base->tmpl->list)) { + parser_error(&(yylsp[0]), arg, "const generics not allowed in templates (for now)", 0); + YYERROR; + } + } + (yyval.section) = MK_SECTION(func, func_def, (yyvsp[0].func_def)); + } +#line 2610 "src/parser.c" break; case 8: /* section: class_def */ -#line 209 "src/gwion.y" +#line 218 "src/gwion.y" { (yyval.section) = MK_SECTION(class, class_def, (yyvsp[0].class_def)); } -#line 2608 "src/parser.c" +#line 2616 "src/parser.c" break; case 9: /* section: trait_def */ -#line 210 "src/gwion.y" +#line 219 "src/gwion.y" { (yyval.section) = MK_SECTION(trait, trait_def, (yyvsp[0].trait_def)); } -#line 2614 "src/parser.c" +#line 2622 "src/parser.c" break; case 10: /* section: extend_def */ -#line 211 "src/gwion.y" +#line 220 "src/gwion.y" { (yyval.section) = MK_SECTION(extend, extend_def, (yyvsp[0].extend_def)); } -#line 2620 "src/parser.c" +#line 2628 "src/parser.c" break; case 11: /* section: enum_def */ -#line 212 "src/gwion.y" +#line 221 "src/gwion.y" { (yyval.section) = MK_SECTION(enum, enum_def, (yyvsp[0].enum_def)); } -#line 2626 "src/parser.c" +#line 2634 "src/parser.c" break; case 12: /* section: union_def */ -#line 213 "src/gwion.y" +#line 222 "src/gwion.y" { (yyval.section) = MK_SECTION(union, union_def, (yyvsp[0].union_def)); } -#line 2632 "src/parser.c" +#line 2640 "src/parser.c" break; case 13: /* section: fptr_def */ -#line 214 "src/gwion.y" +#line 223 "src/gwion.y" { (yyval.section) = MK_SECTION(fptr, fptr_def, (yyvsp[0].fptr_def)); } -#line 2638 "src/parser.c" +#line 2646 "src/parser.c" break; case 14: /* section: type_def */ -#line 215 "src/gwion.y" +#line 224 "src/gwion.y" { (yyval.section) = MK_SECTION(type, type_def, (yyvsp[0].type_def)); } -#line 2644 "src/parser.c" +#line 2652 "src/parser.c" break; case 15: /* section: prim_def */ -#line 216 "src/gwion.y" +#line 225 "src/gwion.y" { (yyval.section) = MK_SECTION(primitive, prim_def, (yyvsp[0].prim_def)); } -#line 2650 "src/parser.c" +#line 2658 "src/parser.c" break; case 16: /* class_flag: flag modifier */ -#line 219 "src/gwion.y" +#line 228 "src/gwion.y" { (yyval.flag) = (yyvsp[-1].flag) | (yyvsp[0].flag); } -#line 2656 "src/parser.c" +#line 2664 "src/parser.c" break; case 17: /* class_def: "class" class_flag "" decl_template class_ext traits class_body */ -#line 222 "src/gwion.y" +#line 231 "src/gwion.y" { (yyval.class_def) = new_class_def(mpool(arg), (yyvsp[-5].flag), (yyvsp[-4].sym), (yyvsp[-2].type_decl), (yyvsp[0].ast), (yylsp[-4])); if((yyvsp[-3].specialized_list)) (yyval.class_def)->base.tmpl = new_tmpl(mpool(arg), (yyvsp[-3].specialized_list)); (yyval.class_def)->traits = (yyvsp[-1].id_list); } -#line 2667 "src/parser.c" +#line 2675 "src/parser.c" break; case 18: /* class_def: "struct" class_flag "" decl_template traits class_body */ -#line 229 "src/gwion.y" +#line 238 "src/gwion.y" { (yyval.class_def) = new_class_def(mpool(arg), (yyvsp[-4].flag), (yyvsp[-3].sym), NULL, (yyvsp[0].ast), (yylsp[-3])); if((yyvsp[-2].specialized_list)) @@ -2675,118 +2683,118 @@ YYLTYPE yylloc = yyloc_default; (yyval.class_def)->cflag |= cflag_struct; (yyval.class_def)->traits = (yyvsp[-1].id_list); } -#line 2679 "src/parser.c" +#line 2687 "src/parser.c" break; case 19: /* class_body: "{" ast "}" */ -#line 237 "src/gwion.y" +#line 246 "src/gwion.y" { (yyval.ast) = (yyvsp[-1].ast); } -#line 2685 "src/parser.c" +#line 2693 "src/parser.c" break; case 20: /* class_body: "{" "}" */ -#line 237 "src/gwion.y" +#line 246 "src/gwion.y" { (yyval.ast) = NULL; } -#line 2691 "src/parser.c" +#line 2699 "src/parser.c" break; case 21: /* class_body: ";" */ -#line 237 "src/gwion.y" +#line 246 "src/gwion.y" { (yyval.ast) = NULL; } -#line 2697 "src/parser.c" +#line 2705 "src/parser.c" break; case 22: /* trait_def: "trait" opt_global "" traits class_body */ -#line 240 "src/gwion.y" +#line 249 "src/gwion.y" { (yyval.trait_def) = new_trait_def(mpool(arg), (yyvsp[-3].flag), (yyvsp[-2].sym), (yyvsp[0].ast), (yylsp[-2])); (yyval.trait_def)->traits = (yyvsp[-1].id_list); } -#line 2706 "src/parser.c" +#line 2714 "src/parser.c" break; case 23: /* number: INTEGER */ -#line 245 "src/gwion.y" +#line 254 "src/gwion.y" { if((yyvsp[0].yyint).num < 0 || (yyvsp[0].yyint).num > INTPTR_MAX) { parser_error(&(yylsp[0]), arg, "number too big", 0); YYERROR; } (yyval.gwint) = GWINT((yyvsp[0].yyint).num, (yyvsp[0].yyint).int_type); } -#line 2717 "src/parser.c" +#line 2725 "src/parser.c" break; case 24: /* decimal: number */ -#line 252 "src/gwion.y" +#line 261 "src/gwion.y" { if((yyvsp[0].gwint).int_type != gwint_decimal) { parser_error(&(yylsp[0]), arg, "only decimals accepted here", 0); YYERROR; } (yyval.gwint) = (yyvsp[0].gwint); } -#line 2728 "src/parser.c" +#line 2736 "src/parser.c" break; case 25: /* prim_def: "primitive" class_flag "" decimal ";" */ -#line 260 "src/gwion.y" +#line 269 "src/gwion.y" { (yyval.prim_def) = new_prim_def(mpool(arg), (yyvsp[-2].sym), (yyvsp[-1].gwint).num, (yylsp[-2]), (yyvsp[-3].flag)); } -#line 2736 "src/parser.c" +#line 2744 "src/parser.c" break; case 26: /* class_ext: "extends" type_decl_exp */ -#line 263 "src/gwion.y" +#line 272 "src/gwion.y" { (yyval.type_decl) = (yyvsp[0].type_decl); } -#line 2742 "src/parser.c" +#line 2750 "src/parser.c" break; case 27: /* class_ext: %empty */ -#line 263 "src/gwion.y" +#line 272 "src/gwion.y" { (yyval.type_decl) = NULL; } -#line 2748 "src/parser.c" +#line 2756 "src/parser.c" break; case 28: /* traits: %empty */ -#line 264 "src/gwion.y" +#line 273 "src/gwion.y" { (yyval.id_list) = NULL; } -#line 2754 "src/parser.c" +#line 2762 "src/parser.c" break; case 29: /* traits: ":" id_list */ -#line 264 "src/gwion.y" +#line 273 "src/gwion.y" { (yyval.id_list) = (yyvsp[0].id_list); } -#line 2760 "src/parser.c" +#line 2768 "src/parser.c" break; case 30: /* extend_def: "extends" type_decl_empty ":" id_list ";" */ -#line 266 "src/gwion.y" +#line 275 "src/gwion.y" { (yyval.extend_def) = new_extend_def(mpool(arg), (yyvsp[-3].type_decl), (yyvsp[-1].id_list)); } -#line 2768 "src/parser.c" +#line 2776 "src/parser.c" break; case 31: /* id_list: "" */ -#line 272 "src/gwion.y" +#line 281 "src/gwion.y" { (yyval.id_list) = new_mp_vector(mpool(arg), Symbol, 1); mp_vector_set((yyval.id_list), Symbol, 0, (yyvsp[0].sym)); } -#line 2777 "src/parser.c" +#line 2785 "src/parser.c" break; case 32: /* id_list: id_list "," "" */ -#line 277 "src/gwion.y" +#line 286 "src/gwion.y" { mp_vector_add(mpool(arg), &(yyvsp[-2].id_list), Symbol, (yyvsp[0].sym)); (yyval.id_list) = (yyvsp[-2].id_list); } -#line 2786 "src/parser.c" +#line 2794 "src/parser.c" break; case 33: /* specialized: "" traits */ -#line 282 "src/gwion.y" +#line 291 "src/gwion.y" { (yyval.specialized) = (Specialized) { .xid = (yyvsp[-1].sym), @@ -2794,11 +2802,11 @@ YYLTYPE yylloc = yyloc_default; .pos = (yylsp[-1]) }; } -#line 2798 "src/parser.c" +#line 2806 "src/parser.c" break; case 34: /* specialized: "const" type_decl_empty "" */ -#line 289 "src/gwion.y" +#line 298 "src/gwion.y" { (yyval.specialized) = (Specialized) { .xid = (yyvsp[0].sym), @@ -2806,119 +2814,119 @@ YYLTYPE yylloc = yyloc_default; .pos = (yylsp[-1]) }; } -#line 2810 "src/parser.c" +#line 2818 "src/parser.c" break; case 35: /* specialized_list: specialized */ -#line 297 "src/gwion.y" +#line 306 "src/gwion.y" { (yyval.specialized_list) = new_mp_vector(mpool(arg), Specialized, 1); mp_vector_set((yyval.specialized_list), Specialized, 0, (yyvsp[0].specialized)); } -#line 2819 "src/parser.c" +#line 2827 "src/parser.c" break; case 36: /* specialized_list: specialized_list "," specialized */ -#line 301 "src/gwion.y" +#line 310 "src/gwion.y" { mp_vector_add(mpool(arg), &(yyvsp[-2].specialized_list), Specialized, (yyvsp[0].specialized)); (yyval.specialized_list) = (yyvsp[-2].specialized_list); } -#line 2828 "src/parser.c" +#line 2836 "src/parser.c" break; case 37: /* stmt_list: stmt */ -#line 306 "src/gwion.y" +#line 315 "src/gwion.y" { (yyval.stmt_list) = new_mp_vector(mpool(arg), struct Stmt_, 1); mp_vector_set((yyval.stmt_list), struct Stmt_, 0, (yyvsp[0].stmt)); } -#line 2837 "src/parser.c" +#line 2845 "src/parser.c" break; case 38: /* stmt_list: stmt_list stmt */ -#line 310 "src/gwion.y" +#line 319 "src/gwion.y" { mp_vector_add(mpool(arg), &(yyvsp[-1].stmt_list), struct Stmt_, (yyvsp[0].stmt)); (yyval.stmt_list) = (yyvsp[-1].stmt_list); } -#line 2846 "src/parser.c" +#line 2854 "src/parser.c" break; case 39: /* fptr_base: flag type_decl_empty "" decl_template */ -#line 315 "src/gwion.y" +#line 324 "src/gwion.y" { (yyval.func_base) = new_func_base(mpool(arg), (yyvsp[-2].type_decl), (yyvsp[-1].sym), NULL, (yyvsp[-3].flag), (yylsp[-2])); if((yyvsp[0].specialized_list)) { (yyval.func_base)->tmpl = new_tmpl(mpool(arg), (yyvsp[0].specialized_list)); } } -#line 2853 "src/parser.c" +#line 2861 "src/parser.c" break; case 40: /* _func_effects: "perform" "" */ -#line 318 "src/gwion.y" +#line 327 "src/gwion.y" { vector_init(&(yyval.vector)); vector_add(&(yyval.vector), (m_uint)(yyvsp[0].sym)); } -#line 2859 "src/parser.c" +#line 2867 "src/parser.c" break; case 41: /* _func_effects: _func_effects "" */ -#line 318 "src/gwion.y" +#line 327 "src/gwion.y" { vector_add(&(yyval.vector), (m_uint)(yyvsp[0].sym)); } -#line 2865 "src/parser.c" +#line 2873 "src/parser.c" break; case 42: /* func_effects: %empty */ -#line 319 "src/gwion.y" +#line 328 "src/gwion.y" { (yyval.vector).ptr = NULL; } -#line 2871 "src/parser.c" +#line 2879 "src/parser.c" break; case 43: /* func_effects: _func_effects */ -#line 319 "src/gwion.y" +#line 328 "src/gwion.y" { (yyval.vector).ptr = (yyvsp[0].vector).ptr; } -#line 2877 "src/parser.c" +#line 2885 "src/parser.c" break; case 44: /* func_base: flag final type_decl_empty "" decl_template */ -#line 321 "src/gwion.y" +#line 330 "src/gwion.y" { (yyval.func_base) = new_func_base(mpool(arg), (yyvsp[-2].type_decl), (yyvsp[-1].sym), NULL, (yyvsp[-4].flag) | (yyvsp[-3].flag), (yylsp[-1])); if((yyvsp[0].specialized_list)) { (yyval.func_base)->tmpl = new_tmpl(mpool(arg), (yyvsp[0].specialized_list)); } } -#line 2884 "src/parser.c" +#line 2892 "src/parser.c" break; case 45: /* fptr_def: "funptr" fptr_base fptr_args func_effects ";" */ -#line 324 "src/gwion.y" +#line 333 "src/gwion.y" { (yyvsp[-3].func_base)->args = (yyvsp[-2].arg_list); (yyval.fptr_def) = new_fptr_def(mpool(arg), (yyvsp[-3].func_base)); (yyval.fptr_def)->base->effects.ptr = (yyvsp[-1].vector).ptr; } -#line 2894 "src/parser.c" +#line 2902 "src/parser.c" break; case 46: /* typedef_when: %empty */ -#line 330 "src/gwion.y" +#line 339 "src/gwion.y" { (yyval.exp) = NULL;} -#line 2900 "src/parser.c" +#line 2908 "src/parser.c" break; case 47: /* typedef_when: "when" binary_exp */ -#line 330 "src/gwion.y" +#line 339 "src/gwion.y" { (yyval.exp) = (yyvsp[0].exp); } -#line 2906 "src/parser.c" +#line 2914 "src/parser.c" break; case 48: /* type_def_type: "typedef" */ -#line 331 "src/gwion.y" +#line 340 "src/gwion.y" { (yyval.yybool) = false; } -#line 2912 "src/parser.c" +#line 2920 "src/parser.c" break; case 49: /* type_def_type: "distinct" */ -#line 331 "src/gwion.y" +#line 340 "src/gwion.y" { (yyval.yybool) = true; } -#line 2918 "src/parser.c" +#line 2926 "src/parser.c" break; case 50: /* type_def: type_def_type flag type_decl_array "" decl_template typedef_when ";" */ -#line 332 "src/gwion.y" +#line 341 "src/gwion.y" { (yyval.type_def) = new_type_def(mpool(arg), (yyvsp[-4].type_decl), (yyvsp[-3].sym), (yylsp[-3])); (yyvsp[-4].type_decl)->flag |= (yyvsp[-5].flag); @@ -2927,61 +2935,61 @@ YYLTYPE yylloc = yyloc_default; (yyval.type_def)->tmpl = new_tmpl(mpool(arg), (yyvsp[-2].specialized_list)); (yyval.type_def)->distinct = (yyvsp[-6].yybool); } -#line 2931 "src/parser.c" +#line 2939 "src/parser.c" break; case 51: /* type_decl_array: type_decl array */ -#line 341 "src/gwion.y" +#line 350 "src/gwion.y" { (yyvsp[-1].type_decl)->array = (yyvsp[0].array_sub); } -#line 2937 "src/parser.c" +#line 2945 "src/parser.c" break; case 53: /* type_decl_exp: type_decl_array */ -#line 343 "src/gwion.y" +#line 352 "src/gwion.y" { if((yyvsp[0].type_decl)->array && !(yyvsp[0].type_decl)->array->exp) { parser_error(&(yyloc), arg, "can't instantiate with empty `[]`", 0203); YYERROR;} (yyval.type_decl) = (yyvsp[0].type_decl); } -#line 2945 "src/parser.c" +#line 2953 "src/parser.c" break; case 54: /* type_decl_empty: type_decl_array */ -#line 347 "src/gwion.y" +#line 356 "src/gwion.y" { if((yyvsp[0].type_decl)->array && (yyvsp[0].type_decl)->array->exp) { parser_error(&(yyloc), arg, "type must be defined with empty []'s", 0204); YYERROR;} (yyval.type_decl) = (yyvsp[0].type_decl); } -#line 2953 "src/parser.c" +#line 2961 "src/parser.c" break; case 55: /* arg: type_decl_empty arg_decl ":" binary_exp */ -#line 352 "src/gwion.y" +#line 361 "src/gwion.y" { (yyval.default_args).arg = (Arg) { .td = (yyvsp[-3].type_decl), .var_decl = (yyvsp[-2].var_decl), .exp = (yyvsp[0].exp) }; (yyval.default_args).flag = fbflag_default; } -#line 2962 "src/parser.c" +#line 2970 "src/parser.c" break; case 56: /* arg: type_decl_empty arg_decl */ -#line 356 "src/gwion.y" +#line 365 "src/gwion.y" { (yyval.default_args).arg = (Arg) { .td = (yyvsp[-1].type_decl), .var_decl = (yyvsp[0].var_decl)}; (yyval.default_args).flag = fbflag_none; } -#line 2971 "src/parser.c" +#line 2979 "src/parser.c" break; case 57: /* arg_list: arg */ -#line 361 "src/gwion.y" +#line 370 "src/gwion.y" { (yyval.default_args).args = new_mp_vector(mpool(arg), Arg, 1); mp_vector_set((yyval.default_args).args, Arg, 0, (yyvsp[0].default_args).arg); (yyval.default_args).flag = (yyvsp[0].default_args).flag; } -#line 2981 "src/parser.c" +#line 2989 "src/parser.c" break; case 58: /* arg_list: arg_list "," arg */ -#line 366 "src/gwion.y" +#line 375 "src/gwion.y" { if((yyvsp[-2].default_args).flag == fbflag_default && !(yyvsp[0].default_args).arg.exp) { parser_error(&(yylsp[0]), arg, "missing default argument", 0205); YYERROR;} @@ -2989,11 +2997,11 @@ YYLTYPE yylloc = yyloc_default; mp_vector_add(mpool(arg), &(yyvsp[-2].default_args).args, Arg, (yyvsp[0].default_args).arg); (yyval.default_args) = (yyvsp[-2].default_args); } -#line 2993 "src/parser.c" +#line 3001 "src/parser.c" break; case 59: /* locale_arg: arg */ -#line 375 "src/gwion.y" +#line 384 "src/gwion.y" { (yyval.default_args).args = new_mp_vector(mpool(arg), Arg, 2); Arg self = { @@ -3005,11 +3013,11 @@ YYLTYPE yylloc = yyloc_default; mp_vector_set((yyval.default_args).args, Arg, 1, (yyvsp[0].default_args).arg); (yyval.default_args).flag = (yyvsp[0].default_args).flag; } -#line 3009 "src/parser.c" +#line 3017 "src/parser.c" break; case 60: /* locale_arg: locale_arg "," arg */ -#line 386 "src/gwion.y" +#line 395 "src/gwion.y" { if((yyvsp[-2].default_args).flag == fbflag_default && !(yyvsp[0].default_args).arg.exp) { parser_error(&(yylsp[0]), arg, "missing default argument", 0205); YYERROR;} @@ -3017,11 +3025,11 @@ YYLTYPE yylloc = yyloc_default; mp_vector_add(mpool(arg), &(yyvsp[-2].default_args).args, Arg, (yyvsp[0].default_args).arg); (yyval.default_args) = (yyvsp[-2].default_args); } -#line 3021 "src/parser.c" +#line 3029 "src/parser.c" break; case 62: /* locale_list: %empty */ -#line 395 "src/gwion.y" +#line 404 "src/gwion.y" { Arg self = { .td = new_type_decl(mpool(arg), insert_symbol("string"), (yyloc)), @@ -3031,147 +3039,147 @@ YYLTYPE yylloc = yyloc_default; (yyval.default_args).args = new_mp_vector(mpool(arg), Arg, 1); mp_vector_set((yyval.default_args).args, Arg, 0, self); } -#line 3035 "src/parser.c" +#line 3043 "src/parser.c" break; case 63: /* fptr_arg: type_decl_empty fptr_arg_decl */ -#line 405 "src/gwion.y" +#line 414 "src/gwion.y" { (yyval.arg) = (Arg) { .td = (yyvsp[-1].type_decl), .var_decl = (yyvsp[0].var_decl) }; } -#line 3041 "src/parser.c" +#line 3049 "src/parser.c" break; case 64: /* fptr_list: fptr_arg */ -#line 407 "src/gwion.y" +#line 416 "src/gwion.y" { (yyval.arg_list) = new_mp_vector(mpool(arg), Arg, 1); mp_vector_set((yyval.arg_list), Arg, 0, (yyvsp[0].arg)); } -#line 3050 "src/parser.c" +#line 3058 "src/parser.c" break; case 65: /* fptr_list: fptr_list "," fptr_arg */ -#line 411 "src/gwion.y" +#line 420 "src/gwion.y" { mp_vector_add(mpool(arg), &(yyvsp[-2].arg_list), Arg, (yyvsp[0].arg)); (yyval.arg_list) = (yyvsp[-2].arg_list); } -#line 3059 "src/parser.c" +#line 3067 "src/parser.c" break; case 66: /* code_stmt: "{" "}" */ -#line 417 "src/gwion.y" +#line 426 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_code, .pos = (yyloc)}; } -#line 3066 "src/parser.c" +#line 3074 "src/parser.c" break; case 67: /* code_stmt: "{" stmt_list "}" */ -#line 419 "src/gwion.y" +#line 428 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_code, .d = { .stmt_code = { .stmt_list = (yyvsp[-1].stmt_list) }}, .pos = (yyloc)}; } -#line 3073 "src/parser.c" +#line 3081 "src/parser.c" break; case 68: /* code_list: "{" "}" */ -#line 423 "src/gwion.y" +#line 432 "src/gwion.y" { (yyval.stmt_list) = new_mp_vector(mpool(arg), struct Stmt_, 0); } -#line 3079 "src/parser.c" +#line 3087 "src/parser.c" break; case 69: /* code_list: "{" stmt_list "}" */ -#line 424 "src/gwion.y" +#line 433 "src/gwion.y" { (yyval.stmt_list) = (yyvsp[-1].stmt_list); } -#line 3085 "src/parser.c" +#line 3093 "src/parser.c" break; case 70: /* stmt_pp: "" */ -#line 427 "src/gwion.y" +#line 436 "src/gwion.y" { /*if(!arg->ppa->fmt)return 0; */(yyval.stmt) = MK_STMT_PP(comment, (yyvsp[0].sval), (yyloc)); } -#line 3091 "src/parser.c" +#line 3099 "src/parser.c" break; case 71: /* stmt_pp: "#include" */ -#line 428 "src/gwion.y" +#line 437 "src/gwion.y" { (yyval.stmt) = MK_STMT_PP(include, (yyvsp[0].sval), (yyloc)); } -#line 3097 "src/parser.c" +#line 3105 "src/parser.c" break; case 72: /* stmt_pp: "#define" */ -#line 429 "src/gwion.y" +#line 438 "src/gwion.y" { (yyval.stmt) = MK_STMT_PP(define, (yyvsp[0].sval), (yyloc)); } -#line 3103 "src/parser.c" +#line 3111 "src/parser.c" break; case 73: /* stmt_pp: "#pragma" */ -#line 430 "src/gwion.y" +#line 439 "src/gwion.y" { (yyval.stmt) = MK_STMT_PP(pragma, (yyvsp[0].sval), (yyloc)); } -#line 3109 "src/parser.c" +#line 3117 "src/parser.c" break; case 74: /* stmt_pp: "#undef" */ -#line 431 "src/gwion.y" +#line 440 "src/gwion.y" { (yyval.stmt) = MK_STMT_PP(undef, (yyvsp[0].sval), (yyloc)); } -#line 3115 "src/parser.c" +#line 3123 "src/parser.c" break; case 75: /* stmt_pp: "#ifdef" */ -#line 432 "src/gwion.y" +#line 441 "src/gwion.y" { (yyval.stmt) = MK_STMT_PP(ifdef, (yyvsp[0].sval), (yyloc)); } -#line 3121 "src/parser.c" +#line 3129 "src/parser.c" break; case 76: /* stmt_pp: "#ifndef" */ -#line 433 "src/gwion.y" +#line 442 "src/gwion.y" { (yyval.stmt) = MK_STMT_PP(ifndef, (yyvsp[0].sval), (yyloc)); } -#line 3127 "src/parser.c" +#line 3135 "src/parser.c" break; case 77: /* stmt_pp: "#else" */ -#line 434 "src/gwion.y" +#line 443 "src/gwion.y" { (yyval.stmt) = MK_STMT_PP(else, (yyvsp[0].sval), (yyloc)); } -#line 3133 "src/parser.c" +#line 3141 "src/parser.c" break; case 78: /* stmt_pp: "#if" */ -#line 435 "src/gwion.y" +#line 444 "src/gwion.y" { (yyval.stmt) = MK_STMT_PP(endif, (yyvsp[0].sval), (yyloc)); } -#line 3139 "src/parser.c" +#line 3147 "src/parser.c" break; case 79: /* stmt_pp: "\n" */ -#line 436 "src/gwion.y" +#line 445 "src/gwion.y" { if(!arg->ppa->fmt)return 0; (yyval.stmt) = MK_STMT_PP(nl, (yyvsp[0].sval), (yyloc)); } -#line 3145 "src/parser.c" +#line 3153 "src/parser.c" break; case 80: /* stmt_pp: "import" */ -#line 437 "src/gwion.y" +#line 446 "src/gwion.y" { (yyval.stmt) = MK_STMT_PP(import, (yyvsp[0].sval), (yyloc)); } -#line 3151 "src/parser.c" +#line 3159 "src/parser.c" break; case 81: /* stmt_pp: LOCALE_INI "" exp LOCALE_END */ -#line 438 "src/gwion.y" +#line 447 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_pp, .d = { .stmt_pp = { .exp = (yyvsp[-1].exp), .xid = (yyvsp[-2].sym), .pp_type = ae_pp_locale, }}, .pos = (yylsp[-3]) }; } -#line 3158 "src/parser.c" +#line 3166 "src/parser.c" break; case 82: /* stmt_pp: LOCALE_INI "" LOCALE_END */ -#line 440 "src/gwion.y" +#line 449 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_pp, .d = { .stmt_pp = { .xid = (yyvsp[-1].sym), .pp_type = ae_pp_locale, }}, .pos = (yylsp[-2]) }; } -#line 3165 "src/parser.c" +#line 3173 "src/parser.c" break; case 94: /* $@1: %empty */ -#line 457 "src/gwion.y" +#line 466 "src/gwion.y" {lex_spread(((Scanner*)scan));} -#line 3171 "src/parser.c" +#line 3179 "src/parser.c" break; case 95: /* spread_stmt: "..." "" ":" id_list "{" $@1 "}..." */ -#line 457 "src/gwion.y" +#line 466 "src/gwion.y" { struct Spread_Def_ spread = { .xid = (yyvsp[-5].sym), @@ -3181,43 +3189,43 @@ YYLTYPE yylloc = yyloc_default; }; (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_spread, .d = { .stmt_spread = spread }, .pos = (yylsp[-5])}; } -#line 3185 "src/parser.c" +#line 3193 "src/parser.c" break; case 96: /* retry_stmt: "retry" ";" */ -#line 467 "src/gwion.y" +#line 476 "src/gwion.y" { if(!arg->handling) { parser_error(&(yylsp[-1]), arg, "`retry` outside of `handle` block", 0); YYERROR; } (yyval.stmt) = (struct Stmt_){ .stmt_type=ae_stmt_retry, .pos=(yylsp[-1])}; } -#line 3195 "src/parser.c" +#line 3203 "src/parser.c" break; case 97: /* $@2: %empty */ -#line 472 "src/gwion.y" +#line 481 "src/gwion.y" { arg->handling = true; } -#line 3201 "src/parser.c" +#line 3209 "src/parser.c" break; case 98: /* handler: "handle" $@2 opt_id stmt */ -#line 472 "src/gwion.y" +#line 481 "src/gwion.y" { (yyval.handler) = (Handler){ .xid = (yyvsp[-1].sym), .stmt = cpy_stmt3(mpool(arg), &(yyvsp[0].stmt)), .pos = (yyvsp[-1].sym) ? (yylsp[-1]) :(yylsp[-3])}; arg->handling = false; } -#line 3207 "src/parser.c" +#line 3215 "src/parser.c" break; case 99: /* handler_list: handler */ -#line 473 "src/gwion.y" +#line 482 "src/gwion.y" { (yyval.handler_list).handlers = new_mp_vector(mpool(arg), Handler, 1); mp_vector_set((yyval.handler_list).handlers, Handler, 0, (yyvsp[0].handler)); (yyval.handler_list).has_xid = !!(yyvsp[0].handler).xid; } -#line 3217 "src/parser.c" +#line 3225 "src/parser.c" break; case 100: /* handler_list: handler_list handler */ -#line 478 "src/gwion.y" +#line 487 "src/gwion.y" { if(!(yyvsp[-1].handler_list).has_xid) { parser_error(&(yylsp[0]), arg, "`handle` after a catch-all block", 0); YYERROR; } @@ -3234,88 +3242,88 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] (yyval.handler_list) = (yyvsp[-1].handler_list); // $1->next = $2; } -#line 3238 "src/parser.c" +#line 3246 "src/parser.c" break; case 101: /* try_stmt: "try" stmt handler_list */ -#line 494 "src/gwion.y" +#line 503 "src/gwion.y" { (yyval.stmt) = (struct Stmt_){ .stmt_type = ae_stmt_try, .d = { .stmt_try = { .stmt = cpy_stmt3(mpool(arg), &(yyvsp[-1].stmt)), .handler = (yyvsp[0].handler_list).handlers, }}, .pos = (yylsp[-2])}; } -#line 3247 "src/parser.c" +#line 3255 "src/parser.c" break; case 103: /* opt_id: %empty */ -#line 499 "src/gwion.y" +#line 508 "src/gwion.y" { (yyval.sym) = NULL; } -#line 3253 "src/parser.c" +#line 3261 "src/parser.c" break; case 105: /* opt_comma: %empty */ -#line 500 "src/gwion.y" +#line 509 "src/gwion.y" {} -#line 3259 "src/parser.c" +#line 3267 "src/parser.c" break; case 106: /* enum_value: "" */ -#line 503 "src/gwion.y" +#line 512 "src/gwion.y" { (yyval.enum_value) = (EnumValue) { .xid = (yyvsp[0].sym) }; } -#line 3265 "src/parser.c" +#line 3273 "src/parser.c" break; case 107: /* enum_value: number "" "" */ -#line 504 "src/gwion.y" +#line 513 "src/gwion.y" { if (strcmp(s_name((yyvsp[-1].sym)), ":=>")) { parser_error(&(yylsp[-2]), arg, "enum value must be set with :=>", 0x0240); YYERROR; } (yyval.enum_value) = (EnumValue) {.xid = (yyvsp[0].sym), .gwint = (yyvsp[-2].gwint), .set = true }; } -#line 3276 "src/parser.c" +#line 3284 "src/parser.c" break; case 108: /* enum_list: enum_value */ -#line 511 "src/gwion.y" +#line 520 "src/gwion.y" { (yyval.enum_list) = new_mp_vector(mpool(arg), EnumValue, 1); mp_vector_set((yyval.enum_list), EnumValue, 0, (yyvsp[0].enum_value)); } -#line 3285 "src/parser.c" +#line 3293 "src/parser.c" break; case 109: /* enum_list: enum_list "," enum_value */ -#line 516 "src/gwion.y" +#line 525 "src/gwion.y" { mp_vector_add(mpool(arg), &(yyvsp[-2].enum_list), EnumValue, (yyvsp[0].enum_value)); (yyval.enum_list) = (yyvsp[-2].enum_list); } -#line 3294 "src/parser.c" +#line 3302 "src/parser.c" break; case 110: /* enum_def: "enum" flag "" "{" enum_list opt_comma "}" */ -#line 521 "src/gwion.y" +#line 530 "src/gwion.y" { (yyval.enum_def) = new_enum_def(mpool(arg), (yyvsp[-2].enum_list), (yyvsp[-4].sym), (yyloc)); (yyval.enum_def)->flag = (yyvsp[-5].flag); } -#line 3303 "src/parser.c" +#line 3311 "src/parser.c" break; case 111: /* when_exp: "when" exp */ -#line 526 "src/gwion.y" +#line 535 "src/gwion.y" { (yyval.exp) = (yyvsp[0].exp); } -#line 3309 "src/parser.c" +#line 3317 "src/parser.c" break; case 112: /* when_exp: %empty */ -#line 526 "src/gwion.y" +#line 535 "src/gwion.y" { (yyval.exp) = NULL; } -#line 3315 "src/parser.c" +#line 3323 "src/parser.c" break; case 113: /* match_case_stmt: "case" exp when_exp ":" stmt_list */ -#line 529 "src/gwion.y" +#line 538 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = 0,//ae_stmt_match, // ???? @@ -3327,29 +3335,29 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] .pos = (yylsp[-4]) }; } -#line 3331 "src/parser.c" +#line 3339 "src/parser.c" break; case 114: /* match_list: match_case_stmt */ -#line 541 "src/gwion.y" +#line 550 "src/gwion.y" { (yyval.stmt_list) = new_mp_vector(mpool(arg), struct Stmt_, 1); mp_vector_set((yyval.stmt_list), struct Stmt_, 0, (yyvsp[0].stmt)); } -#line 3340 "src/parser.c" +#line 3348 "src/parser.c" break; case 115: /* match_list: match_list match_case_stmt */ -#line 545 "src/gwion.y" +#line 554 "src/gwion.y" { mp_vector_add(mpool(arg), &((yyvsp[-1].stmt_list)), struct Stmt_, (yyvsp[0].stmt)); (yyval.stmt_list) = (yyvsp[-1].stmt_list); } -#line 3349 "src/parser.c" +#line 3357 "src/parser.c" break; case 116: /* match_stmt: "match" exp "{" match_list "}" "where" stmt */ -#line 550 "src/gwion.y" +#line 559 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_match, .d = { .stmt_match = { @@ -3360,11 +3368,11 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] .pos = (yylsp[-6]) }; } -#line 3364 "src/parser.c" +#line 3372 "src/parser.c" break; case 117: /* match_stmt: "match" exp "{" match_list "}" */ -#line 561 "src/gwion.y" +#line 570 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_match, .d = { .stmt_match = { @@ -3374,23 +3382,23 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] .pos = (yylsp[-4]) }; } -#line 3378 "src/parser.c" +#line 3386 "src/parser.c" break; case 118: /* flow: "while" */ -#line 572 "src/gwion.y" +#line 581 "src/gwion.y" { (yyval.stmt_t) = ae_stmt_while; } -#line 3384 "src/parser.c" +#line 3392 "src/parser.c" break; case 119: /* flow: "until" */ -#line 573 "src/gwion.y" +#line 582 "src/gwion.y" { (yyval.stmt_t) = ae_stmt_until; } -#line 3390 "src/parser.c" +#line 3398 "src/parser.c" break; case 120: /* loop_stmt: flow "(" exp ")" stmt */ -#line 578 "src/gwion.y" +#line 587 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = (yyvsp[-4].stmt_t), .d = { .stmt_flow = { .cond = (yyvsp[-2].exp), @@ -3399,11 +3407,11 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] .pos = (yylsp[-4]) }; } -#line 3403 "src/parser.c" +#line 3411 "src/parser.c" break; case 121: /* loop_stmt: "do" stmt flow exp ";" */ -#line 587 "src/gwion.y" +#line 596 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = (yyvsp[-2].stmt_t), .d = { .stmt_flow = { .cond = (yyvsp[-1].exp), @@ -3413,11 +3421,11 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] .pos = (yylsp[-4]) }; } -#line 3417 "src/parser.c" +#line 3425 "src/parser.c" break; case 122: /* loop_stmt: "for" "(" exp_stmt exp_stmt ")" stmt */ -#line 597 "src/gwion.y" +#line 606 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_for, .d = { .stmt_for = { .c1 = cpy_stmt3(mpool(arg), &(yyvsp[-3].stmt)), @@ -3427,11 +3435,11 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] .pos = (yylsp[-5]) }; } -#line 3431 "src/parser.c" +#line 3439 "src/parser.c" break; case 123: /* loop_stmt: "for" "(" exp_stmt exp_stmt exp ")" stmt */ -#line 607 "src/gwion.y" +#line 616 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_for, .d = { .stmt_for = { .c1 = cpy_stmt3(mpool(arg), &(yyvsp[-4].stmt)), @@ -3442,11 +3450,11 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] .pos = (yylsp[-6]) }; } -#line 3446 "src/parser.c" +#line 3454 "src/parser.c" break; case 124: /* loop_stmt: "foreach" "(" "" ":" opt_var binary_exp ")" stmt */ -#line 618 "src/gwion.y" +#line 627 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_each, .d = { .stmt_each = { .sym = (yyvsp[-5].sym), @@ -3459,11 +3467,11 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] // what to do with opt_var? // list rem? } -#line 3463 "src/parser.c" +#line 3471 "src/parser.c" break; case 125: /* loop_stmt: "foreach" "(" "" "," "" ":" opt_var binary_exp ")" stmt */ -#line 631 "src/gwion.y" +#line 640 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_each, .d = { .stmt_each = { .sym = (yyvsp[-5].sym), @@ -3481,11 +3489,11 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] // what to do with opt_var? // list rem? } -#line 3485 "src/parser.c" +#line 3493 "src/parser.c" break; case 126: /* loop_stmt: "repeat" "(" binary_exp ")" stmt */ -#line 649 "src/gwion.y" +#line 658 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_loop, . d = { .stmt_loop = { .cond = (yyvsp[-2].exp), @@ -3494,11 +3502,11 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] .pos = (yylsp[-4]) }; } -#line 3498 "src/parser.c" +#line 3506 "src/parser.c" break; case 127: /* loop_stmt: "repeat" "(" "" "," binary_exp ")" stmt */ -#line 658 "src/gwion.y" +#line 667 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_loop, . d = { .stmt_loop = { .cond = (yyvsp[-2].exp), @@ -3511,11 +3519,11 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] (yyval.stmt).d.stmt_loop.idx->pos = (yylsp[-4]); (yyval.stmt).d.stmt_loop.idx->v = NULL; } -#line 3515 "src/parser.c" +#line 3523 "src/parser.c" break; case 128: /* defer_stmt: "defer" stmt */ -#line 671 "src/gwion.y" +#line 680 "src/gwion.y" { const loc_t loc = defer_stmt(&(yyvsp[0].stmt)); if(loc.first.line) { @@ -3528,11 +3536,11 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] .pos = (yylsp[-1]) }; } -#line 3532 "src/parser.c" +#line 3540 "src/parser.c" break; case 129: /* selection_stmt: "if" "(" exp ")" stmt */ -#line 686 "src/gwion.y" +#line 695 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_if, .d = { .stmt_if = { .cond = (yyvsp[-2].exp), @@ -3541,11 +3549,11 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] .pos = (yylsp[-4]) }; } -#line 3545 "src/parser.c" +#line 3553 "src/parser.c" break; case 130: /* selection_stmt: "if" "(" exp ")" stmt "else" stmt */ -#line 695 "src/gwion.y" +#line 704 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_if, .d = { .stmt_if = { .cond = (yyvsp[-4].exp), @@ -3555,86 +3563,86 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] .pos = (yylsp[-6]) }; } -#line 3559 "src/parser.c" +#line 3567 "src/parser.c" break; case 131: /* breaks: "break" */ -#line 705 "src/gwion.y" +#line 714 "src/gwion.y" { (yyval.stmt_t) = ae_stmt_break; } -#line 3565 "src/parser.c" +#line 3573 "src/parser.c" break; case 132: /* breaks: "continue" */ -#line 705 "src/gwion.y" +#line 714 "src/gwion.y" { (yyval.stmt_t) = ae_stmt_continue; } -#line 3571 "src/parser.c" +#line 3579 "src/parser.c" break; case 133: /* jump_stmt: "return" exp ";" */ -#line 707 "src/gwion.y" +#line 716 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_return, .d = { .stmt_exp = { .val = (yyvsp[-1].exp) }}, .pos = (yylsp[-2]) }; } -#line 3581 "src/parser.c" +#line 3589 "src/parser.c" break; case 134: /* jump_stmt: "return" ";" */ -#line 712 "src/gwion.y" +#line 721 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_return, .pos = (yylsp[-1]) }; } -#line 3590 "src/parser.c" +#line 3598 "src/parser.c" break; case 135: /* jump_stmt: breaks decimal ";" */ -#line 716 "src/gwion.y" +#line 725 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = (yyvsp[-2].stmt_t), .d = { .stmt_index = { .idx = (yyvsp[-1].gwint).num }}, .pos = (yylsp[-2]) }; } -#line 3600 "src/parser.c" +#line 3608 "src/parser.c" break; case 136: /* jump_stmt: breaks ";" */ -#line 721 "src/gwion.y" +#line 730 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = (yyvsp[-1].stmt_t), .d = { .stmt_index = { .idx = -1 }}, .pos = (yylsp[-1]) }; } -#line 3609 "src/parser.c" +#line 3617 "src/parser.c" break; case 137: /* exp_stmt: exp ";" */ -#line 727 "src/gwion.y" +#line 736 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_exp, .d = { .stmt_exp = { .val = (yyvsp[-1].exp) }}, .pos = (yylsp[-1]) }; } -#line 3619 "src/parser.c" +#line 3627 "src/parser.c" break; case 138: /* exp_stmt: ";" */ -#line 732 "src/gwion.y" +#line 741 "src/gwion.y" { (yyval.stmt) = (struct Stmt_) { .stmt_type = ae_stmt_exp, .pos = (yylsp[0]) }; } -#line 3628 "src/parser.c" +#line 3636 "src/parser.c" break; case 139: /* exp: binary_exp */ -#line 738 "src/gwion.y" +#line 747 "src/gwion.y" { (yyval.exp) = (yyvsp[0].exp); } -#line 3634 "src/parser.c" +#line 3642 "src/parser.c" break; case 140: /* exp: binary_exp "," exp */ -#line 740 "src/gwion.y" +#line 749 "src/gwion.y" { if((yyvsp[-2].exp)->next) { parser_error(&(yylsp[0]), arg, "invalid format for expression", 0); @@ -3642,264 +3650,264 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] } (yyvsp[-2].exp)->next = (yyvsp[0].exp); } -#line 3646 "src/parser.c" +#line 3654 "src/parser.c" break; case 142: /* binary_exp: binary_exp "@" decl_exp */ -#line 751 "src/gwion.y" +#line 760 "src/gwion.y" { (yyval.exp) = new_exp_binary(mpool(arg), (yyvsp[-2].exp), (yyvsp[-1].sym), (yyvsp[0].exp), (yylsp[-1])); } -#line 3652 "src/parser.c" +#line 3660 "src/parser.c" break; case 143: /* binary_exp: binary_exp "" decl_exp */ -#line 752 "src/gwion.y" +#line 761 "src/gwion.y" { (yyval.exp) = new_exp_binary(mpool(arg), (yyvsp[-2].exp), (yyvsp[-1].sym), (yyvsp[0].exp), (yylsp[-1])); } -#line 3658 "src/parser.c" +#line 3666 "src/parser.c" break; case 144: /* binary_exp: binary_exp OPTIONS decl_exp */ -#line 753 "src/gwion.y" +#line 762 "src/gwion.y" { (yyval.exp) = new_exp_binary(mpool(arg), (yyvsp[-2].exp), (yyvsp[-1].sym), (yyvsp[0].exp), (yylsp[-1])); } -#line 3664 "src/parser.c" +#line 3672 "src/parser.c" break; case 145: /* call_template: ":[" type_list "]" */ -#line 756 "src/gwion.y" +#line 765 "src/gwion.y" { (yyval.type_list) = (yyvsp[-1].type_list); } -#line 3670 "src/parser.c" +#line 3678 "src/parser.c" break; case 146: /* call_template: %empty */ -#line 756 "src/gwion.y" +#line 765 "src/gwion.y" { (yyval.type_list) = NULL; } -#line 3676 "src/parser.c" +#line 3684 "src/parser.c" break; case 152: /* array_exp: "[" exp "]" */ -#line 761 "src/gwion.y" +#line 770 "src/gwion.y" { (yyval.array_sub) = new_array_sub(mpool(arg), (yyvsp[-1].exp)); } -#line 3682 "src/parser.c" +#line 3690 "src/parser.c" break; case 153: /* array_exp: "[" exp "]" array_exp */ -#line 762 "src/gwion.y" +#line 771 "src/gwion.y" { if((yyvsp[-2].exp)->next){ parser_error(&(yylsp[-2]), arg, "invalid format for array init [...][...]...", 0x0208); YYERROR; } (yyval.array_sub) = prepend_array_sub((yyvsp[0].array_sub), (yyvsp[-2].exp)); } -#line 3690 "src/parser.c" +#line 3698 "src/parser.c" break; case 154: /* array_exp: "[" exp "]" "[" "]" */ -#line 765 "src/gwion.y" +#line 774 "src/gwion.y" { parser_error(&(yylsp[-2]), arg, "partially empty array init [...][]...", 0x0209); YYERROR; } -#line 3696 "src/parser.c" +#line 3704 "src/parser.c" break; case 155: /* array_empty: "[" "]" */ -#line 769 "src/gwion.y" +#line 778 "src/gwion.y" { (yyval.array_sub) = new_array_sub(mpool(arg), NULL); } -#line 3702 "src/parser.c" +#line 3710 "src/parser.c" break; case 156: /* array_empty: array_empty "[" "]" */ -#line 770 "src/gwion.y" +#line 779 "src/gwion.y" { (yyval.array_sub) = prepend_array_sub((yyvsp[-2].array_sub), NULL); } -#line 3708 "src/parser.c" +#line 3716 "src/parser.c" break; case 157: /* array_empty: array_empty array_exp */ -#line 771 "src/gwion.y" +#line 780 "src/gwion.y" { parser_error(&(yylsp[-1]), arg, "partially empty array init [][...]", 0x0210); YYERROR; } -#line 3714 "src/parser.c" +#line 3722 "src/parser.c" break; case 158: /* dict_list: binary_exp ":" binary_exp */ -#line 775 "src/gwion.y" +#line 784 "src/gwion.y" { (yyvsp[-2].exp)->next = (yyvsp[0].exp); (yyval.exp) = (yyvsp[-2].exp); } -#line 3720 "src/parser.c" +#line 3728 "src/parser.c" break; case 159: /* dict_list: binary_exp ":" binary_exp "," dict_list */ -#line 776 "src/gwion.y" +#line 785 "src/gwion.y" { (yyvsp[-4].exp)->next = (yyvsp[-2].exp); (yyvsp[-2].exp)-> next = (yyvsp[0].exp); (yyval.exp) = (yyvsp[-4].exp); } -#line 3726 "src/parser.c" +#line 3734 "src/parser.c" break; case 160: /* range: "[" exp ":" exp "]" */ -#line 779 "src/gwion.y" +#line 788 "src/gwion.y" { (yyval.range) = new_range(mpool(arg), (yyvsp[-3].exp), (yyvsp[-1].exp)); } -#line 3732 "src/parser.c" +#line 3740 "src/parser.c" break; case 161: /* range: "[" exp ":" "]" */ -#line 780 "src/gwion.y" +#line 789 "src/gwion.y" { (yyval.range) = new_range(mpool(arg), (yyvsp[-2].exp), NULL); } -#line 3738 "src/parser.c" +#line 3746 "src/parser.c" break; case 162: /* range: "[" ":" exp "]" */ -#line 781 "src/gwion.y" +#line 790 "src/gwion.y" { (yyval.range) = new_range(mpool(arg), NULL, (yyvsp[-1].exp)); } -#line 3744 "src/parser.c" +#line 3752 "src/parser.c" break; case 166: /* decl_exp: type_decl_flag2 flag type_decl_array var_decl */ -#line 787 "src/gwion.y" +#line 796 "src/gwion.y" { (yyval.exp)= new_exp_decl(mpool(arg), (yyvsp[-1].type_decl), &(yyvsp[0].var_decl), (yyloc)); (yyval.exp)->d.exp_decl.td->flag |= (yyvsp[-3].flag) | (yyvsp[-2].flag); } -#line 3750 "src/parser.c" +#line 3758 "src/parser.c" break; case 167: /* decl_exp: type_decl_flag2 flag type_decl_array "(" opt_exp ")" var_decl */ -#line 788 "src/gwion.y" +#line 797 "src/gwion.y" { (yyval.exp) = new_exp_decl(mpool(arg), (yyvsp[-4].type_decl), &(yyvsp[0].var_decl), (yylsp[0])); (yyval.exp)->d.exp_decl.td->flag |= (yyvsp[-6].flag) | (yyvsp[-5].flag); (yyval.exp)->d.exp_decl.args = (yyvsp[-2].exp) ?: new_prim_nil(mpool(arg), (yylsp[-2])); } -#line 3760 "src/parser.c" +#line 3768 "src/parser.c" break; case 168: /* func_args: "(" arg_list ")" */ -#line 794 "src/gwion.y" +#line 803 "src/gwion.y" { (yyval.default_args) = (yyvsp[-1].default_args); } -#line 3766 "src/parser.c" +#line 3774 "src/parser.c" break; case 169: /* func_args: "(" ")" */ -#line 794 "src/gwion.y" +#line 803 "src/gwion.y" { (yyval.default_args) = (struct ParserArg){}; } -#line 3772 "src/parser.c" +#line 3780 "src/parser.c" break; case 170: /* fptr_args: "(" fptr_list ")" */ -#line 795 "src/gwion.y" +#line 804 "src/gwion.y" { (yyval.arg_list) = (yyvsp[-1].arg_list); } -#line 3778 "src/parser.c" +#line 3786 "src/parser.c" break; case 171: /* fptr_args: "(" ")" */ -#line 795 "src/gwion.y" +#line 804 "src/gwion.y" { (yyval.arg_list) = NULL; } -#line 3784 "src/parser.c" +#line 3792 "src/parser.c" break; case 172: /* decl_template: ":[" specialized_list "]" */ -#line 797 "src/gwion.y" +#line 806 "src/gwion.y" { (yyval.specialized_list) = (yyvsp[-1].specialized_list); } -#line 3790 "src/parser.c" +#line 3798 "src/parser.c" break; case 173: /* decl_template: ":[" specialized_list "," "..." "]" */ -#line 798 "src/gwion.y" +#line 807 "src/gwion.y" { (yyval.specialized_list) = (yyvsp[-3].specialized_list); Specialized spec = { .xid = insert_symbol("...") }; mp_vector_add(mpool(arg), &(yyval.specialized_list), Specialized, spec); } -#line 3801 "src/parser.c" +#line 3809 "src/parser.c" break; case 174: /* decl_template: ":[" "..." "]" */ -#line 804 "src/gwion.y" +#line 813 "src/gwion.y" { Specialized spec = { .xid = insert_symbol("...") }; (yyval.specialized_list) = new_mp_vector(mpool(arg), Specialized, 1); mp_vector_set((yyval.specialized_list), Specialized, 0, spec); } -#line 3811 "src/parser.c" +#line 3819 "src/parser.c" break; case 175: /* decl_template: %empty */ -#line 809 "src/gwion.y" +#line 818 "src/gwion.y" { (yyval.specialized_list) = NULL; } -#line 3817 "src/parser.c" +#line 3825 "src/parser.c" break; case 176: /* global: "global" */ -#line 811 "src/gwion.y" +#line 820 "src/gwion.y" { (yyval.flag) = ae_flag_global; /*arg->global = true;*/ } -#line 3823 "src/parser.c" +#line 3831 "src/parser.c" break; case 178: /* opt_global: %empty */ -#line 812 "src/gwion.y" +#line 821 "src/gwion.y" { (yyval.flag) = ae_flag_none; } -#line 3829 "src/parser.c" +#line 3837 "src/parser.c" break; case 179: /* storage_flag: "static" */ -#line 814 "src/gwion.y" +#line 823 "src/gwion.y" { (yyval.flag) = ae_flag_static; } -#line 3835 "src/parser.c" +#line 3843 "src/parser.c" break; case 181: /* access_flag: "private" */ -#line 816 "src/gwion.y" +#line 825 "src/gwion.y" { (yyval.flag) = ae_flag_private; } -#line 3841 "src/parser.c" +#line 3849 "src/parser.c" break; case 182: /* access_flag: "protect" */ -#line 817 "src/gwion.y" +#line 826 "src/gwion.y" { (yyval.flag) = ae_flag_protect; } -#line 3847 "src/parser.c" +#line 3855 "src/parser.c" break; case 183: /* flag: access_flag */ -#line 820 "src/gwion.y" +#line 829 "src/gwion.y" { (yyval.flag) = (yyvsp[0].flag); } -#line 3853 "src/parser.c" +#line 3861 "src/parser.c" break; case 184: /* flag: storage_flag */ -#line 821 "src/gwion.y" +#line 830 "src/gwion.y" { (yyval.flag) = (yyvsp[0].flag); } -#line 3859 "src/parser.c" +#line 3867 "src/parser.c" break; case 185: /* flag: access_flag storage_flag */ -#line 822 "src/gwion.y" +#line 831 "src/gwion.y" { (yyval.flag) = (yyvsp[-1].flag) | (yyvsp[0].flag); } -#line 3865 "src/parser.c" +#line 3873 "src/parser.c" break; case 186: /* flag: %empty */ -#line 823 "src/gwion.y" +#line 832 "src/gwion.y" { (yyval.flag) = ae_flag_none; } -#line 3871 "src/parser.c" +#line 3879 "src/parser.c" break; case 187: /* final: "final" */ -#line 826 "src/gwion.y" +#line 835 "src/gwion.y" { (yyval.flag) = ae_flag_final; } -#line 3877 "src/parser.c" +#line 3885 "src/parser.c" break; case 188: /* final: %empty */ -#line 826 "src/gwion.y" +#line 835 "src/gwion.y" { (yyval.flag) = ae_flag_none; } -#line 3883 "src/parser.c" +#line 3891 "src/parser.c" break; case 189: /* modifier: "abstract" final */ -#line 828 "src/gwion.y" +#line 837 "src/gwion.y" { (yyval.flag) = ae_flag_abstract | (yyvsp[0].flag); } -#line 3889 "src/parser.c" +#line 3897 "src/parser.c" break; case 191: /* func_def_base: "fun" func_base func_args code_list */ -#line 831 "src/gwion.y" +#line 840 "src/gwion.y" { (yyvsp[-2].func_base)->args = (yyvsp[-1].default_args).args; (yyvsp[-2].func_base)->fbflag |= (yyvsp[-1].default_args).flag; (yyval.func_def) = new_func_def(mpool(arg), (yyvsp[-2].func_base), (yyvsp[0].stmt_list)); } -#line 3899 "src/parser.c" +#line 3907 "src/parser.c" break; case 192: /* func_def_base: "fun" func_base func_args ";" */ -#line 836 "src/gwion.y" +#line 845 "src/gwion.y" { if((yyvsp[-1].default_args).flag == fbflag_default) { parser_error(&(yylsp[-2]), arg, "default arguments not allowed in abstract operators", 0210); YYERROR; }; @@ -3907,33 +3915,33 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] SET_FLAG((yyvsp[-2].func_base), abstract); (yyval.func_def) = new_func_def(mpool(arg), (yyvsp[-2].func_base), NULL); } -#line 3911 "src/parser.c" +#line 3919 "src/parser.c" break; case 193: /* func_def_base: LOCALE global "" "(" locale_list ")" code_list */ -#line 843 "src/gwion.y" +#line 852 "src/gwion.y" { Type_Decl *td = new_type_decl(mpool(arg), insert_symbol("float"), (yylsp[-4])); Func_Base *base = new_func_base(mpool(arg), td, (yyvsp[-4].sym), (yyvsp[-2].default_args).args, (yyvsp[-5].flag), (yylsp[-4])); base->fbflag |= fbflag_locale | (yyvsp[-2].default_args).flag; (yyval.func_def) = new_func_def(mpool(arg), base, (yyvsp[0].stmt_list)); } -#line 3922 "src/parser.c" +#line 3930 "src/parser.c" break; case 194: /* func_def_base: LOCALE "" "(" locale_list ")" code_list */ -#line 849 "src/gwion.y" +#line 858 "src/gwion.y" { Type_Decl *td = new_type_decl(mpool(arg), insert_symbol("float"), (yylsp[-4])); Func_Base *base = new_func_base(mpool(arg), td, (yyvsp[-4].sym), (yyvsp[-2].default_args).args, ae_flag_none, (yylsp[-4])); base->fbflag |= fbflag_locale | (yyvsp[-2].default_args).flag; (yyval.func_def) = new_func_def(mpool(arg), base, (yyvsp[0].stmt_list)); } -#line 3933 "src/parser.c" +#line 3941 "src/parser.c" break; case 195: /* abstract_fdef: "fun" flag "abstract" type_decl_empty "" decl_template fptr_args ";" */ -#line 858 "src/gwion.y" +#line 867 "src/gwion.y" { Func_Base *base = new_func_base(mpool(arg), (yyvsp[-4].type_decl), (yyvsp[-3].sym), NULL, (yyvsp[-6].flag) | ae_flag_abstract, (yylsp[-3])); if((yyvsp[-2].specialized_list)) @@ -3941,11 +3949,11 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] base->args = (yyvsp[-1].arg_list); (yyval.func_def) = new_func_def(mpool(arg), base, NULL); } -#line 3945 "src/parser.c" +#line 3953 "src/parser.c" break; case 201: /* op_base: type_decl_empty op_op decl_template "(" arg "," arg ")" */ -#line 869 "src/gwion.y" +#line 878 "src/gwion.y" { if((yyvsp[-3].default_args).flag == fbflag_default || (yyvsp[-1].default_args).flag == fbflag_default) { parser_error(&(yylsp[-6]), arg, "default arguments not allowed in binary operators", 0210); YYERROR; }; @@ -3955,11 +3963,11 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] (yyval.func_base) = new_func_base(mpool(arg), (yyvsp[-7].type_decl), (yyvsp[-6].sym), args, ae_flag_none, (yylsp[-6])); if((yyvsp[-5].specialized_list))(yyval.func_base)->tmpl = new_tmpl(mpool(arg), (yyvsp[-5].specialized_list)); } -#line 3959 "src/parser.c" +#line 3967 "src/parser.c" break; case 202: /* op_base: type_decl_empty post_op decl_template "(" arg ")" */ -#line 879 "src/gwion.y" +#line 888 "src/gwion.y" { if((yyvsp[-1].default_args).flag == fbflag_default) { parser_error(&(yylsp[-4]), arg, "default arguments not allowed in postfix operators", 0210); YYERROR; }; @@ -3968,11 +3976,11 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] (yyval.func_base) = new_func_base(mpool(arg), (yyvsp[-5].type_decl), (yyvsp[-4].sym), args, ae_flag_none, (yylsp[-4])); if((yyvsp[-3].specialized_list))(yyval.func_base)->tmpl = new_tmpl(mpool(arg), (yyvsp[-3].specialized_list)); } -#line 3972 "src/parser.c" +#line 3980 "src/parser.c" break; case 203: /* op_base: unary_op type_decl_empty decl_template "(" arg ")" */ -#line 888 "src/gwion.y" +#line 897 "src/gwion.y" { if((yyvsp[-1].default_args).flag == fbflag_default) { parser_error(&(yylsp[-4]), arg, "default arguments not allowed in unary operators", 0210); YYERROR; }; @@ -3982,88 +3990,88 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] (yyval.func_base)->fbflag |= fbflag_unary; if((yyvsp[-3].specialized_list))(yyval.func_base)->tmpl = new_tmpl(mpool(arg), (yyvsp[-3].specialized_list)); } -#line 3986 "src/parser.c" +#line 3994 "src/parser.c" break; case 204: /* op_base: type_decl_empty OPID_A func_args */ -#line 898 "src/gwion.y" +#line 907 "src/gwion.y" { (yyval.func_base) = new_func_base(mpool(arg), (yyvsp[-2].type_decl), (yyvsp[-1].sym), (yyvsp[0].default_args).args, ae_flag_none, (yylsp[-1])); (yyval.func_base)->fbflag |= fbflag_internal; } -#line 3995 "src/parser.c" +#line 4003 "src/parser.c" break; case 205: /* operator: "operator" */ -#line 903 "src/gwion.y" +#line 912 "src/gwion.y" { (yyval.flag) = ae_flag_none; } -#line 4001 "src/parser.c" +#line 4009 "src/parser.c" break; case 206: /* operator: "operator" global */ -#line 903 "src/gwion.y" +#line 912 "src/gwion.y" { (yyval.flag) = (yyvsp[0].flag); } -#line 4007 "src/parser.c" +#line 4015 "src/parser.c" break; case 207: /* op_def: operator op_base code_list */ -#line 906 "src/gwion.y" +#line 915 "src/gwion.y" { (yyval.func_def) = new_func_def(mpool(arg), (yyvsp[-1].func_base), (yyvsp[0].stmt_list)); (yyvsp[-1].func_base)->fbflag |= fbflag_op; (yyvsp[-1].func_base)->flag |= (yyvsp[-2].flag); } -#line 4013 "src/parser.c" +#line 4021 "src/parser.c" break; case 208: /* op_def: operator op_base ";" */ -#line 908 "src/gwion.y" +#line 917 "src/gwion.y" { (yyval.func_def) = new_func_def(mpool(arg), (yyvsp[-1].func_base), NULL); (yyvsp[-1].func_base)->fbflag |= fbflag_op; (yyvsp[-1].func_base)->flag |= (yyvsp[-2].flag) | ae_flag_abstract; } -#line 4019 "src/parser.c" +#line 4027 "src/parser.c" break; case 209: /* op_def: operator "abstract" op_base ";" */ -#line 910 "src/gwion.y" +#line 919 "src/gwion.y" { (yyval.func_def) = new_func_def(mpool(arg), (yyvsp[-1].func_base), NULL); (yyvsp[-1].func_base)->fbflag |= fbflag_op; (yyvsp[-1].func_base)->flag |= (yyvsp[-3].flag) | ae_flag_abstract; } -#line 4025 "src/parser.c" +#line 4033 "src/parser.c" break; case 213: /* func_def: operator "new" func_args code_list */ -#line 914 "src/gwion.y" +#line 923 "src/gwion.y" { Func_Base *const base = new_func_base(mpool(arg), NULL, (yyvsp[-2].sym), (yyvsp[-1].default_args).args, (yyvsp[-3].flag), (yylsp[-2])); base->fbflag = (yyvsp[-1].default_args).flag; (yyval.func_def) = new_func_def(mpool(arg), base, (yyvsp[0].stmt_list)); } -#line 4035 "src/parser.c" +#line 4043 "src/parser.c" break; case 214: /* func_def: operator "new" func_args ";" */ -#line 920 "src/gwion.y" +#line 929 "src/gwion.y" { if((yyvsp[-1].default_args).flag == fbflag_default) { parser_error(&(yylsp[-2]), arg, "default arguments not allowed in abstract operators", 0210); YYERROR; }; Func_Base *const base = new_func_base(mpool(arg), NULL, (yyvsp[-2].sym), (yyvsp[-1].default_args).args, (yyvsp[-3].flag) | ae_flag_abstract, (yylsp[-2])); (yyval.func_def) = new_func_def(mpool(arg), base, NULL); } -#line 4046 "src/parser.c" +#line 4054 "src/parser.c" break; case 215: /* func_def: operator "abstract" "new" func_args ";" */ -#line 927 "src/gwion.y" +#line 936 "src/gwion.y" { if((yyvsp[-1].default_args).flag == fbflag_default) { parser_error(&(yylsp[-3]), arg, "default arguments not allowed in abstract operators", 0210); YYERROR; }; Func_Base *const base = new_func_base(mpool(arg), NULL, (yyvsp[-2].sym), (yyvsp[-1].default_args).args, (yyvsp[-4].flag) | ae_flag_abstract, (yylsp[-2])); (yyval.func_def) =new_func_def(mpool(arg), base, NULL); } -#line 4057 "src/parser.c" +#line 4065 "src/parser.c" break; case 216: /* type_decl_base: "" */ -#line 935 "src/gwion.y" +#line 944 "src/gwion.y" { (yyval.type_decl) = new_type_decl(mpool(arg), (yyvsp[0].sym), (yyloc)); } -#line 4063 "src/parser.c" +#line 4071 "src/parser.c" break; case 217: /* type_decl_base: "(" flag type_decl_empty decl_template fptr_args func_effects ")" */ -#line 936 "src/gwion.y" +#line 945 "src/gwion.y" { const Symbol name = sig_name(arg, (yylsp[-4]).first); (yyval.type_decl) = new_type_decl(mpool(arg), name, (yylsp[-6])); @@ -4075,122 +4083,122 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] fptr->base->effects.ptr = (yyvsp[-1].vector).ptr; (yyval.type_decl)->fptr = fptr; } -#line 4079 "src/parser.c" +#line 4087 "src/parser.c" break; case 218: /* type_decl_tmpl: type_decl_base call_template */ -#line 950 "src/gwion.y" +#line 959 "src/gwion.y" { (yyval.type_decl) = (yyvsp[-1].type_decl); (yyval.type_decl)->types = (yyvsp[0].type_list); } -#line 4085 "src/parser.c" +#line 4093 "src/parser.c" break; case 219: /* type_decl_tmpl: "&" type_decl_base call_template */ -#line 951 "src/gwion.y" +#line 960 "src/gwion.y" { (yyval.type_decl) = (yyvsp[-1].type_decl); (yyval.type_decl)->ref = true; (yyval.type_decl)->types = (yyvsp[0].type_list); } -#line 4091 "src/parser.c" +#line 4099 "src/parser.c" break; case 221: /* type_decl_noflag: type_decl_tmpl "." type_decl_noflag */ -#line 956 "src/gwion.y" +#line 965 "src/gwion.y" { (yyvsp[-2].type_decl)->next = (yyvsp[0].type_decl); } -#line 4097 "src/parser.c" +#line 4105 "src/parser.c" break; case 222: /* option: "?" */ -#line 959 "src/gwion.y" +#line 968 "src/gwion.y" { (yyval.uval) = 1; } -#line 4103 "src/parser.c" +#line 4111 "src/parser.c" break; case 223: /* option: OPTIONS */ -#line 959 "src/gwion.y" +#line 968 "src/gwion.y" { (yyval.uval) = strlen(s_name((yyvsp[0].sym))); } -#line 4109 "src/parser.c" +#line 4117 "src/parser.c" break; case 224: /* option: %empty */ -#line 959 "src/gwion.y" +#line 968 "src/gwion.y" { (yyval.uval) = 0; } -#line 4115 "src/parser.c" +#line 4123 "src/parser.c" break; case 225: /* type_decl_opt: type_decl_noflag option */ -#line 960 "src/gwion.y" +#line 969 "src/gwion.y" { (yyval.type_decl) = (yyvsp[-1].type_decl); (yyval.type_decl)->option = (yyvsp[0].uval); } -#line 4121 "src/parser.c" +#line 4129 "src/parser.c" break; case 227: /* type_decl: type_decl_flag type_decl_opt */ -#line 961 "src/gwion.y" +#line 970 "src/gwion.y" { (yyval.type_decl) = (yyvsp[0].type_decl); (yyval.type_decl)->flag |= (yyvsp[-1].flag); } -#line 4127 "src/parser.c" +#line 4135 "src/parser.c" break; case 228: /* type_decl_flag: "late" */ -#line 964 "src/gwion.y" +#line 973 "src/gwion.y" { (yyval.flag) = ae_flag_late; } -#line 4133 "src/parser.c" +#line 4141 "src/parser.c" break; case 229: /* type_decl_flag: "const" */ -#line 965 "src/gwion.y" +#line 974 "src/gwion.y" { (yyval.flag) = ae_flag_const; } -#line 4139 "src/parser.c" +#line 4147 "src/parser.c" break; case 230: /* opt_var: "var" */ -#line 967 "src/gwion.y" +#line 976 "src/gwion.y" { (yyval.yybool) = true; } -#line 4145 "src/parser.c" +#line 4153 "src/parser.c" break; case 231: /* opt_var: %empty */ -#line 967 "src/gwion.y" +#line 976 "src/gwion.y" { (yyval.yybool) = false; } -#line 4151 "src/parser.c" +#line 4159 "src/parser.c" break; case 232: /* type_decl_flag2: "var" */ -#line 969 "src/gwion.y" +#line 978 "src/gwion.y" { (yyval.flag) = ae_flag_none; } -#line 4157 "src/parser.c" +#line 4165 "src/parser.c" break; case 234: /* union_decl: "" ";" */ -#line 972 "src/gwion.y" +#line 981 "src/gwion.y" { Type_Decl *td = new_type_decl(mpool(arg), insert_symbol("None"), (yylsp[-1])); (yyval.union_member) = (Union_Member) { .td = td, .vd = { .xid =(yyvsp[-1].sym), .pos = (yylsp[-1]) } }; } -#line 4166 "src/parser.c" +#line 4174 "src/parser.c" break; case 235: /* union_decl: type_decl_empty "" ";" */ -#line 976 "src/gwion.y" +#line 985 "src/gwion.y" { (yyval.union_member) = (Union_Member) { .td = (yyvsp[-2].type_decl), .vd = { .xid =(yyvsp[-1].sym), .pos = (yylsp[-1]) } };} -#line 4172 "src/parser.c" +#line 4180 "src/parser.c" break; case 236: /* union_list: union_decl */ -#line 978 "src/gwion.y" +#line 987 "src/gwion.y" { (yyval.union_list) = new_mp_vector(mpool(arg), Union_Member, 1); mp_vector_set((yyval.union_list), Union_Member, 0, (yyvsp[0].union_member)); } -#line 4181 "src/parser.c" +#line 4189 "src/parser.c" break; case 237: /* union_list: union_list union_decl */ -#line 982 "src/gwion.y" +#line 991 "src/gwion.y" { mp_vector_add(mpool(arg), &(yyvsp[-1].union_list), Union_Member, (yyvsp[0].union_member)); (yyval.union_list) = (yyvsp[-1].union_list); } -#line 4190 "src/parser.c" +#line 4198 "src/parser.c" break; case 238: /* union_def: "union" flag "" decl_template "{" union_list "}" */ -#line 988 "src/gwion.y" +#line 997 "src/gwion.y" { (yyval.union_def) = new_union_def(mpool(arg), (yyvsp[-1].union_list), (yylsp[-4])); (yyval.union_def)->xid = (yyvsp[-4].sym); @@ -4198,265 +4206,265 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] if((yyvsp[-3].specialized_list)) (yyval.union_def)->tmpl = new_tmpl(mpool(arg), (yyvsp[-3].specialized_list)); } -#line 4202 "src/parser.c" +#line 4210 "src/parser.c" break; case 239: /* var_decl: "" */ -#line 997 "src/gwion.y" +#line 1006 "src/gwion.y" { (yyval.var_decl) = (struct Var_Decl_) { .xid = (yyvsp[0].sym), .pos = (yylsp[0]) }; } -#line 4208 "src/parser.c" +#line 4216 "src/parser.c" break; case 240: /* arg_decl: "" */ -#line 999 "src/gwion.y" +#line 1008 "src/gwion.y" { (yyval.var_decl) = (struct Var_Decl_) { .xid = (yyvsp[0].sym), .pos = (yylsp[0]) }; } -#line 4214 "src/parser.c" +#line 4222 "src/parser.c" break; case 242: /* fptr_arg_decl: %empty */ -#line 1000 "src/gwion.y" +#line 1009 "src/gwion.y" { (yyval.var_decl) = (struct Var_Decl_){}; } -#line 4220 "src/parser.c" +#line 4228 "src/parser.c" break; case 256: /* opt_exp: exp */ -#line 1008 "src/gwion.y" +#line 1017 "src/gwion.y" { (yyval.exp) = (yyvsp[0].exp); } -#line 4226 "src/parser.c" +#line 4234 "src/parser.c" break; case 257: /* opt_exp: %empty */ -#line 1008 "src/gwion.y" +#line 1017 "src/gwion.y" { (yyval.exp) = NULL; } -#line 4232 "src/parser.c" +#line 4240 "src/parser.c" break; case 259: /* con_exp: log_or_exp "?" opt_exp ":" con_exp */ -#line 1011 "src/gwion.y" +#line 1020 "src/gwion.y" { (yyval.exp) = new_exp_if(mpool(arg), (yyvsp[-4].exp), (yyvsp[-2].exp), (yyvsp[0].exp), (yyloc)); } -#line 4238 "src/parser.c" +#line 4246 "src/parser.c" break; case 260: /* con_exp: log_or_exp "?:" con_exp */ -#line 1013 "src/gwion.y" +#line 1022 "src/gwion.y" { (yyval.exp) = new_exp_if(mpool(arg), (yyvsp[-2].exp), NULL, (yyvsp[0].exp), (yyloc)); } -#line 4244 "src/parser.c" +#line 4252 "src/parser.c" break; case 262: /* log_or_exp: log_or_exp "||" log_and_exp */ -#line 1015 "src/gwion.y" +#line 1024 "src/gwion.y" { (yyval.exp) = new_exp_binary(mpool(arg), (yyvsp[-2].exp), (yyvsp[-1].sym), (yyvsp[0].exp), (yyloc)); } -#line 4250 "src/parser.c" +#line 4258 "src/parser.c" break; case 264: /* log_and_exp: log_and_exp "&&" inc_or_exp */ -#line 1016 "src/gwion.y" +#line 1025 "src/gwion.y" { (yyval.exp) = new_exp_binary(mpool(arg), (yyvsp[-2].exp), (yyvsp[-1].sym), (yyvsp[0].exp), (yyloc)); } -#line 4256 "src/parser.c" +#line 4264 "src/parser.c" break; case 266: /* inc_or_exp: inc_or_exp "|" exc_or_exp */ -#line 1017 "src/gwion.y" +#line 1026 "src/gwion.y" { (yyval.exp) = new_exp_binary(mpool(arg), (yyvsp[-2].exp), (yyvsp[-1].sym), (yyvsp[0].exp), (yyloc)); } -#line 4262 "src/parser.c" +#line 4270 "src/parser.c" break; case 268: /* exc_or_exp: exc_or_exp "^" and_exp */ -#line 1018 "src/gwion.y" +#line 1027 "src/gwion.y" { (yyval.exp) = new_exp_binary(mpool(arg), (yyvsp[-2].exp), (yyvsp[-1].sym), (yyvsp[0].exp), (yyloc)); } -#line 4268 "src/parser.c" +#line 4276 "src/parser.c" break; case 270: /* and_exp: and_exp "&" eq_exp */ -#line 1019 "src/gwion.y" +#line 1028 "src/gwion.y" { (yyval.exp) = new_exp_binary(mpool(arg), (yyvsp[-2].exp), (yyvsp[-1].sym), (yyvsp[0].exp), (yyloc)); } -#line 4274 "src/parser.c" +#line 4282 "src/parser.c" break; case 272: /* eq_exp: eq_exp eq_op rel_exp */ -#line 1020 "src/gwion.y" +#line 1029 "src/gwion.y" { (yyval.exp) = new_exp_binary(mpool(arg), (yyvsp[-2].exp), (yyvsp[-1].sym), (yyvsp[0].exp), (yyloc)); } -#line 4280 "src/parser.c" +#line 4288 "src/parser.c" break; case 274: /* rel_exp: rel_exp rel_op shift_exp */ -#line 1021 "src/gwion.y" +#line 1030 "src/gwion.y" { (yyval.exp) = new_exp_binary(mpool(arg), (yyvsp[-2].exp), (yyvsp[-1].sym), (yyvsp[0].exp), (yyloc)); } -#line 4286 "src/parser.c" +#line 4294 "src/parser.c" break; case 276: /* shift_exp: shift_exp shift_op add_exp */ -#line 1022 "src/gwion.y" +#line 1031 "src/gwion.y" { (yyval.exp) = new_exp_binary(mpool(arg), (yyvsp[-2].exp), (yyvsp[-1].sym), (yyvsp[0].exp), (yyloc)); } -#line 4292 "src/parser.c" +#line 4300 "src/parser.c" break; case 278: /* add_exp: add_exp add_op mul_exp */ -#line 1023 "src/gwion.y" +#line 1032 "src/gwion.y" { (yyval.exp) = new_exp_binary(mpool(arg), (yyvsp[-2].exp), (yyvsp[-1].sym), (yyvsp[0].exp), (yyloc)); } -#line 4298 "src/parser.c" +#line 4306 "src/parser.c" break; case 280: /* mul_exp: mul_exp mul_op dur_exp */ -#line 1024 "src/gwion.y" +#line 1033 "src/gwion.y" { (yyval.exp) = new_exp_binary(mpool(arg), (yyvsp[-2].exp), (yyvsp[-1].sym), (yyvsp[0].exp), (yyloc)); } -#line 4304 "src/parser.c" +#line 4312 "src/parser.c" break; case 282: /* dur_exp: dur_exp "::" cast_exp */ -#line 1025 "src/gwion.y" +#line 1034 "src/gwion.y" { (yyval.exp) = new_exp_binary(mpool(arg), (yyvsp[-2].exp), (yyvsp[-1].sym), (yyvsp[0].exp), (yyloc)); } -#line 4310 "src/parser.c" +#line 4318 "src/parser.c" break; case 284: /* cast_exp: cast_exp "$" type_decl_empty */ -#line 1028 "src/gwion.y" +#line 1037 "src/gwion.y" { (yyval.exp) = new_exp_cast(mpool(arg), (yyvsp[0].type_decl), (yyvsp[-2].exp), (yyloc)); } -#line 4316 "src/parser.c" +#line 4324 "src/parser.c" break; case 291: /* unary_exp: unary_op unary_exp */ -#line 1035 "src/gwion.y" +#line 1044 "src/gwion.y" { (yyval.exp) = new_exp_unary(mpool(arg), (yyvsp[-1].sym), (yyvsp[0].exp), (yyloc)); } -#line 4322 "src/parser.c" +#line 4330 "src/parser.c" break; case 292: /* unary_exp: "spork" unary_exp */ -#line 1036 "src/gwion.y" +#line 1045 "src/gwion.y" { (yyval.exp) = new_exp_unary(mpool(arg), (yyvsp[-1].sym), (yyvsp[0].exp), (yylsp[-1])); } -#line 4328 "src/parser.c" +#line 4336 "src/parser.c" break; case 293: /* unary_exp: "fork" unary_exp */ -#line 1037 "src/gwion.y" +#line 1046 "src/gwion.y" { (yyval.exp) = new_exp_unary(mpool(arg), (yyvsp[-1].sym), (yyvsp[0].exp), (yylsp[-1])); } -#line 4334 "src/parser.c" +#line 4342 "src/parser.c" break; case 294: /* unary_exp: "new" type_decl_exp "(" opt_exp ")" */ -#line 1038 "src/gwion.y" +#line 1047 "src/gwion.y" { (yyval.exp) = new_exp_unary2(mpool(arg), (yyvsp[-4].sym), (yyvsp[-3].type_decl), (yyvsp[-1].exp) ?: new_prim_nil(mpool(arg), (yylsp[-1])), (yyloc)); } -#line 4342 "src/parser.c" +#line 4350 "src/parser.c" break; case 295: /* unary_exp: "new" type_decl_exp */ -#line 1041 "src/gwion.y" +#line 1050 "src/gwion.y" {(yyval.exp) = new_exp_unary2(mpool(arg), (yyvsp[-1].sym), (yyvsp[0].type_decl), NULL, (yyloc)); } -#line 4348 "src/parser.c" +#line 4356 "src/parser.c" break; case 296: /* unary_exp: "spork" code_list */ -#line 1042 "src/gwion.y" +#line 1051 "src/gwion.y" { (yyval.exp) = new_exp_unary3(mpool(arg), (yyvsp[-1].sym), (yyvsp[0].stmt_list), (yylsp[-1])); } -#line 4354 "src/parser.c" +#line 4362 "src/parser.c" break; case 297: /* unary_exp: "fork" code_list */ -#line 1043 "src/gwion.y" +#line 1052 "src/gwion.y" { (yyval.exp) = new_exp_unary3(mpool(arg), (yyvsp[-1].sym), (yyvsp[0].stmt_list), (yylsp[-1])); } -#line 4360 "src/parser.c" +#line 4368 "src/parser.c" break; case 298: /* unary_exp: "spork" captures code_list */ -#line 1044 "src/gwion.y" +#line 1053 "src/gwion.y" { (yyval.exp) = new_exp_unary3(mpool(arg), (yyvsp[-2].sym), (yyvsp[0].stmt_list), (yylsp[-2])); (yyval.exp)->d.exp_unary.captures = (yyvsp[-1].captures); } -#line 4366 "src/parser.c" +#line 4374 "src/parser.c" break; case 299: /* unary_exp: "fork" captures code_list */ -#line 1045 "src/gwion.y" +#line 1054 "src/gwion.y" { (yyval.exp) = new_exp_unary3(mpool(arg), (yyvsp[-2].sym), (yyvsp[0].stmt_list), (yylsp[-2])); (yyval.exp)->d.exp_unary.captures = (yyvsp[-1].captures); } -#line 4372 "src/parser.c" +#line 4380 "src/parser.c" break; case 300: /* unary_exp: "$" type_decl_empty */ -#line 1046 "src/gwion.y" +#line 1055 "src/gwion.y" { (yyval.exp) = new_exp_td(mpool(arg), (yyvsp[0].type_decl), (yylsp[0])); } -#line 4378 "src/parser.c" +#line 4386 "src/parser.c" break; case 301: /* lambda_list: "" */ -#line 1049 "src/gwion.y" +#line 1058 "src/gwion.y" { Arg a = (Arg) { .var_decl = { .xid = (yyvsp[0].sym), .pos = (yylsp[0]) } }; (yyval.arg_list) = new_mp_vector(mpool(arg), Arg, 1); mp_vector_set((yyval.arg_list), Arg, 0, a); } -#line 4388 "src/parser.c" +#line 4396 "src/parser.c" break; case 302: /* lambda_list: lambda_list "" */ -#line 1054 "src/gwion.y" +#line 1063 "src/gwion.y" { Arg a = (Arg) { .var_decl = { .xid = (yyvsp[0].sym), .pos = (yylsp[0]) } }; mp_vector_add(mpool(arg), &(yyvsp[-1].arg_list), Arg, a); (yyval.arg_list) = (yyvsp[-1].arg_list); } -#line 4398 "src/parser.c" +#line 4406 "src/parser.c" break; case 303: /* lambda_arg: "\\" lambda_list */ -#line 1059 "src/gwion.y" +#line 1068 "src/gwion.y" { (yyval.arg_list) = (yyvsp[0].arg_list); } -#line 4404 "src/parser.c" +#line 4412 "src/parser.c" break; case 304: /* lambda_arg: "\\" */ -#line 1059 "src/gwion.y" +#line 1068 "src/gwion.y" { (yyval.arg_list) = NULL; } -#line 4410 "src/parser.c" +#line 4418 "src/parser.c" break; case 306: /* tmplarg: type_decl_empty */ -#line 1068 "src/gwion.y" +#line 1077 "src/gwion.y" { (yyval.tmplarg) = (TmplArg) { .d = { .td = (yyvsp[0].type_decl)}, .type = tmplarg_td}; } -#line 4418 "src/parser.c" +#line 4426 "src/parser.c" break; case 307: /* tmplarg: tmplarg_exp */ -#line 1071 "src/gwion.y" +#line 1080 "src/gwion.y" { (yyval.tmplarg) = (TmplArg) { .d = { .exp = (yyvsp[0].exp)}, .type = tmplarg_exp}; } -#line 4426 "src/parser.c" +#line 4434 "src/parser.c" break; case 308: /* type_list: tmplarg */ -#line 1076 "src/gwion.y" +#line 1085 "src/gwion.y" { (yyval.type_list) = new_mp_vector(mpool(arg), TmplArg, 1); mp_vector_set((yyval.type_list), TmplArg, 0, (yyvsp[0].tmplarg)); } -#line 4435 "src/parser.c" +#line 4443 "src/parser.c" break; case 309: /* type_list: type_list "," tmplarg */ -#line 1080 "src/gwion.y" +#line 1089 "src/gwion.y" { mp_vector_add(mpool(arg), &(yyvsp[-2].type_list), TmplArg, (yyvsp[0].tmplarg)); (yyval.type_list) = (yyvsp[-2].type_list); } -#line 4444 "src/parser.c" +#line 4452 "src/parser.c" break; case 310: /* call_paren: "(" exp ")" */ -#line 1086 "src/gwion.y" +#line 1095 "src/gwion.y" { (yyval.exp) = (yyvsp[-1].exp); } -#line 4450 "src/parser.c" +#line 4458 "src/parser.c" break; case 311: /* call_paren: "(" ")" */ -#line 1086 "src/gwion.y" +#line 1095 "src/gwion.y" { (yyval.exp) = NULL; } -#line 4456 "src/parser.c" +#line 4464 "src/parser.c" break; case 314: /* dot_exp: post_exp "." "" */ -#line 1090 "src/gwion.y" +#line 1099 "src/gwion.y" { if((yyvsp[-2].exp)->next) { parser_error(&(yylsp[-2]), arg, "can't use multiple expression" @@ -4465,66 +4473,66 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] }; (yyval.exp) = new_exp_dot(mpool(arg), (yyvsp[-2].exp), (yyvsp[0].sym), (yyloc)); } -#line 4469 "src/parser.c" +#line 4477 "src/parser.c" break; case 316: /* post_exp: post_exp array_exp */ -#line 1101 "src/gwion.y" +#line 1110 "src/gwion.y" { (yyval.exp) = new_exp_array(mpool(arg), (yyvsp[-1].exp), (yyvsp[0].array_sub), (yyloc)); } -#line 4475 "src/parser.c" +#line 4483 "src/parser.c" break; case 317: /* post_exp: post_exp range */ -#line 1103 "src/gwion.y" +#line 1112 "src/gwion.y" { (yyval.exp) = new_exp_slice(mpool(arg), (yyvsp[-1].exp), (yyvsp[0].range), (yyloc)); } -#line 4481 "src/parser.c" +#line 4489 "src/parser.c" break; case 318: /* post_exp: post_exp call_template call_paren */ -#line 1105 "src/gwion.y" +#line 1114 "src/gwion.y" { (yyval.exp) = new_exp_call(mpool(arg), (yyvsp[-2].exp), (yyvsp[0].exp), (yyloc)); if((yyvsp[-1].type_list))(yyval.exp)->d.exp_call.tmpl = new_tmpl_call(mpool(arg), (yyvsp[-1].type_list)); } -#line 4488 "src/parser.c" +#line 4496 "src/parser.c" break; case 319: /* post_exp: post_exp post_op */ -#line 1108 "src/gwion.y" +#line 1117 "src/gwion.y" { (yyval.exp) = new_exp_post(mpool(arg), (yyvsp[-1].exp), (yyvsp[0].sym), (yyloc)); } -#line 4494 "src/parser.c" +#line 4502 "src/parser.c" break; case 320: /* post_exp: dot_exp */ -#line 1109 "src/gwion.y" +#line 1118 "src/gwion.y" { (yyval.exp) = (yyvsp[0].exp); } -#line 4500 "src/parser.c" +#line 4508 "src/parser.c" break; case 321: /* interp_exp: "" */ -#line 1113 "src/gwion.y" +#line 1122 "src/gwion.y" { (yyval.exp) = new_prim_string(mpool(arg), (yyvsp[0].string).data, (yyvsp[0].string).delim, (yyloc)); } -#line 4506 "src/parser.c" +#line 4514 "src/parser.c" break; case 322: /* interp_exp: "" interp_exp */ -#line 1114 "src/gwion.y" +#line 1123 "src/gwion.y" { (yyval.exp) = new_prim_string(mpool(arg), (yyvsp[-1].string).data, (yyvsp[-1].string).delim, (yyloc)); (yyval.exp)->next = (yyvsp[0].exp); } -#line 4512 "src/parser.c" +#line 4520 "src/parser.c" break; case 323: /* interp_exp: exp INTERP_EXP interp_exp */ -#line 1115 "src/gwion.y" +#line 1124 "src/gwion.y" { (yyval.exp) = (yyvsp[-2].exp); (yyval.exp)->next = (yyvsp[0].exp); } -#line 4518 "src/parser.c" +#line 4526 "src/parser.c" break; case 324: /* interp: "${" interp_exp */ -#line 1117 "src/gwion.y" +#line 1126 "src/gwion.y" { (yyval.exp) = (yyvsp[0].exp); } -#line 4524 "src/parser.c" +#line 4532 "src/parser.c" break; case 325: /* interp: interp "${" interp_exp */ -#line 1118 "src/gwion.y" +#line 1127 "src/gwion.y" { if(!(yyvsp[0].exp)->next) { char c[strlen((yyvsp[-2].exp)->d.prim.d.string.data) + strlen((yyvsp[0].exp)->d.prim.d.string.data) + 1]; @@ -4535,86 +4543,86 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] } else (yyvsp[-2].exp)->next = (yyvsp[0].exp); } -#line 4539 "src/parser.c" +#line 4547 "src/parser.c" break; case 326: /* capture: "" */ -#line 1129 "src/gwion.y" +#line 1138 "src/gwion.y" { (yyval.capture) = (Capture){ .xid = (yyvsp[0].sym), .pos = (yylsp[0]) };} -#line 4545 "src/parser.c" +#line 4553 "src/parser.c" break; case 327: /* capture: "&" "" */ -#line 1129 "src/gwion.y" +#line 1138 "src/gwion.y" { (yyval.capture) = (Capture){ .xid = (yyvsp[0].sym), .is_ref = true, .pos = (yylsp[0]) }; } -#line 4551 "src/parser.c" +#line 4559 "src/parser.c" break; case 328: /* _captures: capture */ -#line 1131 "src/gwion.y" +#line 1140 "src/gwion.y" { (yyval.captures) = new_mp_vector(mpool(arg), Capture, 1); mp_vector_set((yyval.captures), Capture, 0, (yyvsp[0].capture)); } -#line 4557 "src/parser.c" +#line 4565 "src/parser.c" break; case 329: /* _captures: _captures capture */ -#line 1132 "src/gwion.y" +#line 1141 "src/gwion.y" { mp_vector_add(mpool(arg), &(yyvsp[-1].captures), Capture, (yyvsp[0].capture)); (yyval.captures) = (yyvsp[-1].captures); } -#line 4563 "src/parser.c" +#line 4571 "src/parser.c" break; case 330: /* captures: ":" _captures ":" */ -#line 1133 "src/gwion.y" +#line 1142 "src/gwion.y" { (yyval.captures) = (yyvsp[-1].captures); } -#line 4569 "src/parser.c" +#line 4577 "src/parser.c" break; case 331: /* captures: %empty */ -#line 1133 "src/gwion.y" +#line 1142 "src/gwion.y" { (yyval.captures) = NULL; } -#line 4575 "src/parser.c" +#line 4583 "src/parser.c" break; case 334: /* basic_exp: number */ -#line 1137 "src/gwion.y" +#line 1146 "src/gwion.y" { (yyval.exp) = new_prim_int( mpool(arg), (yyvsp[0].gwint).num, (yyloc)); (yyval.exp)->d.prim.d.gwint.int_type = (yyvsp[0].gwint).int_type; } -#line 4584 "src/parser.c" +#line 4592 "src/parser.c" break; case 335: /* basic_exp: "" */ -#line 1141 "src/gwion.y" +#line 1150 "src/gwion.y" { (yyval.exp) = new_prim_float( mpool(arg), (yyvsp[0].fval), (yyloc)); } -#line 4590 "src/parser.c" +#line 4598 "src/parser.c" break; case 336: /* basic_exp: "" */ -#line 1142 "src/gwion.y" +#line 1151 "src/gwion.y" { (yyval.exp) = new_prim_string( mpool(arg), (yyvsp[0].sval), 0, (yyloc)); } -#line 4596 "src/parser.c" +#line 4604 "src/parser.c" break; case 337: /* basic_exp: "" */ -#line 1143 "src/gwion.y" +#line 1152 "src/gwion.y" { (yyval.exp) = new_prim_char( mpool(arg), (yyvsp[0].sval), (yyloc)); } -#line 4602 "src/parser.c" +#line 4610 "src/parser.c" break; - case 338: /* prim_exp: "" */ -#line 1146 "src/gwion.y" - { (yyval.exp) = new_prim_id( mpool(arg), (yyvsp[0].sym), (yyloc)); } -#line 4608 "src/parser.c" + case 338: /* basic_exp: interp */ +#line 1153 "src/gwion.y" + { (yyval.exp) = !(yyvsp[0].exp)->next ? (yyvsp[0].exp) : new_prim_interp(mpool(arg), (yyvsp[0].exp), (yyloc)); } +#line 4616 "src/parser.c" break; - case 340: /* prim_exp: interp */ -#line 1148 "src/gwion.y" - { (yyval.exp) = !(yyvsp[0].exp)->next ? (yyvsp[0].exp) : new_prim_interp(mpool(arg), (yyvsp[0].exp), (yyloc)); } -#line 4614 "src/parser.c" + case 339: /* prim_exp: "" */ +#line 1156 "src/gwion.y" + { (yyval.exp) = new_prim_id( mpool(arg), (yyvsp[0].sym), (yyloc)); } +#line 4622 "src/parser.c" break; case 341: /* prim_exp: "[" opt_exp array_lit_end */ -#line 1149 "src/gwion.y" +#line 1158 "src/gwion.y" { if(!(yyvsp[-1].exp)) { parser_error(&(yylsp[-2]), arg, "must provide values/expressions for array [...]", 0); @@ -4623,76 +4631,76 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] Array_Sub array = new_array_sub(mpool(arg), (yyvsp[-1].exp)); (yyval.exp) = new_prim_array( mpool(arg), array, (yyloc)); } -#line 4627 "src/parser.c" +#line 4635 "src/parser.c" break; case 342: /* prim_exp: "{" dict_list "}" */ -#line 1157 "src/gwion.y" +#line 1166 "src/gwion.y" { (yyval.exp) = new_prim_dict( mpool(arg), (yyvsp[-1].exp), (yyloc)); } -#line 4633 "src/parser.c" +#line 4641 "src/parser.c" break; case 343: /* prim_exp: range */ -#line 1158 "src/gwion.y" +#line 1167 "src/gwion.y" { (yyval.exp) = new_prim_range( mpool(arg), (yyvsp[0].range), (yyloc)); } -#line 4639 "src/parser.c" +#line 4647 "src/parser.c" break; case 344: /* prim_exp: "<<<" exp ">>>" */ -#line 1159 "src/gwion.y" +#line 1168 "src/gwion.y" { (yyval.exp) = new_prim_hack( mpool(arg), (yyvsp[-1].exp), (yyloc)); } -#line 4645 "src/parser.c" +#line 4653 "src/parser.c" break; case 345: /* prim_exp: "(" exp ")" */ -#line 1160 "src/gwion.y" +#line 1169 "src/gwion.y" { (yyval.exp) = (yyvsp[-1].exp); if(!(yyvsp[-1].exp)->next) (yyval.exp)->paren = true; } -#line 4651 "src/parser.c" +#line 4659 "src/parser.c" break; case 346: /* prim_exp: "`foo`" */ -#line 1161 "src/gwion.y" +#line 1170 "src/gwion.y" { const loc_t loc = { .first = { .line = (yylsp[0]).first.line, .column = (yylsp[0]).first.column - 1}, .last = { .line = (yylsp[0]).last.line, .column = (yylsp[0]).last.column - 1}}; (yyval.exp) = new_prim_id(mpool(arg), (yyvsp[0].sym), loc); (yyval.exp)->d.prim.prim_type = ae_prim_locale; } -#line 4662 "src/parser.c" +#line 4670 "src/parser.c" break; case 347: /* prim_exp: lambda_arg captures code_list */ -#line 1167 "src/gwion.y" +#line 1176 "src/gwion.y" { (yyval.exp) = new_exp_lambda( mpool(arg), lambda_name(arg->st, (yylsp[-2]).first), (yyvsp[-2].arg_list), (yyvsp[0].stmt_list), (yylsp[-2])); (yyval.exp)->d.exp_lambda.def->captures = (yyvsp[-1].captures);} -#line 4668 "src/parser.c" +#line 4676 "src/parser.c" break; case 348: /* prim_exp: lambda_arg captures "{" binary_exp "}" */ -#line 1168 "src/gwion.y" +#line 1177 "src/gwion.y" { (yyval.exp) = new_exp_lambda2( mpool(arg), lambda_name(arg->st, (yylsp[-4]).first), (yyvsp[-4].arg_list), (yyvsp[-1].exp), (yylsp[-4])); (yyval.exp)->d.exp_lambda.def->captures = (yyvsp[-3].captures);} -#line 4674 "src/parser.c" +#line 4682 "src/parser.c" break; case 349: /* prim_exp: "(" op_op ")" */ -#line 1169 "src/gwion.y" +#line 1178 "src/gwion.y" { (yyval.exp) = new_prim_id( mpool(arg), (yyvsp[-1].sym), (yyloc)); (yyval.exp)->paren = true; } -#line 4680 "src/parser.c" +#line 4688 "src/parser.c" break; case 350: /* prim_exp: "perform" opt_id */ -#line 1170 "src/gwion.y" +#line 1179 "src/gwion.y" { (yyval.exp) = new_prim_perform(mpool(arg), (yyvsp[0].sym), (yylsp[0])); } -#line 4686 "src/parser.c" +#line 4694 "src/parser.c" break; case 351: /* prim_exp: "(" ")" */ -#line 1171 "src/gwion.y" +#line 1180 "src/gwion.y" { (yyval.exp) = new_prim_nil( mpool(arg), (yyloc)); } -#line 4692 "src/parser.c" +#line 4700 "src/parser.c" break; -#line 4696 "src/parser.c" +#line 4704 "src/parser.c" default: break; } @@ -4769,7 +4777,7 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] } yyerror (&yylloc, arg, yymsgp); if (yysyntax_error_status == YYENOMEM) - goto yyexhaustedlab; + YYNOMEM; } } @@ -4806,6 +4814,7 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; + ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -4869,7 +4878,7 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] `-------------------------------------*/ yyacceptlab: yyresult = 0; - goto yyreturn; + goto yyreturnlab; /*-----------------------------------. @@ -4877,24 +4886,22 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] `-----------------------------------*/ yyabortlab: yyresult = 1; - goto yyreturn; + goto yyreturnlab; -#if 1 -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ yyexhaustedlab: yyerror (&yylloc, arg, YY_("memory exhausted")); yyresult = 2; - goto yyreturn; -#endif + goto yyreturnlab; -/*-------------------------------------------------------. -| yyreturn -- parsing is finished, clean up and return. | -`-------------------------------------------------------*/ -yyreturn: +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at @@ -4922,7 +4929,7 @@ mp_vector_add(mpool(arg), &(yyvsp[-1].handler_list).handlers, Handler, (yyvsp[0] return yyresult; } -#line 1173 "src/gwion.y" +#line 1182 "src/gwion.y" #undef scan ANN static int parser_error(const loc_t *loc, Scanner *const scan, const char* diagnostic, const uint error_code) {