diff options
-rw-r--r-- | NEWS | 17 | ||||
-rw-r--r-- | awk.h | 9 | ||||
-rw-r--r-- | awkgram.c | 2121 | ||||
-rw-r--r-- | awkgram.y | 70 | ||||
-rw-r--r-- | builtin.c | 27 | ||||
-rw-r--r-- | debug.c | 8 | ||||
-rw-r--r-- | doc/ChangeLog | 6 | ||||
-rw-r--r-- | doc/gawk.1 | 1 | ||||
-rw-r--r-- | doc/gawk.info | 1052 | ||||
-rw-r--r-- | doc/gawk.texi | 75 | ||||
-rw-r--r-- | doc/gawktexi.in | 75 | ||||
-rw-r--r-- | eval.c | 6 | ||||
-rw-r--r-- | interpret.h | 4 | ||||
-rw-r--r-- | profile.c | 23 | ||||
-rw-r--r-- | re.c | 6 | ||||
-rw-r--r-- | test/ChangeLog | 11 | ||||
-rw-r--r-- | test/Makefile.am | 8 | ||||
-rw-r--r-- | test/Makefile.in | 38 | ||||
-rw-r--r-- | test/Maketests | 30 | ||||
-rw-r--r-- | test/gsubind.awk | 9 | ||||
-rw-r--r-- | test/gsubind.ok | 2 | ||||
-rw-r--r-- | test/typeof1.awk | 6 | ||||
-rw-r--r-- | test/typeof1.ok | 3 | ||||
-rw-r--r-- | test/typeof3.awk | 12 | ||||
-rw-r--r-- | test/typeof3.ok | 3 |
25 files changed, 2032 insertions, 1590 deletions
@@ -59,21 +59,26 @@ Changes from 4.1.x to 4.2.0 mode when FS = " " where newline was not a field separator. The code and doc have been updated. -15. The new typeof() function can be used to indicate if a variable or - array element is an array, string or number. The isarray() +15. Gawk now supports strongly typed regexp constants. Such constants + look like @/.../. You can assign them to variables, pass them to + functions, use them in ~, !~ and the case part of a switch statement. + More details are provided in the manual. + +16. The new typeof() function can be used to indicate if a variable or + array element is an array, regexp, string or number. The isarray() function is deprecated in favor of typeof(). -16. As promised when 4.1 was released, the old extension mechanism, +17. As promised when 4.1 was released, the old extension mechanism, using the `extension' function, is now gone. -17. Support for GNU/Linux on Alpha systems has been removed. +18. Support for GNU/Linux on Alpha systems has been removed. -18. Optimizations are now enabled by default. Use the new -s/--no-optimize +19. Optimizations are now enabled by default. Use the new -s/--no-optimize option(s) to disable them. Pretty printing and profiling automatically disable optimizations so that the output program is the same as the original input program. -19. The extension API now provides a mechanism for generating nonfatal +20. The extension API now provides a mechanism for generating nonfatal error messages. 20. Gawk now uses fwrite_unlocked if it's available. The yields a 7% - 18% @@ -267,6 +267,7 @@ typedef enum nodevals { Node_val, /* node is a value - type in flags */ Node_regex, /* a regexp, text, compiled, flags, etc */ Node_dynregex, /* a dynamic regexp */ + Node_typedregex, /* like Node_regex, but is a real type */ /* symbol table values */ Node_var, /* scalar variable, lnode is value */ @@ -1816,6 +1817,9 @@ dupnode(NODE *n) static inline NODE * force_string(NODE *s) { + if (s->type == Node_typedregex) + return dupnode(s->re_exp); + if ((s->flags & STRCUR) != 0 && (s->stfmt == STFMT_UNUSED || s->stfmt == CONVFMTidx) ) @@ -1842,6 +1846,9 @@ unref(NODE *r) static inline NODE * force_number(NODE *n) { + if (n->type == Node_typedregex) + return Nnull_string; + return (n->flags & NUMCUR) != 0 ? n : str2number(n); } @@ -1866,7 +1873,7 @@ force_number(NODE *n) static inline NODE * fixtype(NODE *n) { - assert(n->type == Node_val); + assert(n->type == Node_val || n->type == Node_typedregex); if (n->type == Node_val) { if ((n->flags & MAYBE_NUM) != 0) return force_number(n); @@ -249,51 +249,52 @@ extern int yydebug; FILENAME = 261, YNUMBER = 262, YSTRING = 263, - RELOP = 264, - IO_OUT = 265, - IO_IN = 266, - ASSIGNOP = 267, - ASSIGN = 268, - MATCHOP = 269, - CONCAT_OP = 270, - SUBSCRIPT = 271, - LEX_BEGIN = 272, - LEX_END = 273, - LEX_IF = 274, - LEX_ELSE = 275, - LEX_RETURN = 276, - LEX_DELETE = 277, - LEX_SWITCH = 278, - LEX_CASE = 279, - LEX_DEFAULT = 280, - LEX_WHILE = 281, - LEX_DO = 282, - LEX_FOR = 283, - LEX_BREAK = 284, - LEX_CONTINUE = 285, - LEX_PRINT = 286, - LEX_PRINTF = 287, - LEX_NEXT = 288, - LEX_EXIT = 289, - LEX_FUNCTION = 290, - LEX_BEGINFILE = 291, - LEX_ENDFILE = 292, - LEX_GETLINE = 293, - LEX_NEXTFILE = 294, - LEX_IN = 295, - LEX_AND = 296, - LEX_OR = 297, - INCREMENT = 298, - DECREMENT = 299, - LEX_BUILTIN = 300, - LEX_LENGTH = 301, - LEX_EOF = 302, - LEX_INCLUDE = 303, - LEX_EVAL = 304, - LEX_LOAD = 305, - NEWLINE = 306, - SLASH_BEFORE_EQUAL = 307, - UNARY = 308 + TYPED_REGEXP = 264, + RELOP = 265, + IO_OUT = 266, + IO_IN = 267, + ASSIGNOP = 268, + ASSIGN = 269, + MATCHOP = 270, + CONCAT_OP = 271, + SUBSCRIPT = 272, + LEX_BEGIN = 273, + LEX_END = 274, + LEX_IF = 275, + LEX_ELSE = 276, + LEX_RETURN = 277, + LEX_DELETE = 278, + LEX_SWITCH = 279, + LEX_CASE = 280, + LEX_DEFAULT = 281, + LEX_WHILE = 282, + LEX_DO = 283, + LEX_FOR = 284, + LEX_BREAK = 285, + LEX_CONTINUE = 286, + LEX_PRINT = 287, + LEX_PRINTF = 288, + LEX_NEXT = 289, + LEX_EXIT = 290, + LEX_FUNCTION = 291, + LEX_BEGINFILE = 292, + LEX_ENDFILE = 293, + LEX_GETLINE = 294, + LEX_NEXTFILE = 295, + LEX_IN = 296, + LEX_AND = 297, + LEX_OR = 298, + INCREMENT = 299, + DECREMENT = 300, + LEX_BUILTIN = 301, + LEX_LENGTH = 302, + LEX_EOF = 303, + LEX_INCLUDE = 304, + LEX_EVAL = 305, + LEX_LOAD = 306, + NEWLINE = 307, + SLASH_BEFORE_EQUAL = 308, + UNARY = 309 }; #endif /* Tokens. */ @@ -303,51 +304,52 @@ extern int yydebug; #define FILENAME 261 #define YNUMBER 262 #define YSTRING 263 -#define RELOP 264 -#define IO_OUT 265 -#define IO_IN 266 -#define ASSIGNOP 267 -#define ASSIGN 268 -#define MATCHOP 269 -#define CONCAT_OP 270 -#define SUBSCRIPT 271 -#define LEX_BEGIN 272 -#define LEX_END 273 -#define LEX_IF 274 -#define LEX_ELSE 275 -#define LEX_RETURN 276 -#define LEX_DELETE 277 -#define LEX_SWITCH 278 -#define LEX_CASE 279 -#define LEX_DEFAULT 280 -#define LEX_WHILE 281 -#define LEX_DO 282 -#define LEX_FOR 283 -#define LEX_BREAK 284 -#define LEX_CONTINUE 285 -#define LEX_PRINT 286 -#define LEX_PRINTF 287 -#define LEX_NEXT 288 -#define LEX_EXIT 289 -#define LEX_FUNCTION 290 -#define LEX_BEGINFILE 291 -#define LEX_ENDFILE 292 -#define LEX_GETLINE 293 -#define LEX_NEXTFILE 294 -#define LEX_IN 295 -#define LEX_AND 296 -#define LEX_OR 297 -#define INCREMENT 298 -#define DECREMENT 299 -#define LEX_BUILTIN 300 -#define LEX_LENGTH 301 -#define LEX_EOF 302 -#define LEX_INCLUDE 303 -#define LEX_EVAL 304 -#define LEX_LOAD 305 -#define NEWLINE 306 -#define SLASH_BEFORE_EQUAL 307 -#define UNARY 308 +#define TYPED_REGEXP 264 +#define RELOP 265 +#define IO_OUT 266 +#define IO_IN 267 +#define ASSIGNOP 268 +#define ASSIGN 269 +#define MATCHOP 270 +#define CONCAT_OP 271 +#define SUBSCRIPT 272 +#define LEX_BEGIN 273 +#define LEX_END 274 +#define LEX_IF 275 +#define LEX_ELSE 276 +#define LEX_RETURN 277 +#define LEX_DELETE 278 +#define LEX_SWITCH 279 +#define LEX_CASE 280 +#define LEX_DEFAULT 281 +#define LEX_WHILE 282 +#define LEX_DO 283 +#define LEX_FOR 284 +#define LEX_BREAK 285 +#define LEX_CONTINUE 286 +#define LEX_PRINT 287 +#define LEX_PRINTF 288 +#define LEX_NEXT 289 +#define LEX_EXIT 290 +#define LEX_FUNCTION 291 +#define LEX_BEGINFILE 292 +#define LEX_ENDFILE 293 +#define LEX_GETLINE 294 +#define LEX_NEXTFILE 295 +#define LEX_IN 296 +#define LEX_AND 297 +#define LEX_OR 298 +#define INCREMENT 299 +#define DECREMENT 300 +#define LEX_BUILTIN 301 +#define LEX_LENGTH 302 +#define LEX_EOF 303 +#define LEX_INCLUDE 304 +#define LEX_EVAL 305 +#define LEX_LOAD 306 +#define NEWLINE 307 +#define SLASH_BEFORE_EQUAL 308 +#define UNARY 309 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED @@ -365,7 +367,7 @@ int yyparse (void); /* Copy the second part of user declarations. */ -#line 369 "awkgram.c" /* yacc.c:358 */ +#line 371 "awkgram.c" /* yacc.c:358 */ #ifdef short # undef short @@ -607,21 +609,21 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1147 +#define YYLAST 1236 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 75 +#define YYNTOKENS 76 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 69 +#define YYNNTS 70 /* YYNRULES -- Number of rules. */ -#define YYNRULES 198 +#define YYNRULES 203 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 345 +#define YYNSTATES 350 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 308 +#define YYMAXUTOK 309 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -633,16 +635,16 @@ static const yytype_uint8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 63, 2, 2, 66, 62, 2, 2, - 67, 68, 60, 58, 55, 59, 2, 61, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 54, 74, - 56, 2, 57, 53, 69, 2, 2, 2, 2, 2, + 2, 2, 2, 64, 2, 2, 67, 63, 2, 2, + 68, 69, 61, 59, 56, 60, 2, 62, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 55, 75, + 57, 2, 58, 54, 70, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 70, 2, 71, 65, 2, 2, 2, 2, 2, + 2, 71, 2, 72, 66, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 72, 2, 73, 2, 2, 2, 2, + 2, 2, 2, 73, 2, 74, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -660,7 +662,7 @@ static const yytype_uint8 yytranslate[] = 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 64 + 45, 46, 47, 48, 49, 50, 51, 52, 53, 65 }; #if YYDEBUG @@ -670,23 +672,24 @@ static const yytype_uint16 yyrline[] = 0, 214, 214, 216, 221, 222, 226, 238, 243, 254, 261, 267, 276, 284, 286, 291, 299, 301, 307, 315, 325, 355, 369, 383, 391, 402, 414, 416, 418, 424, - 432, 433, 437, 437, 483, 482, 516, 518, 523, 533, - 580, 585, 586, 590, 592, 594, 601, 691, 733, 775, - 888, 895, 902, 913, 923, 933, 943, 955, 972, 971, - 996, 1008, 1008, 1107, 1107, 1141, 1172, 1181, 1182, 1188, - 1189, 1196, 1201, 1213, 1227, 1229, 1237, 1242, 1244, 1255, - 1257, 1266, 1267, 1275, 1280, 1280, 1291, 1295, 1303, 1304, - 1307, 1309, 1314, 1315, 1324, 1325, 1330, 1335, 1344, 1346, - 1348, 1355, 1356, 1362, 1363, 1368, 1370, 1375, 1377, 1385, - 1390, 1399, 1400, 1405, 1407, 1412, 1414, 1422, 1427, 1435, - 1440, 1447, 1449, 1451, 1468, 1478, 1485, 1487, 1492, 1494, - 1496, 1504, 1506, 1511, 1513, 1518, 1520, 1522, 1578, 1580, - 1582, 1584, 1586, 1588, 1590, 1592, 1606, 1611, 1616, 1641, - 1647, 1649, 1651, 1653, 1655, 1657, 1662, 1666, 1698, 1700, - 1706, 1712, 1725, 1726, 1727, 1732, 1737, 1741, 1745, 1760, - 1773, 1778, 1815, 1844, 1845, 1851, 1852, 1857, 1859, 1866, - 1883, 1900, 1902, 1909, 1914, 1922, 1932, 1944, 1953, 1957, - 1961, 1965, 1969, 1973, 1976, 1978, 1982, 1986, 1990 + 432, 433, 437, 437, 483, 482, 516, 538, 540, 545, + 555, 602, 607, 608, 612, 614, 616, 623, 713, 755, + 797, 910, 917, 924, 935, 945, 955, 965, 977, 994, + 993, 1018, 1030, 1030, 1129, 1129, 1163, 1194, 1203, 1204, + 1210, 1211, 1218, 1223, 1235, 1249, 1251, 1259, 1264, 1266, + 1274, 1283, 1285, 1294, 1295, 1303, 1308, 1308, 1319, 1323, + 1331, 1332, 1335, 1337, 1342, 1343, 1352, 1353, 1358, 1363, + 1372, 1374, 1376, 1383, 1384, 1390, 1391, 1396, 1398, 1403, + 1405, 1413, 1418, 1427, 1428, 1433, 1435, 1440, 1442, 1450, + 1455, 1463, 1464, 1469, 1476, 1480, 1482, 1484, 1497, 1514, + 1524, 1531, 1533, 1538, 1540, 1542, 1550, 1552, 1557, 1559, + 1564, 1566, 1568, 1624, 1626, 1628, 1630, 1632, 1634, 1636, + 1638, 1652, 1657, 1662, 1687, 1693, 1695, 1697, 1699, 1701, + 1703, 1708, 1712, 1744, 1746, 1752, 1758, 1771, 1772, 1773, + 1778, 1783, 1787, 1791, 1806, 1819, 1824, 1861, 1890, 1891, + 1897, 1898, 1903, 1905, 1912, 1929, 1946, 1948, 1955, 1960, + 1968, 1978, 1990, 1999, 2003, 2007, 2011, 2015, 2019, 2022, + 2024, 2028, 2032, 2036 }; #endif @@ -696,31 +699,32 @@ static const yytype_uint16 yyrline[] = static const char *const yytname[] = { "$end", "error", "$undefined", "FUNC_CALL", "NAME", "REGEXP", - "FILENAME", "YNUMBER", "YSTRING", "RELOP", "IO_OUT", "IO_IN", "ASSIGNOP", - "ASSIGN", "MATCHOP", "CONCAT_OP", "SUBSCRIPT", "LEX_BEGIN", "LEX_END", - "LEX_IF", "LEX_ELSE", "LEX_RETURN", "LEX_DELETE", "LEX_SWITCH", - "LEX_CASE", "LEX_DEFAULT", "LEX_WHILE", "LEX_DO", "LEX_FOR", "LEX_BREAK", - "LEX_CONTINUE", "LEX_PRINT", "LEX_PRINTF", "LEX_NEXT", "LEX_EXIT", - "LEX_FUNCTION", "LEX_BEGINFILE", "LEX_ENDFILE", "LEX_GETLINE", - "LEX_NEXTFILE", "LEX_IN", "LEX_AND", "LEX_OR", "INCREMENT", "DECREMENT", - "LEX_BUILTIN", "LEX_LENGTH", "LEX_EOF", "LEX_INCLUDE", "LEX_EVAL", - "LEX_LOAD", "NEWLINE", "SLASH_BEFORE_EQUAL", "'?'", "':'", "','", "'<'", - "'>'", "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "UNARY", "'^'", "'$'", - "'('", "')'", "'@'", "'['", "']'", "'{'", "'}'", "';'", "$accept", - "program", "rule", "source", "library", "pattern", "action", "func_name", - "lex_builtin", "function_prologue", "$@1", "regexp", "$@2", "a_slash", - "statements", "statement_term", "statement", "non_compound_stmt", "$@3", - "simple_stmt", "$@4", "$@5", "opt_simple_stmt", "case_statements", - "case_statement", "case_value", "print", "print_expression_list", - "output_redir", "$@6", "if_statement", "nls", "opt_nls", "input_redir", - "opt_param_list", "param_list", "opt_exp", "opt_expression_list", - "expression_list", "opt_fcall_expression_list", "fcall_expression_list", - "fcall_exp", "exp", "assign_operator", "relop_or_less", "a_relop", - "common_exp", "simp_exp", "simp_exp_nc", "non_post_simp_exp", - "func_call", "direct_func_call", "opt_variable", "delete_subscript_list", - "delete_subscript", "delete_exp_list", "bracketed_exp_list", "subscript", - "subscript_list", "simple_variable", "variable", "opt_incdec", "l_brace", - "r_brace", "r_paren", "opt_semi", "semi", "colon", "comma", YY_NULLPTR + "FILENAME", "YNUMBER", "YSTRING", "TYPED_REGEXP", "RELOP", "IO_OUT", + "IO_IN", "ASSIGNOP", "ASSIGN", "MATCHOP", "CONCAT_OP", "SUBSCRIPT", + "LEX_BEGIN", "LEX_END", "LEX_IF", "LEX_ELSE", "LEX_RETURN", "LEX_DELETE", + "LEX_SWITCH", "LEX_CASE", "LEX_DEFAULT", "LEX_WHILE", "LEX_DO", + "LEX_FOR", "LEX_BREAK", "LEX_CONTINUE", "LEX_PRINT", "LEX_PRINTF", + "LEX_NEXT", "LEX_EXIT", "LEX_FUNCTION", "LEX_BEGINFILE", "LEX_ENDFILE", + "LEX_GETLINE", "LEX_NEXTFILE", "LEX_IN", "LEX_AND", "LEX_OR", + "INCREMENT", "DECREMENT", "LEX_BUILTIN", "LEX_LENGTH", "LEX_EOF", + "LEX_INCLUDE", "LEX_EVAL", "LEX_LOAD", "NEWLINE", "SLASH_BEFORE_EQUAL", + "'?'", "':'", "','", "'<'", "'>'", "'+'", "'-'", "'*'", "'/'", "'%'", + "'!'", "UNARY", "'^'", "'$'", "'('", "')'", "'@'", "'['", "']'", "'{'", + "'}'", "';'", "$accept", "program", "rule", "source", "library", + "pattern", "action", "func_name", "lex_builtin", "function_prologue", + "$@1", "regexp", "$@2", "typed_regexp", "a_slash", "statements", + "statement_term", "statement", "non_compound_stmt", "$@3", "simple_stmt", + "$@4", "$@5", "opt_simple_stmt", "case_statements", "case_statement", + "case_value", "print", "print_expression_list", "output_redir", "$@6", + "if_statement", "nls", "opt_nls", "input_redir", "opt_param_list", + "param_list", "opt_exp", "opt_expression_list", "expression_list", + "opt_fcall_expression_list", "fcall_expression_list", "fcall_exp", "exp", + "assign_operator", "relop_or_less", "a_relop", "common_exp", "simp_exp", + "simp_exp_nc", "non_post_simp_exp", "func_call", "direct_func_call", + "opt_variable", "delete_subscript_list", "delete_subscript", + "delete_exp_list", "bracketed_exp_list", "subscript", "subscript_list", + "simple_variable", "variable", "opt_incdec", "l_brace", "r_brace", + "r_paren", "opt_semi", "semi", "colon", "comma", YY_NULLPTR }; #endif @@ -734,61 +738,61 @@ static const yytype_uint16 yytoknum[] = 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, 63, 58, 44, 60, 62, 43, 45, - 42, 47, 37, 33, 308, 94, 36, 40, 41, 64, - 91, 93, 123, 125, 59 + 305, 306, 307, 308, 63, 58, 44, 60, 62, 43, + 45, 42, 47, 37, 33, 309, 94, 36, 40, 41, + 64, 91, 93, 123, 125, 59 }; # endif -#define YYPACT_NINF -280 +#define YYPACT_NINF -275 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-280))) + (!!((Yystate) == (-275))) -#define YYTABLE_NINF -113 +#define YYTABLE_NINF -115 #define yytable_value_is_error(Yytable_value) \ - (!!((Yytable_value) == (-113))) + (!!((Yytable_value) == (-115))) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { - -280, 341, -280, -280, -30, -14, -280, -280, -280, -280, - 235, -280, -280, 56, 56, 56, 64, 69, -280, -280, - -280, 1011, 1011, -280, 1011, 1057, 786, 206, -280, -22, - -3, -280, -280, 31, 723, 984, 336, 408, -280, -280, - -280, -280, 169, 754, 786, -280, 5, -280, -280, -280, - -280, -280, 88, 87, -280, 103, -280, -280, -280, 754, - 754, 158, 98, 4, 98, 98, 1011, 77, -280, -280, - 61, 313, 45, 127, -280, 120, -280, -280, -280, 31, - -280, 120, -280, 168, -280, -280, 1011, 182, 1011, 1011, - 1011, 120, -280, -280, -280, 1011, 149, 336, 1011, 1011, - 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, - -280, -280, -280, -280, 175, 1011, -280, 122, 129, -280, - 1026, 15, 1026, -280, -280, -280, -280, 1011, -280, 122, - 122, 313, -280, -280, -280, 1011, 120, -280, 152, 832, - -280, -280, 17, -19, -280, 44, -19, 31, -280, 561, - -280, -280, 151, -280, 311, 231, 1090, 1011, 190, 56, - -26, -26, 98, 98, 98, 98, -26, -26, 98, 98, - 98, 98, -280, 1026, -280, 1011, 859, -280, 40, 336, - -280, -280, 1026, -280, 182, -280, 1026, -280, -280, -280, - -280, -280, 124, -280, 26, 135, 144, 120, 150, -19, - -19, -280, -280, -19, 1011, -19, 120, -280, -280, -19, - -280, -280, 1026, -280, 142, 120, 1011, 1026, -280, -280, - -280, -280, -280, -280, 122, 138, -280, 1011, 1011, -280, - 215, 1011, 1011, 675, 905, -280, -280, -280, -19, 1026, - -280, -280, -280, 607, 561, 120, -280, -280, 1026, 120, - -280, 154, 313, -19, -14, 155, 313, 313, 196, 9, - -280, 142, -280, 786, 219, -280, 16, -280, -280, -280, - -280, -280, 120, -280, -280, 8, -280, -280, -280, 120, - 120, 165, 182, 120, 61, -280, -280, 675, -280, -280, - -3, 675, 1011, 122, 708, 152, 1011, 216, -280, -280, - 313, 120, 256, 120, 984, 120, 3, 120, 675, 120, - 938, 675, -280, 366, 194, -280, 176, -280, -280, 938, - 122, -280, -280, -280, 243, 246, -280, 194, -280, 120, - -280, 122, 120, -280, -280, 120, -280, 120, 675, -280, - 413, 675, -280, 487, -280 + -275, 376, -275, -275, -12, -9, -275, -275, -275, -275, + 171, -275, -275, 44, 44, 44, 5, 40, -275, -275, + -275, 1139, 1139, -275, 1139, 1166, 869, 27, -275, -18, + 2, -275, -275, 89, 884, 1065, 192, 214, -275, -275, + -275, -275, 248, 795, 869, -275, 10, -275, -275, -275, + -275, -275, 116, 82, -275, 115, -275, -275, -275, 795, + 795, 166, 107, 104, 107, 107, 1139, 117, -275, -275, + 15, 349, 23, 45, -275, 125, -275, -275, -275, 89, + -275, 125, -275, 178, -275, -275, 1092, 172, 1139, 1139, + 1139, 125, -275, -275, -275, 1139, 146, 192, 1139, 1139, + 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139, + -275, 181, -275, -275, 173, 1139, -275, -275, -275, 128, + 73, -275, 1107, 14, 1107, -275, -275, -275, -275, 1139, + -275, 128, 128, 349, -275, -275, -275, 1139, 125, -275, + 152, 916, -275, -275, 16, 92, -275, 20, 92, 89, + -275, 599, -275, -275, -275, 148, -275, 124, 22, 1048, + 1139, 199, 44, 265, 265, 107, 107, 107, 107, 265, + 265, 107, 107, 107, 107, -275, -275, 1107, -275, 1092, + 842, -275, 43, 192, -275, -275, 1107, -275, 172, -275, + 1107, -275, -275, -275, -275, -275, 133, -275, 41, 144, + 145, 125, 147, 92, 92, -275, -275, 92, 1139, 92, + 125, -275, -275, 92, -275, -275, 1107, -275, 151, 125, + 1139, 1107, -275, -275, -275, -275, -275, -275, 128, 76, + -275, 1139, 1139, -275, 224, 1139, 1139, 715, 949, -275, + -275, -275, 92, 1107, -275, -275, -275, 646, 599, 125, + -275, -275, 1107, 125, -275, 49, 349, 92, -9, 160, + 349, 349, 206, 113, -275, 151, -275, 869, 225, -275, + 169, -275, -275, -275, -275, -275, 125, -275, -275, 11, + -275, -275, -275, 125, 125, 179, 172, 125, 15, -275, + -275, 715, -275, -275, 2, 715, 1139, 128, 762, 152, + 1139, 219, -275, -275, 349, 125, 275, 125, 1065, 125, + 112, 125, 715, 125, 997, 715, -275, 261, 205, -275, + 191, -275, -275, 997, 128, -275, -275, -275, 271, 272, + -275, -275, 205, -275, 125, -275, 128, 125, -275, -275, + 125, -275, 125, 715, -275, 449, 715, -275, 524, -275 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -796,65 +800,65 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 2, 0, 1, 6, 0, 184, 166, 167, 21, 22, - 0, 23, 24, 173, 0, 0, 0, 161, 5, 88, - 37, 0, 0, 36, 0, 0, 0, 0, 3, 0, - 0, 156, 34, 4, 19, 127, 135, 136, 138, 162, - 170, 186, 163, 0, 0, 181, 0, 185, 27, 26, - 30, 31, 0, 0, 28, 92, 174, 164, 165, 0, - 0, 0, 169, 163, 168, 157, 0, 190, 163, 107, - 0, 105, 0, 0, 171, 90, 196, 7, 8, 41, - 38, 90, 9, 0, 89, 131, 0, 0, 0, 0, - 0, 90, 132, 134, 133, 0, 0, 137, 0, 0, + 2, 0, 1, 6, 0, 189, 171, 172, 21, 22, + 0, 23, 24, 178, 0, 0, 0, 166, 5, 90, + 38, 0, 0, 37, 0, 0, 0, 0, 3, 0, + 0, 161, 34, 4, 19, 132, 140, 141, 143, 167, + 175, 191, 168, 0, 0, 186, 0, 190, 27, 26, + 30, 31, 0, 0, 28, 94, 179, 169, 170, 0, + 0, 0, 174, 168, 173, 162, 0, 195, 168, 109, + 0, 107, 0, 0, 176, 92, 201, 7, 8, 42, + 39, 92, 9, 0, 91, 136, 0, 0, 0, 0, + 0, 92, 137, 139, 138, 0, 0, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 129, 128, 146, 147, 0, 0, 115, 0, 0, 113, - 119, 0, 105, 183, 182, 29, 32, 0, 145, 0, - 0, 0, 188, 189, 187, 108, 90, 193, 0, 0, - 158, 14, 0, 0, 17, 0, 0, 91, 191, 0, - 42, 35, 123, 124, 121, 122, 0, 0, 125, 173, - 143, 144, 140, 141, 142, 139, 154, 155, 151, 152, - 153, 150, 130, 120, 172, 116, 0, 180, 0, 93, - 159, 160, 109, 198, 0, 110, 106, 13, 10, 16, - 11, 40, 0, 58, 0, 0, 0, 90, 0, 0, - 0, 79, 80, 0, 101, 0, 90, 39, 52, 0, - 61, 45, 66, 38, 194, 90, 0, 20, 149, 117, - 118, 114, 98, 96, 0, 0, 148, 0, 101, 63, - 0, 0, 0, 0, 67, 53, 54, 55, 0, 102, - 56, 192, 60, 0, 0, 90, 195, 43, 126, 90, - 99, 0, 0, 0, 175, 0, 0, 0, 0, 184, - 68, 0, 57, 0, 83, 81, 0, 44, 25, 33, - 100, 97, 90, 59, 64, 0, 177, 179, 65, 90, - 90, 0, 0, 90, 0, 84, 62, 0, 176, 178, - 0, 0, 0, 0, 0, 82, 0, 86, 69, 47, - 0, 90, 0, 90, 85, 90, 0, 90, 0, 90, - 67, 0, 71, 0, 0, 70, 0, 48, 49, 67, - 0, 87, 74, 77, 0, 0, 78, 0, 197, 90, - 46, 0, 90, 76, 75, 90, 38, 90, 0, 38, - 0, 0, 51, 0, 50 + 134, 133, 151, 152, 0, 0, 117, 36, 122, 0, + 0, 115, 121, 0, 107, 188, 187, 29, 32, 0, + 150, 0, 0, 0, 193, 194, 192, 110, 92, 198, + 0, 0, 163, 14, 0, 0, 17, 0, 0, 93, + 196, 0, 43, 35, 127, 128, 129, 125, 126, 0, + 0, 130, 178, 148, 149, 145, 146, 147, 144, 159, + 160, 156, 157, 158, 155, 124, 135, 123, 177, 118, + 0, 185, 0, 95, 164, 165, 111, 203, 0, 112, + 108, 13, 10, 16, 11, 41, 0, 59, 0, 0, + 0, 92, 0, 0, 0, 81, 82, 0, 103, 0, + 92, 40, 53, 0, 62, 46, 67, 39, 199, 92, + 0, 20, 154, 119, 120, 116, 100, 98, 0, 0, + 153, 0, 103, 64, 0, 0, 0, 0, 68, 54, + 55, 56, 0, 104, 57, 197, 61, 0, 0, 92, + 200, 44, 131, 92, 101, 0, 0, 0, 180, 0, + 0, 0, 0, 189, 69, 0, 58, 0, 85, 83, + 0, 45, 25, 33, 102, 99, 92, 60, 65, 0, + 182, 184, 66, 92, 92, 0, 0, 92, 0, 86, + 63, 0, 181, 183, 0, 0, 0, 0, 0, 84, + 0, 88, 70, 48, 0, 92, 0, 92, 87, 92, + 0, 92, 0, 92, 68, 0, 72, 0, 0, 71, + 0, 49, 50, 68, 0, 89, 75, 78, 0, 0, + 79, 80, 0, 202, 92, 47, 0, 92, 77, 76, + 92, 39, 92, 0, 39, 0, 0, 52, 0, 51 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -280, -280, -280, -280, -280, -280, 228, -280, -280, -280, - -280, -54, -280, -280, -212, -33, -176, -280, -280, -227, - -280, -280, -279, -280, -280, -280, -280, -280, -280, -280, - -280, 52, 28, -280, -280, -280, 32, -280, -39, 93, - -280, 2, -1, -280, -280, -280, -29, 42, -280, 241, - -280, 11, 109, -280, -280, -6, -40, -280, -280, -72, - -2, -280, -27, -236, -56, -280, -20, -51, -108 + -275, -275, -275, -275, -275, -275, 252, -275, -275, -275, + -275, -33, -275, -80, -275, -213, 100, -144, -275, -275, + -231, -275, -275, -274, -275, -275, -275, -275, -275, -275, + -275, -275, 7, 62, -275, -275, -275, 54, -275, -43, + 1, -275, -23, -1, -275, -275, -275, -13, 17, -275, + 263, -275, 8, 127, -275, -275, 21, -36, -275, -275, + -78, -2, -275, -27, -230, -65, -275, -15, -38, -94 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 1, 28, 143, 146, 29, 77, 53, 54, 30, - 178, 31, 83, 32, 149, 78, 207, 208, 228, 209, - 243, 254, 261, 306, 315, 327, 210, 264, 286, 296, - 211, 147, 148, 128, 224, 225, 238, 265, 70, 117, - 118, 119, 212, 115, 94, 95, 35, 36, 37, 38, - 39, 40, 55, 274, 275, 276, 45, 46, 47, 41, - 42, 134, 213, 214, 140, 245, 215, 329, 139 + -1, 1, 28, 145, 148, 29, 77, 53, 54, 30, + 182, 31, 83, 118, 32, 151, 78, 211, 212, 232, + 213, 247, 258, 265, 310, 319, 332, 214, 268, 290, + 300, 215, 149, 150, 130, 228, 229, 242, 269, 70, + 119, 120, 121, 216, 115, 94, 95, 35, 36, 37, + 38, 39, 40, 55, 278, 279, 280, 45, 46, 47, + 41, 42, 136, 217, 218, 142, 249, 219, 334, 141 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -862,306 +866,325 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 34, 244, 80, 80, 312, 121, 124, 260, 267, 81, - 176, 56, 57, 58, 138, 153, 135, 135, 187, 63, - 63, 123, 63, 68, 288, 71, -104, 313, 314, 19, - 229, 320, 19, 63, 100, 101, 102, 43, 74, 103, - 331, 222, 120, 122, 223, 189, 141, 112, 113, 282, - 75, 142, 76, 33, 19, 76, 44, 258, 120, 120, - 5, 174, 135, 62, 64, 131, 65, -104, -12, 75, - 136, 136, 74, 180, 181, 44, -90, 97, 44, 44, - 330, 79, 84, 260, -104, 152, 177, 154, 155, 156, - -104, -12, 260, 230, 158, -15, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, -94, 150, - 188, 297, 226, 190, 173, 299, 136, 251, -15, 157, - 132, 133, 25, 81, 340, 63, 81, 343, 144, 137, - 175, 59, 318, 145, 182, 321, 60, 125, 186, 250, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 129, 130, 126, 270, 217, 56, 271, 127, - 85, 4, 342, 103, 183, 344, 235, 236, 249, 179, - 237, 19, 240, 151, 120, 120, 242, 219, 221, 81, - 81, 110, 111, 81, 136, 81, 5, 159, 172, 81, - 137, 227, 184, 136, 246, 79, 272, -112, 79, -113, - 279, 280, 231, 239, 266, 262, -95, 92, 93, 4, - 293, 232, 112, 113, 277, 248, 76, 234, 81, 255, - 273, 114, 281, 278, 284, 233, 252, 239, 295, 285, - 256, 257, 292, 81, 241, 277, 305, 301, 48, 49, - 85, 283, 122, 247, 307, 86, -113, -113, 328, 206, - 333, 79, 79, 334, 72, 79, 73, 79, 82, 326, - 253, 79, 71, 298, 332, 85, 67, 304, 218, 289, - 86, 87, 88, 268, 303, 337, 335, 269, 0, 0, - 50, 51, 309, 0, 0, 0, 0, 92, 93, 0, - 79, 300, 0, 302, 63, 0, 87, 88, 89, 0, - 287, 0, 63, 0, 52, 79, 0, 290, 291, 90, - 0, 294, 92, 93, 0, 0, 0, 0, 0, 0, - 85, 0, 85, 0, 0, 86, 0, 86, 0, 308, - 76, 310, 0, 311, 316, 317, 0, 319, 0, 0, - 0, 2, 3, 0, 4, 5, 97, 0, 6, 7, - 0, 87, 0, 87, 88, 89, 0, 336, 8, 9, - 338, 0, 0, 339, 0, 341, 90, 92, 93, 92, - 93, 0, 0, 322, 323, 0, 10, 11, 12, 13, - 0, 137, 0, 0, 14, 15, 16, 17, 18, 0, - 0, 0, 19, 20, 98, 99, 100, 101, 102, 21, - 22, 103, 23, 0, 24, 0, 0, 25, 26, 0, - 27, 0, 0, -18, 191, -18, 4, 5, 20, 0, - 6, 7, 0, 0, 324, 325, 0, 23, 0, 0, - 0, 0, 192, 0, 193, 194, 195, -73, -73, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 0, 0, - 0, 13, 205, 0, 0, 0, 14, 15, 16, 17, - 0, 0, 0, 0, -73, 20, 104, 105, 106, 107, - 108, 21, 22, 109, 23, 0, 24, 0, 0, 25, - 26, 0, 61, 0, 0, 75, -73, 76, 191, 0, - 4, 5, 0, 0, 6, 7, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 192, 0, 193, 194, - 195, -72, -72, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 0, 0, 0, 13, 205, 0, 0, 0, - 14, 15, 16, 17, 0, 0, 0, 0, -72, 20, + 34, 123, 80, 80, 248, 140, 154, 264, 33, 156, + 126, 56, 57, 58, 81, 137, 137, 191, 271, 63, + 63, 193, 63, 68, 143, 71, 180, 125, 292, 144, + 4, 175, 85, 63, 19, 74, 79, 86, 62, 64, + 324, 65, 122, 124, 226, 233, 146, 227, 5, 336, + 274, 147, 97, 275, 178, 75, 43, 76, 122, 122, + 131, 132, 44, 87, 88, 133, 184, 185, -12, 74, + 138, 138, -15, 59, 179, 75, 72, 254, 73, 92, + 93, 44, 44, 264, 139, 155, 181, 157, 158, 159, + 335, -12, 264, 262, 161, -15, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, 60, 234, + 230, 25, -96, 316, 177, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 63, 345, 138, + 81, 348, 138, 81, 85, 255, 186, 317, 318, 86, + 190, 84, -114, 152, 19, -97, 183, 301, 112, 113, + 128, 303, 79, 160, 286, 79, 223, 225, 85, 221, + 56, 134, 135, 253, 19, 87, 127, 76, 322, 4, + 137, 325, 129, 103, 48, 49, 5, 19, 122, 122, + -106, 92, 93, 153, 44, 162, -92, 176, 81, 81, + 117, 276, 81, 188, 81, 283, 284, 139, 81, 347, + 187, 231, 349, 250, 270, 92, 93, 243, 297, -115, + 79, 79, 235, 236, 79, 238, 79, 50, 51, 252, + 79, -106, 281, 299, 288, 138, 76, 81, 259, 282, + 256, 243, 305, 285, 260, 261, 289, 331, -106, 311, + 309, 52, 81, 281, -106, 192, 124, 296, 194, 79, + 287, 98, 99, 100, 101, 102, -115, -115, 103, 337, + 333, 110, 111, 237, 79, 210, 71, 302, 326, 327, + 117, 342, 245, 104, 105, 106, 107, 108, 338, 339, + 109, 251, 82, 307, 330, 85, 257, 308, 67, 222, + 86, 313, 112, 113, 340, 304, 0, 306, 63, 0, + 293, 114, 0, 239, 240, 0, 63, 241, 0, 244, + 0, 272, 0, 246, 20, 273, 87, 88, 89, 0, + 328, 329, 0, 23, 0, 97, 100, 101, 102, 90, + 0, 103, 92, 93, 0, 0, 0, 0, 291, 0, + 0, 0, 266, 0, 0, 294, 295, 0, 0, 298, + 76, 0, 0, 0, 0, 0, 0, 277, 0, 85, + 0, 0, 0, 0, 86, 0, 0, 312, 0, 314, + 0, 315, 320, 321, 0, 323, 2, 3, 0, 4, + 5, 0, 0, 6, 7, 0, 0, 0, 0, 0, + 87, 88, 89, 0, 8, 9, 341, 0, 0, 343, + 0, 0, 344, 90, 346, 0, 92, 93, 0, 0, + 0, 0, 10, 11, 12, 13, 0, 0, 139, 0, + 14, 15, 16, 17, 18, 0, 0, 0, 19, 20, 0, 0, 0, 0, 0, 21, 22, 0, 23, 0, - 24, 0, 0, 25, 26, 0, 61, 0, 0, 75, - -72, 76, 191, 0, 4, 5, 0, 0, 6, 7, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 192, 0, 193, 194, 195, 0, 0, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 0, 0, 0, 13, - 205, 0, 0, 0, 14, 15, 16, 17, 69, 0, - 4, 5, 0, 20, 6, 7, 0, -103, 0, 21, - 22, 0, 23, 0, 24, 0, 0, 25, 26, 0, - 61, 0, 0, 75, 206, 76, 0, 0, 0, 0, + 24, 0, 0, 25, 26, 0, 27, 0, 0, -18, + 195, -18, 4, 5, 0, 0, 6, 7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 196, + 0, 197, 198, 199, -74, -74, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 0, 0, 0, 13, 209, + 0, 0, 0, 14, 15, 16, 17, 0, 0, 0, + 0, -74, 20, 0, 0, 0, 0, 0, 21, 22, + 0, 23, 0, 24, 0, 0, 25, 26, 0, 61, + 0, 0, 75, -74, 76, 195, 0, 4, 5, 0, + 0, 6, 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 196, 0, 197, 198, 199, -73, + -73, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 0, 0, 0, 13, 209, 0, 0, 0, 14, 15, + 16, 17, 0, 0, 0, 0, -73, 20, 0, 0, + 0, 0, 0, 21, 22, 0, 23, 0, 24, 0, + 0, 25, 26, 0, 61, 0, 0, 75, -73, 76, + 195, 0, 4, 5, 0, 0, 6, 7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 196, + 0, 197, 198, 199, 0, 0, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 0, 0, 0, 13, 209, + 0, 0, 0, 14, 15, 16, 17, 69, 0, 4, + 5, 0, 20, 6, 7, 0, 0, -105, 21, 22, + 0, 23, 0, 24, 0, 0, 25, 26, 0, 61, + 0, 0, 75, 210, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, - 14, 15, 16, 17, 0, 0, 0, 0, -103, 20, + 14, 15, 16, 17, 0, 0, 0, 0, -105, 20, 0, 0, 0, 0, 0, 21, 22, 0, 23, 0, - 24, 0, 0, 25, 263, -103, 61, 0, 4, 5, - 0, -103, 6, 7, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 192, 0, 193, 194, 195, 0, - 0, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 0, 4, 5, 13, 205, 6, 7, 0, 14, 15, - 16, 17, 0, 0, 0, 0, 0, 20, 0, 0, - 0, 0, 85, 21, 22, 0, 23, 86, 24, 0, - 0, 25, 26, 0, 61, 0, 13, 75, 0, 76, - 0, 14, 15, 16, 17, 116, 0, 4, 5, 0, - 20, 6, 7, 87, 88, 89, 21, 22, 0, 23, - 0, 24, 0, 0, 25, 26, 90, 61, 91, 92, - 93, 0, 76, 0, 0, 0, 0, 69, 0, 4, - 5, 0, 13, 6, 7, 0, 0, 14, 15, 16, - 17, 0, 0, 0, 0, 0, 20, 0, 0, 0, - 0, 0, 21, 22, 0, 23, 0, 24, 0, 0, - 25, 26, -111, 61, 13, 0, 0, 0, 0, 14, - 15, 16, 17, 185, 0, 4, 5, 0, 20, 6, + 24, 0, 0, 25, 267, -105, 61, 0, 4, 5, + 0, -105, 6, 7, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 196, 0, 197, 198, 199, + 0, 0, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 0, 0, 0, 13, 209, 0, 0, 0, 14, + 15, 16, 17, 0, 0, 4, 5, 0, 20, 6, 7, 0, 0, 0, 21, 22, 0, 23, 0, 24, - 0, 0, 25, 26, 0, 61, 0, 0, 0, 0, - 220, 0, 4, 5, 0, 0, 6, 7, 0, 0, - 13, 0, 0, 0, 0, 14, 15, 16, 17, 0, - 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, - 21, 22, 0, 23, 0, 24, 0, 13, 25, 26, - 0, 61, 14, 15, 16, 17, 0, 0, 4, 259, - 0, 20, 6, 7, 0, 0, 0, 21, 22, 0, - 23, 0, 24, 0, 0, 25, 26, 194, 61, 0, - 0, 0, 0, 0, 0, 0, 201, 202, 0, 0, - 0, 4, 5, 13, 0, 6, 7, 0, 14, 15, - 16, 17, 0, 0, 0, 0, 0, 20, 0, 0, - 194, 0, 0, 21, 22, 0, 23, 0, 24, 201, - 202, 25, 26, 0, 61, 0, 13, 0, 0, 0, - 0, 14, 15, 16, 17, 0, 0, 4, 5, 0, - 20, 6, 7, 0, 0, 96, 21, 22, 0, 23, - 0, 24, 0, 0, 25, 26, 0, 61, 0, 0, - 0, 0, 0, 0, 4, 5, 0, 0, 6, 7, - 0, 0, 13, 0, 0, 0, 0, 14, 15, 16, - 17, 0, 0, 0, 0, 85, 20, 0, 0, 0, - 86, 0, 21, 22, 0, 23, 0, 24, 0, 13, - 25, 26, 0, 61, 14, 15, 16, 17, 0, 0, - 4, 5, 0, 20, 6, 7, 87, 88, 89, 21, - 22, 0, 23, 0, 24, 0, 0, 25, 26, 90, - 61, 0, 92, 93, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, - 14, 15, 16, 17, 86, 0, 0, 0, 0, 20, + 0, 0, 25, 26, 0, 61, 0, 0, 75, 0, + 76, 0, 0, 0, 0, 0, 116, 0, 4, 5, + 0, 13, 6, 7, 117, 0, 14, 15, 16, 17, + 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, + 0, 21, 22, 0, 23, 0, 24, 0, 0, 25, + 26, 0, 61, 0, 13, 0, 0, 76, 0, 14, + 15, 16, 17, 224, 0, 4, 5, 0, 20, 6, + 7, 117, 0, 0, 21, 22, 0, 23, 0, 24, + 0, 0, 25, 26, -113, 61, 0, 0, 0, 0, + 69, 0, 4, 5, 0, 0, 6, 7, 0, 0, + 0, 13, 0, 0, 0, 0, 14, 15, 16, 17, + 0, 0, 0, 0, 85, 20, 0, 0, 0, 86, + 0, 21, 22, 0, 23, 0, 24, 0, 13, 25, + 26, 0, 61, 14, 15, 16, 17, 189, 0, 4, + 5, 0, 20, 6, 7, 87, 88, 89, 21, 22, + 0, 23, 0, 24, 0, 0, 25, 26, 90, 61, + 91, 92, 93, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 4, 263, 0, 13, 6, 7, 0, 0, + 14, 15, 16, 17, 0, 0, 0, 0, 0, 20, + 0, 0, 198, 0, 0, 21, 22, 0, 23, 0, + 24, 205, 206, 25, 26, 0, 61, 0, 13, 0, + 0, 0, 0, 14, 15, 16, 17, 0, 0, 0, + 4, 5, 20, 0, 6, 7, 0, 0, 21, 22, + 0, 23, 0, 24, 0, 0, 25, 26, 0, 61, + 198, 0, 0, 0, 0, 0, 0, 0, 0, 205, + 206, 0, 0, 0, 0, 0, 13, 0, 0, 0, + 0, 14, 15, 16, 17, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 0, 0, 21, 22, 85, 23, + 0, 24, 0, 86, 25, 26, 0, 61, 4, 5, + 0, 0, 6, 7, 0, 0, 0, 96, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, + 88, 89, 0, 0, 0, 4, 5, 0, 0, 6, + 7, 117, 90, 220, 13, 92, 93, 0, 0, 14, + 15, 16, 17, 0, 0, 0, 0, 85, 20, 0, + 0, 0, 86, 0, 21, 22, 0, 23, 0, 24, + 0, 13, 25, 26, 0, 61, 14, 15, 16, 17, + 0, 0, 4, 5, 0, 20, 6, 7, 87, 88, + 89, 21, 22, 0, 23, 0, 24, 0, 0, 25, + 26, 90, 61, 0, 92, 93, 0, 0, 0, 4, + 5, 0, 0, 6, 7, 0, 0, 0, 13, 0, + 0, 0, 0, 14, 15, 16, 17, 0, 0, 0, + 0, 0, 20, 0, 0, 0, 0, 0, 21, 22, + 0, 23, 0, 24, 0, 0, 25, 26, 0, 61, + 14, 15, 16, 17, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 21, 22, 0, 23, 0, - 24, 0, 0, 25, 66, 0, 61, 0, 0, 0, - 87, 88, 89, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 90, 216, 0, 92, 93 + 24, 0, 0, 25, 66, 0, 61 }; static const yytype_int16 yycheck[] = { - 1, 213, 29, 30, 1, 44, 46, 234, 244, 29, - 118, 13, 14, 15, 70, 87, 1, 1, 1, 21, - 22, 16, 24, 25, 16, 26, 10, 24, 25, 51, - 4, 310, 51, 35, 60, 61, 62, 67, 27, 65, - 319, 1, 43, 44, 4, 1, 1, 43, 44, 40, - 72, 6, 74, 1, 51, 74, 70, 233, 59, 60, - 4, 117, 1, 21, 22, 66, 24, 51, 51, 72, - 55, 55, 61, 129, 130, 70, 73, 35, 70, 70, - 316, 29, 51, 310, 68, 86, 71, 88, 89, 90, - 74, 74, 319, 67, 95, 51, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 68, 81, - 143, 287, 184, 146, 115, 291, 55, 225, 74, 91, - 43, 44, 66, 143, 336, 127, 146, 339, 1, 68, - 1, 67, 308, 6, 135, 311, 67, 49, 139, 1, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 59, 60, 67, 1, 157, 159, 4, 56, - 9, 3, 338, 65, 136, 341, 199, 200, 224, 127, - 203, 51, 205, 5, 175, 176, 209, 175, 176, 199, - 200, 12, 13, 203, 55, 205, 4, 38, 13, 209, - 68, 67, 40, 55, 214, 143, 252, 68, 146, 9, - 256, 257, 67, 204, 243, 238, 68, 56, 57, 3, - 282, 67, 43, 44, 254, 216, 74, 67, 238, 4, - 253, 52, 26, 68, 263, 197, 227, 228, 284, 10, - 231, 232, 67, 253, 206, 275, 20, 293, 3, 4, - 9, 261, 243, 215, 300, 14, 56, 57, 54, 73, - 7, 199, 200, 7, 48, 203, 50, 205, 30, 313, - 228, 209, 263, 290, 320, 9, 25, 296, 159, 275, - 14, 40, 41, 245, 294, 331, 327, 249, -1, -1, - 45, 46, 302, -1, -1, -1, -1, 56, 57, -1, - 238, 292, -1, 294, 296, -1, 40, 41, 42, -1, - 272, -1, 304, -1, 69, 253, -1, 279, 280, 53, - -1, 283, 56, 57, -1, -1, -1, -1, -1, -1, - 9, -1, 9, -1, -1, 14, -1, 14, -1, 301, - 74, 303, -1, 305, 306, 307, -1, 309, -1, -1, - -1, 0, 1, -1, 3, 4, 304, -1, 7, 8, - -1, 40, -1, 40, 41, 42, -1, 329, 17, 18, - 332, -1, -1, 335, -1, 337, 53, 56, 57, 56, - 57, -1, -1, 7, 8, -1, 35, 36, 37, 38, - -1, 68, -1, -1, 43, 44, 45, 46, 47, -1, - -1, -1, 51, 52, 58, 59, 60, 61, 62, 58, - 59, 65, 61, -1, 63, -1, -1, 66, 67, -1, - 69, -1, -1, 72, 1, 74, 3, 4, 52, -1, - 7, 8, -1, -1, 58, 59, -1, 61, -1, -1, - -1, -1, 19, -1, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, -1, -1, - -1, 38, 39, -1, -1, -1, 43, 44, 45, 46, - -1, -1, -1, -1, 51, 52, 58, 59, 60, 61, - 62, 58, 59, 65, 61, -1, 63, -1, -1, 66, - 67, -1, 69, -1, -1, 72, 73, 74, 1, -1, - 3, 4, -1, -1, 7, 8, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 19, -1, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, -1, -1, -1, 38, 39, -1, -1, -1, - 43, 44, 45, 46, -1, -1, -1, -1, 51, 52, - -1, -1, -1, -1, -1, 58, 59, -1, 61, -1, - 63, -1, -1, 66, 67, -1, 69, -1, -1, 72, - 73, 74, 1, -1, 3, 4, -1, -1, 7, 8, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 19, -1, 21, 22, 23, -1, -1, 26, 27, 28, - 29, 30, 31, 32, 33, 34, -1, -1, -1, 38, - 39, -1, -1, -1, 43, 44, 45, 46, 1, -1, - 3, 4, -1, 52, 7, 8, -1, 10, -1, 58, - 59, -1, 61, -1, 63, -1, -1, 66, 67, -1, - 69, -1, -1, 72, 73, 74, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 38, -1, -1, -1, -1, - 43, 44, 45, 46, -1, -1, -1, -1, 51, 52, - -1, -1, -1, -1, -1, 58, 59, -1, 61, -1, - 63, -1, -1, 66, 67, 68, 69, -1, 3, 4, - -1, 74, 7, 8, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 19, -1, 21, 22, 23, -1, - -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, - -1, 3, 4, 38, 39, 7, 8, -1, 43, 44, - 45, 46, -1, -1, -1, -1, -1, 52, -1, -1, - -1, -1, 9, 58, 59, -1, 61, 14, 63, -1, - -1, 66, 67, -1, 69, -1, 38, 72, -1, 74, - -1, 43, 44, 45, 46, 1, -1, 3, 4, -1, - 52, 7, 8, 40, 41, 42, 58, 59, -1, 61, - -1, 63, -1, -1, 66, 67, 53, 69, 55, 56, - 57, -1, 74, -1, -1, -1, -1, 1, -1, 3, - 4, -1, 38, 7, 8, -1, -1, 43, 44, 45, - 46, -1, -1, -1, -1, -1, 52, -1, -1, -1, - -1, -1, 58, 59, -1, 61, -1, 63, -1, -1, - 66, 67, 68, 69, 38, -1, -1, -1, -1, 43, - 44, 45, 46, 1, -1, 3, 4, -1, 52, 7, - 8, -1, -1, -1, 58, 59, -1, 61, -1, 63, - -1, -1, 66, 67, -1, 69, -1, -1, -1, -1, + 1, 44, 29, 30, 217, 70, 86, 238, 1, 87, + 46, 13, 14, 15, 29, 1, 1, 1, 248, 21, + 22, 1, 24, 25, 1, 26, 120, 17, 17, 6, + 3, 111, 10, 35, 52, 27, 29, 15, 21, 22, + 314, 24, 43, 44, 1, 4, 1, 4, 4, 323, + 1, 6, 35, 4, 119, 73, 68, 75, 59, 60, + 59, 60, 71, 41, 42, 66, 131, 132, 52, 61, + 56, 56, 52, 68, 1, 73, 49, 1, 51, 57, + 58, 71, 71, 314, 69, 86, 72, 88, 89, 90, + 320, 75, 323, 237, 95, 75, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 68, 68, + 188, 67, 69, 1, 115, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 129, 341, 56, + 145, 344, 56, 148, 10, 229, 137, 25, 26, 15, + 141, 52, 69, 81, 52, 69, 129, 291, 44, 45, + 68, 295, 145, 91, 41, 148, 179, 180, 10, 160, + 162, 44, 45, 228, 52, 41, 50, 75, 312, 3, + 1, 315, 57, 66, 3, 4, 4, 52, 179, 180, + 11, 57, 58, 5, 71, 39, 74, 14, 203, 204, + 9, 256, 207, 41, 209, 260, 261, 69, 213, 343, + 138, 68, 346, 218, 247, 57, 58, 208, 286, 10, + 203, 204, 68, 68, 207, 68, 209, 46, 47, 220, + 213, 52, 258, 288, 267, 56, 75, 242, 4, 69, + 231, 232, 297, 27, 235, 236, 11, 317, 69, 304, + 21, 70, 257, 279, 75, 145, 247, 68, 148, 242, + 265, 59, 60, 61, 62, 63, 57, 58, 66, 324, + 55, 13, 14, 201, 257, 74, 267, 294, 7, 8, + 9, 336, 210, 59, 60, 61, 62, 63, 7, 7, + 66, 219, 30, 298, 317, 10, 232, 300, 25, 162, + 15, 306, 44, 45, 332, 296, -1, 298, 300, -1, + 279, 53, -1, 203, 204, -1, 308, 207, -1, 209, + -1, 249, -1, 213, 53, 253, 41, 42, 43, -1, + 59, 60, -1, 62, -1, 308, 61, 62, 63, 54, + -1, 66, 57, 58, -1, -1, -1, -1, 276, -1, + -1, -1, 242, -1, -1, 283, 284, -1, -1, 287, + 75, -1, -1, -1, -1, -1, -1, 257, -1, 10, + -1, -1, -1, -1, 15, -1, -1, 305, -1, 307, + -1, 309, 310, 311, -1, 313, 0, 1, -1, 3, + 4, -1, -1, 7, 8, -1, -1, -1, -1, -1, + 41, 42, 43, -1, 18, 19, 334, -1, -1, 337, + -1, -1, 340, 54, 342, -1, 57, 58, -1, -1, + -1, -1, 36, 37, 38, 39, -1, -1, 69, -1, + 44, 45, 46, 47, 48, -1, -1, -1, 52, 53, + -1, -1, -1, -1, -1, 59, 60, -1, 62, -1, + 64, -1, -1, 67, 68, -1, 70, -1, -1, 73, + 1, 75, 3, 4, -1, -1, 7, 8, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, + -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, -1, -1, -1, 39, 40, + -1, -1, -1, 44, 45, 46, 47, -1, -1, -1, + -1, 52, 53, -1, -1, -1, -1, -1, 59, 60, + -1, 62, -1, 64, -1, -1, 67, 68, -1, 70, + -1, -1, 73, 74, 75, 1, -1, 3, 4, -1, + -1, 7, 8, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 20, -1, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + -1, -1, -1, 39, 40, -1, -1, -1, 44, 45, + 46, 47, -1, -1, -1, -1, 52, 53, -1, -1, + -1, -1, -1, 59, 60, -1, 62, -1, 64, -1, + -1, 67, 68, -1, 70, -1, -1, 73, 74, 75, + 1, -1, 3, 4, -1, -1, 7, 8, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, + -1, 22, 23, 24, -1, -1, 27, 28, 29, 30, + 31, 32, 33, 34, 35, -1, -1, -1, 39, 40, + -1, -1, -1, 44, 45, 46, 47, 1, -1, 3, + 4, -1, 53, 7, 8, -1, -1, 11, 59, 60, + -1, 62, -1, 64, -1, -1, 67, 68, -1, 70, + -1, -1, 73, 74, 75, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 39, -1, -1, -1, -1, + 44, 45, 46, 47, -1, -1, -1, -1, 52, 53, + -1, -1, -1, -1, -1, 59, 60, -1, 62, -1, + 64, -1, -1, 67, 68, 69, 70, -1, 3, 4, + -1, 75, 7, 8, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 20, -1, 22, 23, 24, + -1, -1, 27, 28, 29, 30, 31, 32, 33, 34, + 35, -1, -1, -1, 39, 40, -1, -1, -1, 44, + 45, 46, 47, -1, -1, 3, 4, -1, 53, 7, + 8, -1, -1, -1, 59, 60, -1, 62, -1, 64, + -1, -1, 67, 68, -1, 70, -1, -1, 73, -1, + 75, -1, -1, -1, -1, -1, 1, -1, 3, 4, + -1, 39, 7, 8, 9, -1, 44, 45, 46, 47, + -1, -1, -1, -1, -1, 53, -1, -1, -1, -1, + -1, 59, 60, -1, 62, -1, 64, -1, -1, 67, + 68, -1, 70, -1, 39, -1, -1, 75, -1, 44, + 45, 46, 47, 1, -1, 3, 4, -1, 53, 7, + 8, 9, -1, -1, 59, 60, -1, 62, -1, 64, + -1, -1, 67, 68, 69, 70, -1, -1, -1, -1, 1, -1, 3, 4, -1, -1, 7, 8, -1, -1, - 38, -1, -1, -1, -1, 43, 44, 45, 46, -1, - -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, - 58, 59, -1, 61, -1, 63, -1, 38, 66, 67, - -1, 69, 43, 44, 45, 46, -1, -1, 3, 4, - -1, 52, 7, 8, -1, -1, -1, 58, 59, -1, - 61, -1, 63, -1, -1, 66, 67, 22, 69, -1, - -1, -1, -1, -1, -1, -1, 31, 32, -1, -1, - -1, 3, 4, 38, -1, 7, 8, -1, 43, 44, - 45, 46, -1, -1, -1, -1, -1, 52, -1, -1, - 22, -1, -1, 58, 59, -1, 61, -1, 63, 31, - 32, 66, 67, -1, 69, -1, 38, -1, -1, -1, - -1, 43, 44, 45, 46, -1, -1, 3, 4, -1, - 52, 7, 8, -1, -1, 11, 58, 59, -1, 61, - -1, 63, -1, -1, 66, 67, -1, 69, -1, -1, - -1, -1, -1, -1, 3, 4, -1, -1, 7, 8, - -1, -1, 38, -1, -1, -1, -1, 43, 44, 45, - 46, -1, -1, -1, -1, 9, 52, -1, -1, -1, - 14, -1, 58, 59, -1, 61, -1, 63, -1, 38, - 66, 67, -1, 69, 43, 44, 45, 46, -1, -1, - 3, 4, -1, 52, 7, 8, 40, 41, 42, 58, - 59, -1, 61, -1, 63, -1, -1, 66, 67, 53, - 69, -1, 56, 57, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, - 43, 44, 45, 46, 14, -1, -1, -1, -1, 52, - -1, -1, -1, -1, -1, 58, 59, -1, 61, -1, - 63, -1, -1, 66, 67, -1, 69, -1, -1, -1, - 40, 41, 42, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 53, 54, -1, 56, 57 + -1, 39, -1, -1, -1, -1, 44, 45, 46, 47, + -1, -1, -1, -1, 10, 53, -1, -1, -1, 15, + -1, 59, 60, -1, 62, -1, 64, -1, 39, 67, + 68, -1, 70, 44, 45, 46, 47, 1, -1, 3, + 4, -1, 53, 7, 8, 41, 42, 43, 59, 60, + -1, 62, -1, 64, -1, -1, 67, 68, 54, 70, + 56, 57, 58, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 3, 4, -1, 39, 7, 8, -1, -1, + 44, 45, 46, 47, -1, -1, -1, -1, -1, 53, + -1, -1, 23, -1, -1, 59, 60, -1, 62, -1, + 64, 32, 33, 67, 68, -1, 70, -1, 39, -1, + -1, -1, -1, 44, 45, 46, 47, -1, -1, -1, + 3, 4, 53, -1, 7, 8, -1, -1, 59, 60, + -1, 62, -1, 64, -1, -1, 67, 68, -1, 70, + 23, -1, -1, -1, -1, -1, -1, -1, -1, 32, + 33, -1, -1, -1, -1, -1, 39, -1, -1, -1, + -1, 44, 45, 46, 47, -1, -1, -1, -1, -1, + 53, -1, -1, -1, -1, -1, 59, 60, 10, 62, + -1, 64, -1, 15, 67, 68, -1, 70, 3, 4, + -1, -1, 7, 8, -1, -1, -1, 12, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, + 42, 43, -1, -1, -1, 3, 4, -1, -1, 7, + 8, 9, 54, 55, 39, 57, 58, -1, -1, 44, + 45, 46, 47, -1, -1, -1, -1, 10, 53, -1, + -1, -1, 15, -1, 59, 60, -1, 62, -1, 64, + -1, 39, 67, 68, -1, 70, 44, 45, 46, 47, + -1, -1, 3, 4, -1, 53, 7, 8, 41, 42, + 43, 59, 60, -1, 62, -1, 64, -1, -1, 67, + 68, 54, 70, -1, 57, 58, -1, -1, -1, 3, + 4, -1, -1, 7, 8, -1, -1, -1, 39, -1, + -1, -1, -1, 44, 45, 46, 47, -1, -1, -1, + -1, -1, 53, -1, -1, -1, -1, -1, 59, 60, + -1, 62, -1, 64, -1, -1, 67, 68, -1, 70, + 44, 45, 46, 47, -1, -1, -1, -1, -1, 53, + -1, -1, -1, -1, -1, 59, 60, -1, 62, -1, + 64, -1, -1, 67, 68, -1, 70 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 76, 0, 1, 3, 4, 7, 8, 17, 18, - 35, 36, 37, 38, 43, 44, 45, 46, 47, 51, - 52, 58, 59, 61, 63, 66, 67, 69, 77, 80, - 84, 86, 88, 106, 117, 121, 122, 123, 124, 125, - 126, 134, 135, 67, 70, 131, 132, 133, 3, 4, - 45, 46, 69, 82, 83, 127, 135, 135, 135, 67, - 67, 69, 122, 135, 122, 122, 67, 124, 135, 1, - 113, 117, 48, 50, 126, 72, 74, 81, 90, 106, - 137, 141, 81, 87, 51, 9, 14, 40, 41, 42, - 53, 55, 56, 57, 119, 120, 11, 122, 58, 59, - 60, 61, 62, 65, 58, 59, 60, 61, 62, 65, - 12, 13, 43, 44, 52, 118, 1, 114, 115, 116, - 117, 113, 117, 16, 131, 49, 67, 56, 108, 114, - 114, 117, 43, 44, 136, 1, 55, 68, 139, 143, - 139, 1, 6, 78, 1, 6, 79, 106, 107, 89, - 107, 5, 117, 134, 117, 117, 117, 107, 117, 38, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 13, 117, 139, 1, 143, 71, 85, 122, - 139, 139, 117, 107, 40, 1, 117, 1, 90, 1, - 90, 1, 19, 21, 22, 23, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 39, 73, 91, 92, 94, - 101, 105, 117, 137, 138, 141, 54, 117, 127, 116, - 1, 116, 1, 4, 109, 110, 134, 67, 93, 4, - 67, 67, 67, 107, 67, 90, 90, 90, 111, 117, - 90, 107, 90, 95, 89, 140, 141, 107, 117, 139, - 1, 143, 117, 111, 96, 4, 117, 117, 91, 4, - 94, 97, 90, 67, 102, 112, 113, 138, 107, 107, - 1, 4, 139, 90, 128, 129, 130, 131, 68, 139, - 139, 26, 40, 141, 113, 10, 103, 107, 16, 130, - 107, 107, 67, 134, 107, 139, 104, 91, 137, 91, - 117, 139, 117, 141, 121, 20, 98, 139, 107, 141, - 107, 107, 1, 24, 25, 99, 107, 107, 91, 107, - 97, 91, 7, 8, 58, 59, 86, 100, 54, 142, - 138, 97, 139, 7, 7, 142, 107, 139, 107, 107, - 89, 107, 91, 89, 91 + 0, 77, 0, 1, 3, 4, 7, 8, 18, 19, + 36, 37, 38, 39, 44, 45, 46, 47, 48, 52, + 53, 59, 60, 62, 64, 67, 68, 70, 78, 81, + 85, 87, 90, 108, 119, 123, 124, 125, 126, 127, + 128, 136, 137, 68, 71, 133, 134, 135, 3, 4, + 46, 47, 70, 83, 84, 129, 137, 137, 137, 68, + 68, 70, 124, 137, 124, 124, 68, 126, 137, 1, + 115, 119, 49, 51, 128, 73, 75, 82, 92, 108, + 139, 143, 82, 88, 52, 10, 15, 41, 42, 43, + 54, 56, 57, 58, 121, 122, 12, 124, 59, 60, + 61, 62, 63, 66, 59, 60, 61, 62, 63, 66, + 13, 14, 44, 45, 53, 120, 1, 9, 89, 116, + 117, 118, 119, 115, 119, 17, 133, 50, 68, 57, + 110, 116, 116, 119, 44, 45, 138, 1, 56, 69, + 141, 145, 141, 1, 6, 79, 1, 6, 80, 108, + 109, 91, 109, 5, 89, 119, 136, 119, 119, 119, + 109, 119, 39, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 89, 14, 119, 141, 1, + 145, 72, 86, 124, 141, 141, 119, 109, 41, 1, + 119, 1, 92, 1, 92, 1, 20, 22, 23, 24, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 40, + 74, 93, 94, 96, 103, 107, 119, 139, 140, 143, + 55, 119, 129, 118, 1, 118, 1, 4, 111, 112, + 136, 68, 95, 4, 68, 68, 68, 109, 68, 92, + 92, 92, 113, 119, 92, 109, 92, 97, 91, 142, + 143, 109, 119, 141, 1, 145, 119, 113, 98, 4, + 119, 119, 93, 4, 96, 99, 92, 68, 104, 114, + 115, 140, 109, 109, 1, 4, 141, 92, 130, 131, + 132, 133, 69, 141, 141, 27, 41, 143, 115, 11, + 105, 109, 17, 132, 109, 109, 68, 136, 109, 141, + 106, 93, 139, 93, 119, 141, 119, 143, 123, 21, + 100, 141, 109, 143, 109, 109, 1, 25, 26, 101, + 109, 109, 93, 109, 99, 93, 7, 8, 59, 60, + 87, 89, 102, 55, 144, 140, 99, 141, 7, 7, + 144, 109, 141, 109, 109, 91, 109, 93, 91, 93 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 75, 76, 76, 76, 76, 76, 77, 77, 77, - 77, 77, 78, 78, 78, 79, 79, 79, 80, 80, - 80, 80, 80, 80, 80, 81, 82, 82, 82, 82, - 83, 83, 85, 84, 87, 86, 88, 88, 89, 89, - 89, 90, 90, 91, 91, 91, 91, 91, 91, 91, - 91, 91, 91, 92, 92, 92, 92, 92, 93, 92, - 92, 95, 94, 96, 94, 94, 94, 97, 97, 98, - 98, 98, 99, 99, 100, 100, 100, 100, 100, 101, - 101, 102, 102, 103, 104, 103, 105, 105, 106, 106, - 107, 107, 108, 108, 109, 109, 110, 110, 110, 110, - 110, 111, 111, 112, 112, 113, 113, 113, 113, 113, - 113, 114, 114, 115, 115, 115, 115, 115, 115, 116, - 117, 117, 117, 117, 117, 117, 117, 117, 118, 118, - 118, 119, 119, 120, 120, 121, 121, 121, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 123, - 123, 123, 123, 123, 123, 123, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 125, 125, 126, 127, 127, 128, 128, 129, 129, 130, - 131, 132, 132, 133, 134, 134, 135, 135, 136, 136, - 136, 137, 138, 139, 140, 140, 141, 142, 143 + 0, 76, 77, 77, 77, 77, 77, 78, 78, 78, + 78, 78, 79, 79, 79, 80, 80, 80, 81, 81, + 81, 81, 81, 81, 81, 82, 83, 83, 83, 83, + 84, 84, 86, 85, 88, 87, 89, 90, 90, 91, + 91, 91, 92, 92, 93, 93, 93, 93, 93, 93, + 93, 93, 93, 93, 94, 94, 94, 94, 94, 95, + 94, 94, 97, 96, 98, 96, 96, 96, 99, 99, + 100, 100, 100, 101, 101, 102, 102, 102, 102, 102, + 102, 103, 103, 104, 104, 105, 106, 105, 107, 107, + 108, 108, 109, 109, 110, 110, 111, 111, 112, 112, + 112, 112, 112, 113, 113, 114, 114, 115, 115, 115, + 115, 115, 115, 116, 116, 117, 117, 117, 117, 117, + 117, 118, 118, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 120, 120, 120, 121, 121, 122, 122, + 123, 123, 123, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, + 125, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 127, 127, 128, 129, 129, + 130, 130, 131, 131, 132, 133, 134, 134, 135, 136, + 136, 137, 137, 138, 138, 138, 139, 140, 141, 142, + 142, 143, 144, 145 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -1170,23 +1193,24 @@ static const yytype_uint8 yyr2[] = 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 4, 4, 1, 2, 1, 1, 2, 1, 0, 1, 4, 1, 1, 1, 1, 5, 1, 1, 1, 2, - 1, 1, 0, 7, 0, 3, 1, 1, 0, 2, - 2, 1, 2, 2, 3, 1, 9, 6, 8, 8, - 12, 11, 1, 2, 2, 2, 2, 3, 0, 4, - 2, 0, 4, 0, 4, 4, 1, 0, 1, 0, - 2, 2, 5, 4, 1, 2, 2, 1, 1, 1, - 1, 1, 3, 0, 0, 3, 6, 9, 1, 2, - 0, 1, 0, 2, 0, 1, 1, 3, 1, 2, - 3, 0, 1, 0, 1, 1, 3, 1, 2, 3, - 3, 0, 1, 1, 3, 1, 2, 3, 3, 1, - 3, 3, 3, 3, 3, 3, 5, 1, 1, 1, - 2, 1, 1, 1, 1, 1, 1, 2, 1, 3, - 3, 3, 3, 3, 3, 3, 2, 2, 5, 4, - 3, 3, 3, 3, 3, 3, 1, 2, 3, 4, - 4, 1, 1, 1, 2, 2, 1, 1, 2, 2, - 1, 2, 4, 0, 1, 0, 2, 1, 2, 1, - 3, 1, 2, 2, 1, 2, 1, 3, 1, 1, - 0, 2, 2, 1, 0, 1, 1, 1, 2 + 1, 1, 0, 7, 0, 3, 1, 1, 1, 0, + 2, 2, 1, 2, 2, 3, 1, 9, 6, 8, + 8, 12, 11, 1, 2, 2, 2, 2, 3, 0, + 4, 2, 0, 4, 0, 4, 4, 1, 0, 1, + 0, 2, 2, 5, 4, 1, 2, 2, 1, 1, + 1, 1, 1, 1, 3, 0, 0, 3, 6, 9, + 1, 2, 0, 1, 0, 2, 0, 1, 1, 3, + 1, 2, 3, 0, 1, 0, 1, 1, 3, 1, + 2, 3, 3, 0, 1, 1, 3, 1, 2, 3, + 3, 1, 1, 3, 3, 3, 3, 3, 3, 3, + 3, 5, 1, 1, 1, 2, 1, 1, 1, 1, + 1, 1, 2, 1, 3, 3, 3, 3, 3, 3, + 3, 2, 2, 5, 4, 3, 3, 3, 3, 3, + 3, 1, 2, 3, 4, 4, 1, 1, 1, 2, + 2, 1, 1, 2, 2, 1, 2, 4, 0, 1, + 0, 2, 1, 2, 1, 3, 1, 2, 2, 1, + 2, 1, 3, 1, 1, 0, 2, 2, 1, 0, + 1, 1, 1, 2 }; @@ -1868,7 +1892,7 @@ yyreduce: rule = 0; yyerrok; } -#line 1872 "awkgram.c" /* yacc.c:1646 */ +#line 1896 "awkgram.c" /* yacc.c:1646 */ break; case 5: @@ -1876,7 +1900,7 @@ yyreduce: { next_sourcefile(); } -#line 1880 "awkgram.c" /* yacc.c:1646 */ +#line 1904 "awkgram.c" /* yacc.c:1646 */ break; case 6: @@ -1889,7 +1913,7 @@ yyreduce: */ /* yyerrok; */ } -#line 1893 "awkgram.c" /* yacc.c:1646 */ +#line 1917 "awkgram.c" /* yacc.c:1646 */ break; case 7: @@ -1898,7 +1922,7 @@ yyreduce: (void) append_rule((yyvsp[-1]), (yyvsp[0])); first_rule = false; } -#line 1902 "awkgram.c" /* yacc.c:1646 */ +#line 1926 "awkgram.c" /* yacc.c:1646 */ break; case 8: @@ -1913,7 +1937,7 @@ yyreduce: } else /* pattern rule with non-empty pattern */ (void) append_rule((yyvsp[-1]), NULL); } -#line 1917 "awkgram.c" /* yacc.c:1646 */ +#line 1941 "awkgram.c" /* yacc.c:1646 */ break; case 9: @@ -1924,7 +1948,7 @@ yyreduce: want_param_names = DONT_CHECK; yyerrok; } -#line 1928 "awkgram.c" /* yacc.c:1646 */ +#line 1952 "awkgram.c" /* yacc.c:1646 */ break; case 10: @@ -1934,7 +1958,7 @@ yyreduce: at_seen = false; yyerrok; } -#line 1938 "awkgram.c" /* yacc.c:1646 */ +#line 1962 "awkgram.c" /* yacc.c:1646 */ break; case 11: @@ -1944,7 +1968,7 @@ yyreduce: at_seen = false; yyerrok; } -#line 1948 "awkgram.c" /* yacc.c:1646 */ +#line 1972 "awkgram.c" /* yacc.c:1646 */ break; case 12: @@ -1956,19 +1980,19 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1960 "awkgram.c" /* yacc.c:1646 */ +#line 1984 "awkgram.c" /* yacc.c:1646 */ break; case 13: #line 285 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1966 "awkgram.c" /* yacc.c:1646 */ +#line 1990 "awkgram.c" /* yacc.c:1646 */ break; case 14: #line 287 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1972 "awkgram.c" /* yacc.c:1646 */ +#line 1996 "awkgram.c" /* yacc.c:1646 */ break; case 15: @@ -1980,19 +2004,19 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1984 "awkgram.c" /* yacc.c:1646 */ +#line 2008 "awkgram.c" /* yacc.c:1646 */ break; case 16: #line 300 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1990 "awkgram.c" /* yacc.c:1646 */ +#line 2014 "awkgram.c" /* yacc.c:1646 */ break; case 17: #line 302 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1996 "awkgram.c" /* yacc.c:1646 */ +#line 2020 "awkgram.c" /* yacc.c:1646 */ break; case 18: @@ -2005,7 +2029,7 @@ yyreduce: } else (yyval) = NULL; } -#line 2009 "awkgram.c" /* yacc.c:1646 */ +#line 2033 "awkgram.c" /* yacc.c:1646 */ break; case 19: @@ -2018,7 +2042,7 @@ yyreduce: } else (yyval) = (yyvsp[0]); } -#line 2022 "awkgram.c" /* yacc.c:1646 */ +#line 2046 "awkgram.c" /* yacc.c:1646 */ break; case 20: @@ -2052,7 +2076,7 @@ yyreduce: (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); rule = Rule; } -#line 2056 "awkgram.c" /* yacc.c:1646 */ +#line 2080 "awkgram.c" /* yacc.c:1646 */ break; case 21: @@ -2070,7 +2094,7 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2074 "awkgram.c" /* yacc.c:1646 */ +#line 2098 "awkgram.c" /* yacc.c:1646 */ break; case 22: @@ -2088,7 +2112,7 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2092 "awkgram.c" /* yacc.c:1646 */ +#line 2116 "awkgram.c" /* yacc.c:1646 */ break; case 23: @@ -2100,7 +2124,7 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2104 "awkgram.c" /* yacc.c:1646 */ +#line 2128 "awkgram.c" /* yacc.c:1646 */ break; case 24: @@ -2112,7 +2136,7 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2116 "awkgram.c" /* yacc.c:1646 */ +#line 2140 "awkgram.c" /* yacc.c:1646 */ break; case 25: @@ -2125,19 +2149,19 @@ yyreduce: ip = (yyvsp[-3]); (yyval) = ip; } -#line 2129 "awkgram.c" /* yacc.c:1646 */ +#line 2153 "awkgram.c" /* yacc.c:1646 */ break; case 26: #line 415 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2135 "awkgram.c" /* yacc.c:1646 */ +#line 2159 "awkgram.c" /* yacc.c:1646 */ break; case 27: #line 417 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2141 "awkgram.c" /* yacc.c:1646 */ +#line 2165 "awkgram.c" /* yacc.c:1646 */ break; case 28: @@ -2147,7 +2171,7 @@ yyreduce: tokstart); YYABORT; } -#line 2151 "awkgram.c" /* yacc.c:1646 */ +#line 2175 "awkgram.c" /* yacc.c:1646 */ break; case 29: @@ -2156,13 +2180,13 @@ yyreduce: (yyval) = (yyvsp[0]); at_seen = false; } -#line 2160 "awkgram.c" /* yacc.c:1646 */ +#line 2184 "awkgram.c" /* yacc.c:1646 */ break; case 32: #line 437 "awkgram.y" /* yacc.c:1646 */ { want_param_names = FUNC_HEADER; } -#line 2166 "awkgram.c" /* yacc.c:1646 */ +#line 2190 "awkgram.c" /* yacc.c:1646 */ break; case 33: @@ -2204,13 +2228,13 @@ yyreduce: (yyval) = (yyvsp[-6]); want_param_names = FUNC_BODY; } -#line 2208 "awkgram.c" /* yacc.c:1646 */ +#line 2232 "awkgram.c" /* yacc.c:1646 */ break; case 34: #line 483 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } -#line 2214 "awkgram.c" /* yacc.c:1646 */ +#line 2238 "awkgram.c" /* yacc.c:1646 */ break; case 35: @@ -2243,17 +2267,41 @@ yyreduce: (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2247 "awkgram.c" /* yacc.c:1646 */ +#line 2271 "awkgram.c" /* yacc.c:1646 */ break; case 36: #line 517 "awkgram.y" /* yacc.c:1646 */ + { + NODE *n, *exp; + char *re; + size_t len; + + re = (yyvsp[0])->lextok; + (yyvsp[0])->lextok = NULL; + len = strlen(re); + + exp = make_str_node(re, len, ALREADY_MALLOCED); + n = make_regnode(Node_typedregex, exp); + if (n == NULL) { + unref(exp); + YYABORT; + } + (yyval) = (yyvsp[0]); + (yyval)->opcode = Op_push_re; + (yyval)->memory = n; + } +#line 2295 "awkgram.c" /* yacc.c:1646 */ + break; + + case 37: +#line 539 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[0])); } -#line 2253 "awkgram.c" /* yacc.c:1646 */ +#line 2301 "awkgram.c" /* yacc.c:1646 */ break; - case 38: -#line 523 "awkgram.y" /* yacc.c:1646 */ + case 39: +#line 545 "awkgram.y" /* yacc.c:1646 */ { if (prior_comment != NULL) { (yyval) = list_create(prior_comment); @@ -2264,11 +2312,11 @@ yyreduce: } else (yyval) = NULL; } -#line 2268 "awkgram.c" /* yacc.c:1646 */ +#line 2316 "awkgram.c" /* yacc.c:1646 */ break; - case 39: -#line 534 "awkgram.y" /* yacc.c:1646 */ + case 40: +#line 556 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0]) == NULL) { if (prior_comment != NULL) { @@ -2315,40 +2363,40 @@ yyreduce: } yyerrok; } -#line 2319 "awkgram.c" /* yacc.c:1646 */ +#line 2367 "awkgram.c" /* yacc.c:1646 */ break; - case 40: -#line 581 "awkgram.y" /* yacc.c:1646 */ + case 41: +#line 603 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2325 "awkgram.c" /* yacc.c:1646 */ +#line 2373 "awkgram.c" /* yacc.c:1646 */ break; - case 43: -#line 591 "awkgram.y" /* yacc.c:1646 */ + case 44: +#line 613 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2331 "awkgram.c" /* yacc.c:1646 */ +#line 2379 "awkgram.c" /* yacc.c:1646 */ break; - case 44: -#line 593 "awkgram.y" /* yacc.c:1646 */ + case 45: +#line 615 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2337 "awkgram.c" /* yacc.c:1646 */ +#line 2385 "awkgram.c" /* yacc.c:1646 */ break; - case 45: -#line 595 "awkgram.y" /* yacc.c:1646 */ + case 46: +#line 617 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2348 "awkgram.c" /* yacc.c:1646 */ +#line 2396 "awkgram.c" /* yacc.c:1646 */ break; - case 46: -#line 602 "awkgram.y" /* yacc.c:1646 */ + case 47: +#line 624 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2438,11 +2486,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2442 "awkgram.c" /* yacc.c:1646 */ +#line 2490 "awkgram.c" /* yacc.c:1646 */ break; - case 47: -#line 692 "awkgram.y" /* yacc.c:1646 */ + case 48: +#line 714 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2484,11 +2532,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2488 "awkgram.c" /* yacc.c:1646 */ +#line 2536 "awkgram.c" /* yacc.c:1646 */ break; - case 48: -#line 734 "awkgram.y" /* yacc.c:1646 */ + case 49: +#line 756 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2530,11 +2578,11 @@ yyreduce: } /* else $1 and $4 are NULLs */ } -#line 2534 "awkgram.c" /* yacc.c:1646 */ +#line 2582 "awkgram.c" /* yacc.c:1646 */ break; - case 49: -#line 776 "awkgram.y" /* yacc.c:1646 */ + case 50: +#line 798 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; char *var_name = (yyvsp[-5])->lextok; @@ -2647,33 +2695,33 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2651 "awkgram.c" /* yacc.c:1646 */ +#line 2699 "awkgram.c" /* yacc.c:1646 */ break; - case 50: -#line 889 "awkgram.y" /* yacc.c:1646 */ + case 51: +#line 911 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2662 "awkgram.c" /* yacc.c:1646 */ +#line 2710 "awkgram.c" /* yacc.c:1646 */ break; - case 51: -#line 896 "awkgram.y" /* yacc.c:1646 */ + case 52: +#line 918 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2673 "awkgram.c" /* yacc.c:1646 */ +#line 2721 "awkgram.c" /* yacc.c:1646 */ break; - case 52: -#line 903 "awkgram.y" /* yacc.c:1646 */ + case 53: +#line 925 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); @@ -2681,11 +2729,11 @@ regular_loop: (yyval) = (yyvsp[0]); (yyval) = add_pending_comment((yyval)); } -#line 2685 "awkgram.c" /* yacc.c:1646 */ +#line 2733 "awkgram.c" /* yacc.c:1646 */ break; - case 53: -#line 914 "awkgram.y" /* yacc.c:1646 */ + case 54: +#line 936 "awkgram.y" /* yacc.c:1646 */ { if (! break_allowed) error_ln((yyvsp[-1])->source_line, @@ -2695,11 +2743,11 @@ regular_loop: (yyval) = add_pending_comment((yyval)); } -#line 2699 "awkgram.c" /* yacc.c:1646 */ +#line 2747 "awkgram.c" /* yacc.c:1646 */ break; - case 54: -#line 924 "awkgram.y" /* yacc.c:1646 */ + case 55: +#line 946 "awkgram.y" /* yacc.c:1646 */ { if (! continue_allowed) error_ln((yyvsp[-1])->source_line, @@ -2709,11 +2757,11 @@ regular_loop: (yyval) = add_pending_comment((yyval)); } -#line 2713 "awkgram.c" /* yacc.c:1646 */ +#line 2761 "awkgram.c" /* yacc.c:1646 */ break; - case 55: -#line 934 "awkgram.y" /* yacc.c:1646 */ + case 56: +#line 956 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2723,11 +2771,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); (yyval) = add_pending_comment((yyval)); } -#line 2727 "awkgram.c" /* yacc.c:1646 */ +#line 2775 "awkgram.c" /* yacc.c:1646 */ break; - case 56: -#line 944 "awkgram.y" /* yacc.c:1646 */ + case 57: +#line 966 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2739,11 +2787,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); (yyval) = add_pending_comment((yyval)); } -#line 2743 "awkgram.c" /* yacc.c:1646 */ +#line 2791 "awkgram.c" /* yacc.c:1646 */ break; - case 57: -#line 956 "awkgram.y" /* yacc.c:1646 */ + case 58: +#line 978 "awkgram.y" /* yacc.c:1646 */ { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2759,20 +2807,20 @@ regular_loop: (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); (yyval) = add_pending_comment((yyval)); } -#line 2763 "awkgram.c" /* yacc.c:1646 */ +#line 2811 "awkgram.c" /* yacc.c:1646 */ break; - case 58: -#line 972 "awkgram.y" /* yacc.c:1646 */ + case 59: +#line 994 "awkgram.y" /* yacc.c:1646 */ { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2772 "awkgram.c" /* yacc.c:1646 */ +#line 2820 "awkgram.c" /* yacc.c:1646 */ break; - case 59: -#line 975 "awkgram.y" /* yacc.c:1646 */ + case 60: +#line 997 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) { (yyval) = list_create((yyvsp[-3])); @@ -2794,17 +2842,17 @@ regular_loop: } (yyval) = add_pending_comment((yyval)); } -#line 2798 "awkgram.c" /* yacc.c:1646 */ +#line 2846 "awkgram.c" /* yacc.c:1646 */ break; - case 61: -#line 1008 "awkgram.y" /* yacc.c:1646 */ + case 62: +#line 1030 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } -#line 2804 "awkgram.c" /* yacc.c:1646 */ +#line 2852 "awkgram.c" /* yacc.c:1646 */ break; - case 62: -#line 1009 "awkgram.y" /* yacc.c:1646 */ + case 63: +#line 1031 "awkgram.y" /* yacc.c:1646 */ { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2902,17 +2950,17 @@ regular_print: } (yyval) = add_pending_comment((yyval)); } -#line 2906 "awkgram.c" /* yacc.c:1646 */ +#line 2954 "awkgram.c" /* yacc.c:1646 */ break; - case 63: -#line 1107 "awkgram.y" /* yacc.c:1646 */ + case 64: +#line 1129 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } -#line 2912 "awkgram.c" /* yacc.c:1646 */ +#line 2960 "awkgram.c" /* yacc.c:1646 */ break; - case 64: -#line 1108 "awkgram.y" /* yacc.c:1646 */ + case 65: +#line 1130 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-2])->lextok; @@ -2946,11 +2994,11 @@ regular_print: } (yyval) = add_pending_comment((yyval)); } -#line 2950 "awkgram.c" /* yacc.c:1646 */ +#line 2998 "awkgram.c" /* yacc.c:1646 */ break; - case 65: -#line 1146 "awkgram.y" /* yacc.c:1646 */ + case 66: +#line 1168 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; char *arr = (yyvsp[-1])->lextok; @@ -2977,55 +3025,55 @@ regular_print: } (yyval) = add_pending_comment((yyval)); } -#line 2981 "awkgram.c" /* yacc.c:1646 */ +#line 3029 "awkgram.c" /* yacc.c:1646 */ break; - case 66: -#line 1173 "awkgram.y" /* yacc.c:1646 */ + case 67: +#line 1195 "awkgram.y" /* yacc.c:1646 */ { (yyval) = optimize_assignment((yyvsp[0])); (yyval) = add_pending_comment((yyval)); } -#line 2990 "awkgram.c" /* yacc.c:1646 */ +#line 3038 "awkgram.c" /* yacc.c:1646 */ break; - case 67: -#line 1181 "awkgram.y" /* yacc.c:1646 */ + case 68: +#line 1203 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2996 "awkgram.c" /* yacc.c:1646 */ +#line 3044 "awkgram.c" /* yacc.c:1646 */ break; - case 68: -#line 1183 "awkgram.y" /* yacc.c:1646 */ + case 69: +#line 1205 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3002 "awkgram.c" /* yacc.c:1646 */ +#line 3050 "awkgram.c" /* yacc.c:1646 */ break; - case 69: -#line 1188 "awkgram.y" /* yacc.c:1646 */ + case 70: +#line 1210 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3008 "awkgram.c" /* yacc.c:1646 */ +#line 3056 "awkgram.c" /* yacc.c:1646 */ break; - case 70: -#line 1190 "awkgram.y" /* yacc.c:1646 */ + case 71: +#line 1212 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) (yyval) = list_create((yyvsp[0])); else (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } -#line 3019 "awkgram.c" /* yacc.c:1646 */ +#line 3067 "awkgram.c" /* yacc.c:1646 */ break; - case 71: -#line 1197 "awkgram.y" /* yacc.c:1646 */ + case 72: +#line 1219 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3025 "awkgram.c" /* yacc.c:1646 */ +#line 3073 "awkgram.c" /* yacc.c:1646 */ break; - case 72: -#line 1202 "awkgram.y" /* yacc.c:1646 */ + case 73: +#line 1224 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -3037,11 +3085,11 @@ regular_print: bcfree((yyvsp[-2])); (yyval) = (yyvsp[-4]); } -#line 3041 "awkgram.c" /* yacc.c:1646 */ +#line 3089 "awkgram.c" /* yacc.c:1646 */ break; - case 73: -#line 1214 "awkgram.y" /* yacc.c:1646 */ + case 74: +#line 1236 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -3052,17 +3100,17 @@ regular_print: (yyvsp[-3])->case_stmt = casestmt; (yyval) = (yyvsp[-3]); } -#line 3056 "awkgram.c" /* yacc.c:1646 */ +#line 3104 "awkgram.c" /* yacc.c:1646 */ break; - case 74: -#line 1228 "awkgram.y" /* yacc.c:1646 */ + case 75: +#line 1250 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3062 "awkgram.c" /* yacc.c:1646 */ +#line 3110 "awkgram.c" /* yacc.c:1646 */ break; - case 75: -#line 1230 "awkgram.y" /* yacc.c:1646 */ + case 76: +#line 1252 "awkgram.y" /* yacc.c:1646 */ { NODE *n = (yyvsp[0])->memory; (void) force_number(n); @@ -3070,26 +3118,26 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3074 "awkgram.c" /* yacc.c:1646 */ +#line 3122 "awkgram.c" /* yacc.c:1646 */ break; - case 76: -#line 1238 "awkgram.y" /* yacc.c:1646 */ + case 77: +#line 1260 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3083 "awkgram.c" /* yacc.c:1646 */ +#line 3131 "awkgram.c" /* yacc.c:1646 */ break; - case 77: -#line 1243 "awkgram.y" /* yacc.c:1646 */ + case 78: +#line 1265 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3089 "awkgram.c" /* yacc.c:1646 */ +#line 3137 "awkgram.c" /* yacc.c:1646 */ break; - case 78: -#line 1245 "awkgram.y" /* yacc.c:1646 */ + case 79: +#line 1267 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->memory->type == Node_regex) (yyvsp[0])->opcode = Op_push_re; @@ -3097,47 +3145,57 @@ regular_print: (yyvsp[0])->opcode = Op_push; (yyval) = (yyvsp[0]); } -#line 3101 "awkgram.c" /* yacc.c:1646 */ +#line 3149 "awkgram.c" /* yacc.c:1646 */ break; - case 79: -#line 1256 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3107 "awkgram.c" /* yacc.c:1646 */ + case 80: +#line 1275 "awkgram.y" /* yacc.c:1646 */ + { + assert((yyvsp[0])->memory->type == Node_typedregex); + (yyvsp[0])->opcode = Op_push_re; + (yyval) = (yyvsp[0]); + } +#line 3159 "awkgram.c" /* yacc.c:1646 */ break; - case 80: -#line 1258 "awkgram.y" /* yacc.c:1646 */ + case 81: +#line 1284 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3113 "awkgram.c" /* yacc.c:1646 */ +#line 3165 "awkgram.c" /* yacc.c:1646 */ break; case 82: -#line 1268 "awkgram.y" /* yacc.c:1646 */ +#line 1286 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3171 "awkgram.c" /* yacc.c:1646 */ + break; + + case 84: +#line 1296 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3121 "awkgram.c" /* yacc.c:1646 */ +#line 3179 "awkgram.c" /* yacc.c:1646 */ break; - case 83: -#line 1275 "awkgram.y" /* yacc.c:1646 */ + case 85: +#line 1303 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; (yyval) = NULL; } -#line 3131 "awkgram.c" /* yacc.c:1646 */ +#line 3189 "awkgram.c" /* yacc.c:1646 */ break; - case 84: -#line 1280 "awkgram.y" /* yacc.c:1646 */ + case 86: +#line 1308 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } -#line 3137 "awkgram.c" /* yacc.c:1646 */ +#line 3195 "awkgram.c" /* yacc.c:1646 */ break; - case 85: -#line 1281 "awkgram.y" /* yacc.c:1646 */ + case 87: +#line 1309 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->redir_type == redirect_twoway && (yyvsp[0])->lasti->opcode == Op_K_getline_redir @@ -3145,63 +3203,63 @@ regular_print: yyerror(_("multistage two-way pipelines don't work")); (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } -#line 3149 "awkgram.c" /* yacc.c:1646 */ +#line 3207 "awkgram.c" /* yacc.c:1646 */ break; - case 86: -#line 1292 "awkgram.y" /* yacc.c:1646 */ + case 88: +#line 1320 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } -#line 3157 "awkgram.c" /* yacc.c:1646 */ +#line 3215 "awkgram.c" /* yacc.c:1646 */ break; - case 87: -#line 1297 "awkgram.y" /* yacc.c:1646 */ + case 89: +#line 1325 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } -#line 3165 "awkgram.c" /* yacc.c:1646 */ +#line 3223 "awkgram.c" /* yacc.c:1646 */ break; - case 92: -#line 1314 "awkgram.y" /* yacc.c:1646 */ + case 94: +#line 1342 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3171 "awkgram.c" /* yacc.c:1646 */ +#line 3229 "awkgram.c" /* yacc.c:1646 */ break; - case 93: -#line 1316 "awkgram.y" /* yacc.c:1646 */ + case 95: +#line 1344 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3180 "awkgram.c" /* yacc.c:1646 */ +#line 3238 "awkgram.c" /* yacc.c:1646 */ break; - case 94: -#line 1324 "awkgram.y" /* yacc.c:1646 */ + case 96: +#line 1352 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3186 "awkgram.c" /* yacc.c:1646 */ +#line 3244 "awkgram.c" /* yacc.c:1646 */ break; - case 95: -#line 1326 "awkgram.y" /* yacc.c:1646 */ + case 97: +#line 1354 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3192 "awkgram.c" /* yacc.c:1646 */ +#line 3250 "awkgram.c" /* yacc.c:1646 */ break; - case 96: -#line 1331 "awkgram.y" /* yacc.c:1646 */ + case 98: +#line 1359 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = 0; (yyval) = list_create((yyvsp[0])); } -#line 3201 "awkgram.c" /* yacc.c:1646 */ +#line 3259 "awkgram.c" /* yacc.c:1646 */ break; - case 97: -#line 1336 "awkgram.y" /* yacc.c:1646 */ + case 99: +#line 1364 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2]) != NULL && (yyvsp[0]) != NULL) { (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; @@ -3210,74 +3268,74 @@ regular_print: } else (yyval) = NULL; } -#line 3214 "awkgram.c" /* yacc.c:1646 */ +#line 3272 "awkgram.c" /* yacc.c:1646 */ break; - case 98: -#line 1345 "awkgram.y" /* yacc.c:1646 */ + case 100: +#line 1373 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3220 "awkgram.c" /* yacc.c:1646 */ +#line 3278 "awkgram.c" /* yacc.c:1646 */ break; - case 99: -#line 1347 "awkgram.y" /* yacc.c:1646 */ + case 101: +#line 1375 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3226 "awkgram.c" /* yacc.c:1646 */ +#line 3284 "awkgram.c" /* yacc.c:1646 */ break; - case 100: -#line 1349 "awkgram.y" /* yacc.c:1646 */ + case 102: +#line 1377 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } -#line 3232 "awkgram.c" /* yacc.c:1646 */ +#line 3290 "awkgram.c" /* yacc.c:1646 */ break; - case 101: -#line 1355 "awkgram.y" /* yacc.c:1646 */ + case 103: +#line 1383 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3238 "awkgram.c" /* yacc.c:1646 */ +#line 3296 "awkgram.c" /* yacc.c:1646 */ break; - case 102: -#line 1357 "awkgram.y" /* yacc.c:1646 */ + case 104: +#line 1385 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3244 "awkgram.c" /* yacc.c:1646 */ +#line 3302 "awkgram.c" /* yacc.c:1646 */ break; - case 103: -#line 1362 "awkgram.y" /* yacc.c:1646 */ + case 105: +#line 1390 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3250 "awkgram.c" /* yacc.c:1646 */ +#line 3308 "awkgram.c" /* yacc.c:1646 */ break; - case 104: -#line 1364 "awkgram.y" /* yacc.c:1646 */ + case 106: +#line 1392 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3256 "awkgram.c" /* yacc.c:1646 */ +#line 3314 "awkgram.c" /* yacc.c:1646 */ break; - case 105: -#line 1369 "awkgram.y" /* yacc.c:1646 */ + case 107: +#line 1397 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3262 "awkgram.c" /* yacc.c:1646 */ +#line 3320 "awkgram.c" /* yacc.c:1646 */ break; - case 106: -#line 1371 "awkgram.y" /* yacc.c:1646 */ + case 108: +#line 1399 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3271 "awkgram.c" /* yacc.c:1646 */ +#line 3329 "awkgram.c" /* yacc.c:1646 */ break; - case 107: -#line 1376 "awkgram.y" /* yacc.c:1646 */ + case 109: +#line 1404 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3277 "awkgram.c" /* yacc.c:1646 */ +#line 3335 "awkgram.c" /* yacc.c:1646 */ break; - case 108: -#line 1378 "awkgram.y" /* yacc.c:1646 */ + case 110: +#line 1406 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3285,62 +3343,62 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3289 "awkgram.c" /* yacc.c:1646 */ +#line 3347 "awkgram.c" /* yacc.c:1646 */ break; - case 109: -#line 1386 "awkgram.y" /* yacc.c:1646 */ + case 111: +#line 1414 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3298 "awkgram.c" /* yacc.c:1646 */ +#line 3356 "awkgram.c" /* yacc.c:1646 */ break; - case 110: -#line 1391 "awkgram.y" /* yacc.c:1646 */ + case 112: +#line 1419 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3307 "awkgram.c" /* yacc.c:1646 */ +#line 3365 "awkgram.c" /* yacc.c:1646 */ break; - case 111: -#line 1399 "awkgram.y" /* yacc.c:1646 */ + case 113: +#line 1427 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3313 "awkgram.c" /* yacc.c:1646 */ +#line 3371 "awkgram.c" /* yacc.c:1646 */ break; - case 112: -#line 1401 "awkgram.y" /* yacc.c:1646 */ + case 114: +#line 1429 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3319 "awkgram.c" /* yacc.c:1646 */ +#line 3377 "awkgram.c" /* yacc.c:1646 */ break; - case 113: -#line 1406 "awkgram.y" /* yacc.c:1646 */ + case 115: +#line 1434 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3325 "awkgram.c" /* yacc.c:1646 */ +#line 3383 "awkgram.c" /* yacc.c:1646 */ break; - case 114: -#line 1408 "awkgram.y" /* yacc.c:1646 */ + case 116: +#line 1436 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3334 "awkgram.c" /* yacc.c:1646 */ +#line 3392 "awkgram.c" /* yacc.c:1646 */ break; - case 115: -#line 1413 "awkgram.y" /* yacc.c:1646 */ + case 117: +#line 1441 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3340 "awkgram.c" /* yacc.c:1646 */ +#line 3398 "awkgram.c" /* yacc.c:1646 */ break; - case 116: -#line 1415 "awkgram.y" /* yacc.c:1646 */ + case 118: +#line 1443 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3348,58 +3406,89 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3352 "awkgram.c" /* yacc.c:1646 */ +#line 3410 "awkgram.c" /* yacc.c:1646 */ break; - case 117: -#line 1423 "awkgram.y" /* yacc.c:1646 */ + case 119: +#line 1451 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3361 "awkgram.c" /* yacc.c:1646 */ +#line 3419 "awkgram.c" /* yacc.c:1646 */ break; - case 118: -#line 1428 "awkgram.y" /* yacc.c:1646 */ + case 120: +#line 1456 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3370 "awkgram.c" /* yacc.c:1646 */ +#line 3428 "awkgram.c" /* yacc.c:1646 */ break; - case 119: -#line 1435 "awkgram.y" /* yacc.c:1646 */ + case 121: +#line 1463 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3376 "awkgram.c" /* yacc.c:1646 */ +#line 3434 "awkgram.c" /* yacc.c:1646 */ break; - case 120: -#line 1441 "awkgram.y" /* yacc.c:1646 */ + case 122: +#line 1464 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = list_create((yyvsp[0])); } +#line 3440 "awkgram.c" /* yacc.c:1646 */ + break; + + case 123: +#line 1470 "awkgram.y" /* yacc.c:1646 */ { if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec) lintwarn_ln((yyvsp[-1])->source_line, _("regular expression on right of assignment")); (yyval) = mk_assignment((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3387 "awkgram.c" /* yacc.c:1646 */ +#line 3451 "awkgram.c" /* yacc.c:1646 */ break; - case 121: -#line 1448 "awkgram.y" /* yacc.c:1646 */ + case 124: +#line 1477 "awkgram.y" /* yacc.c:1646 */ + { + (yyval) = mk_assignment((yyvsp[-2]), list_create((yyvsp[0])), (yyvsp[-1])); + } +#line 3459 "awkgram.c" /* yacc.c:1646 */ + break; + + case 125: +#line 1481 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3393 "awkgram.c" /* yacc.c:1646 */ +#line 3465 "awkgram.c" /* yacc.c:1646 */ break; - case 122: -#line 1450 "awkgram.y" /* yacc.c:1646 */ + case 126: +#line 1483 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3399 "awkgram.c" /* yacc.c:1646 */ +#line 3471 "awkgram.c" /* yacc.c:1646 */ break; - case 123: -#line 1452 "awkgram.y" /* yacc.c:1646 */ + case 127: +#line 1485 "awkgram.y" /* yacc.c:1646 */ + { + if ((yyvsp[-2])->lasti->opcode == Op_match_rec) + warning_ln((yyvsp[-1])->source_line, + _("regular expression on left of `~' or `!~' operator")); + + assert((yyvsp[0])->opcode == Op_push_re + && (yyvsp[0])->memory->type == Node_typedregex); + /* RHS is @/.../ */ + (yyvsp[-1])->memory = (yyvsp[0])->memory; + bcfree((yyvsp[0])); + (yyval) = list_append((yyvsp[-2]), (yyvsp[-1])); + } +#line 3488 "awkgram.c" /* yacc.c:1646 */ + break; + + case 128: +#line 1498 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[-1])->source_line, @@ -3416,11 +3505,11 @@ regular_print: (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } -#line 3420 "awkgram.c" /* yacc.c:1646 */ +#line 3509 "awkgram.c" /* yacc.c:1646 */ break; - case 124: -#line 1469 "awkgram.y" /* yacc.c:1646 */ + case 129: +#line 1515 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) warning_ln((yyvsp[-1])->source_line, @@ -3430,91 +3519,91 @@ regular_print: (yyvsp[-1])->expr_count = 1; (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3434 "awkgram.c" /* yacc.c:1646 */ +#line 3523 "awkgram.c" /* yacc.c:1646 */ break; - case 125: -#line 1479 "awkgram.y" /* yacc.c:1646 */ + case 130: +#line 1525 "awkgram.y" /* yacc.c:1646 */ { if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec) lintwarn_ln((yyvsp[-1])->source_line, _("regular expression on right of comparison")); (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3445 "awkgram.c" /* yacc.c:1646 */ +#line 3534 "awkgram.c" /* yacc.c:1646 */ break; - case 126: -#line 1486 "awkgram.y" /* yacc.c:1646 */ + case 131: +#line 1532 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3451 "awkgram.c" /* yacc.c:1646 */ +#line 3540 "awkgram.c" /* yacc.c:1646 */ break; - case 127: -#line 1488 "awkgram.y" /* yacc.c:1646 */ + case 132: +#line 1534 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3457 "awkgram.c" /* yacc.c:1646 */ +#line 3546 "awkgram.c" /* yacc.c:1646 */ break; - case 128: -#line 1493 "awkgram.y" /* yacc.c:1646 */ + case 133: +#line 1539 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3463 "awkgram.c" /* yacc.c:1646 */ +#line 3552 "awkgram.c" /* yacc.c:1646 */ break; - case 129: -#line 1495 "awkgram.y" /* yacc.c:1646 */ + case 134: +#line 1541 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3469 "awkgram.c" /* yacc.c:1646 */ +#line 3558 "awkgram.c" /* yacc.c:1646 */ break; - case 130: -#line 1497 "awkgram.y" /* yacc.c:1646 */ + case 135: +#line 1543 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_assign_quotient; (yyval) = (yyvsp[0]); } -#line 3478 "awkgram.c" /* yacc.c:1646 */ +#line 3567 "awkgram.c" /* yacc.c:1646 */ break; - case 131: -#line 1505 "awkgram.y" /* yacc.c:1646 */ + case 136: +#line 1551 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3484 "awkgram.c" /* yacc.c:1646 */ +#line 3573 "awkgram.c" /* yacc.c:1646 */ break; - case 132: -#line 1507 "awkgram.y" /* yacc.c:1646 */ + case 137: +#line 1553 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3490 "awkgram.c" /* yacc.c:1646 */ +#line 3579 "awkgram.c" /* yacc.c:1646 */ break; - case 133: -#line 1512 "awkgram.y" /* yacc.c:1646 */ + case 138: +#line 1558 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3496 "awkgram.c" /* yacc.c:1646 */ +#line 3585 "awkgram.c" /* yacc.c:1646 */ break; - case 134: -#line 1514 "awkgram.y" /* yacc.c:1646 */ + case 139: +#line 1560 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3502 "awkgram.c" /* yacc.c:1646 */ +#line 3591 "awkgram.c" /* yacc.c:1646 */ break; - case 135: -#line 1519 "awkgram.y" /* yacc.c:1646 */ + case 140: +#line 1565 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3508 "awkgram.c" /* yacc.c:1646 */ +#line 3597 "awkgram.c" /* yacc.c:1646 */ break; - case 136: -#line 1521 "awkgram.y" /* yacc.c:1646 */ + case 141: +#line 1567 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3514 "awkgram.c" /* yacc.c:1646 */ +#line 3603 "awkgram.c" /* yacc.c:1646 */ break; - case 137: -#line 1523 "awkgram.y" /* yacc.c:1646 */ + case 142: +#line 1569 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; @@ -3567,47 +3656,47 @@ regular_print: max_args = count; } } -#line 3571 "awkgram.c" /* yacc.c:1646 */ +#line 3660 "awkgram.c" /* yacc.c:1646 */ break; - case 139: -#line 1581 "awkgram.y" /* yacc.c:1646 */ + case 144: +#line 1627 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3577 "awkgram.c" /* yacc.c:1646 */ +#line 3666 "awkgram.c" /* yacc.c:1646 */ break; - case 140: -#line 1583 "awkgram.y" /* yacc.c:1646 */ + case 145: +#line 1629 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3583 "awkgram.c" /* yacc.c:1646 */ +#line 3672 "awkgram.c" /* yacc.c:1646 */ break; - case 141: -#line 1585 "awkgram.y" /* yacc.c:1646 */ + case 146: +#line 1631 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3589 "awkgram.c" /* yacc.c:1646 */ +#line 3678 "awkgram.c" /* yacc.c:1646 */ break; - case 142: -#line 1587 "awkgram.y" /* yacc.c:1646 */ + case 147: +#line 1633 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3595 "awkgram.c" /* yacc.c:1646 */ +#line 3684 "awkgram.c" /* yacc.c:1646 */ break; - case 143: -#line 1589 "awkgram.y" /* yacc.c:1646 */ + case 148: +#line 1635 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3601 "awkgram.c" /* yacc.c:1646 */ +#line 3690 "awkgram.c" /* yacc.c:1646 */ break; - case 144: -#line 1591 "awkgram.y" /* yacc.c:1646 */ + case 149: +#line 1637 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3607 "awkgram.c" /* yacc.c:1646 */ +#line 3696 "awkgram.c" /* yacc.c:1646 */ break; - case 145: -#line 1593 "awkgram.y" /* yacc.c:1646 */ + case 150: +#line 1639 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3621,29 +3710,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } -#line 3625 "awkgram.c" /* yacc.c:1646 */ +#line 3714 "awkgram.c" /* yacc.c:1646 */ break; - case 146: -#line 1607 "awkgram.y" /* yacc.c:1646 */ + case 151: +#line 1653 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3634 "awkgram.c" /* yacc.c:1646 */ +#line 3723 "awkgram.c" /* yacc.c:1646 */ break; - case 147: -#line 1612 "awkgram.y" /* yacc.c:1646 */ + case 152: +#line 1658 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3643 "awkgram.c" /* yacc.c:1646 */ +#line 3732 "awkgram.c" /* yacc.c:1646 */ break; - case 148: -#line 1617 "awkgram.y" /* yacc.c:1646 */ + case 153: +#line 1663 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { warning_ln((yyvsp[-1])->source_line, @@ -3663,64 +3752,64 @@ regular_print: (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } -#line 3667 "awkgram.c" /* yacc.c:1646 */ +#line 3756 "awkgram.c" /* yacc.c:1646 */ break; - case 149: -#line 1642 "awkgram.y" /* yacc.c:1646 */ + case 154: +#line 1688 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); bcfree((yyvsp[-2])); } -#line 3676 "awkgram.c" /* yacc.c:1646 */ +#line 3765 "awkgram.c" /* yacc.c:1646 */ break; - case 150: -#line 1648 "awkgram.y" /* yacc.c:1646 */ + case 155: +#line 1694 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3682 "awkgram.c" /* yacc.c:1646 */ +#line 3771 "awkgram.c" /* yacc.c:1646 */ break; - case 151: -#line 1650 "awkgram.y" /* yacc.c:1646 */ + case 156: +#line 1696 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3688 "awkgram.c" /* yacc.c:1646 */ +#line 3777 "awkgram.c" /* yacc.c:1646 */ break; - case 152: -#line 1652 "awkgram.y" /* yacc.c:1646 */ + case 157: +#line 1698 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3694 "awkgram.c" /* yacc.c:1646 */ +#line 3783 "awkgram.c" /* yacc.c:1646 */ break; - case 153: -#line 1654 "awkgram.y" /* yacc.c:1646 */ + case 158: +#line 1700 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3700 "awkgram.c" /* yacc.c:1646 */ +#line 3789 "awkgram.c" /* yacc.c:1646 */ break; - case 154: -#line 1656 "awkgram.y" /* yacc.c:1646 */ + case 159: +#line 1702 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3706 "awkgram.c" /* yacc.c:1646 */ +#line 3795 "awkgram.c" /* yacc.c:1646 */ break; - case 155: -#line 1658 "awkgram.y" /* yacc.c:1646 */ + case 160: +#line 1704 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3712 "awkgram.c" /* yacc.c:1646 */ +#line 3801 "awkgram.c" /* yacc.c:1646 */ break; - case 156: -#line 1663 "awkgram.y" /* yacc.c:1646 */ + case 161: +#line 1709 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3720 "awkgram.c" /* yacc.c:1646 */ +#line 3809 "awkgram.c" /* yacc.c:1646 */ break; - case 157: -#line 1667 "awkgram.y" /* yacc.c:1646 */ + case 162: +#line 1713 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->opcode == Op_match_rec) { (yyvsp[0])->opcode = Op_nomatch; @@ -3752,37 +3841,37 @@ regular_print: } } } -#line 3756 "awkgram.c" /* yacc.c:1646 */ +#line 3845 "awkgram.c" /* yacc.c:1646 */ break; - case 158: -#line 1699 "awkgram.y" /* yacc.c:1646 */ + case 163: +#line 1745 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3762 "awkgram.c" /* yacc.c:1646 */ +#line 3851 "awkgram.c" /* yacc.c:1646 */ break; - case 159: -#line 1701 "awkgram.y" /* yacc.c:1646 */ + case 164: +#line 1747 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3772 "awkgram.c" /* yacc.c:1646 */ +#line 3861 "awkgram.c" /* yacc.c:1646 */ break; - case 160: -#line 1707 "awkgram.y" /* yacc.c:1646 */ + case 165: +#line 1753 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3782 "awkgram.c" /* yacc.c:1646 */ +#line 3871 "awkgram.c" /* yacc.c:1646 */ break; - case 161: -#line 1713 "awkgram.y" /* yacc.c:1646 */ + case 166: +#line 1759 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; @@ -3795,45 +3884,45 @@ regular_print: if ((yyval) == NULL) YYABORT; } -#line 3799 "awkgram.c" /* yacc.c:1646 */ +#line 3888 "awkgram.c" /* yacc.c:1646 */ break; - case 164: -#line 1728 "awkgram.y" /* yacc.c:1646 */ + case 169: +#line 1774 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3808 "awkgram.c" /* yacc.c:1646 */ +#line 3897 "awkgram.c" /* yacc.c:1646 */ break; - case 165: -#line 1733 "awkgram.y" /* yacc.c:1646 */ + case 170: +#line 1779 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3817 "awkgram.c" /* yacc.c:1646 */ +#line 3906 "awkgram.c" /* yacc.c:1646 */ break; - case 166: -#line 1738 "awkgram.y" /* yacc.c:1646 */ + case 171: +#line 1784 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3825 "awkgram.c" /* yacc.c:1646 */ +#line 3914 "awkgram.c" /* yacc.c:1646 */ break; - case 167: -#line 1742 "awkgram.y" /* yacc.c:1646 */ + case 172: +#line 1788 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3833 "awkgram.c" /* yacc.c:1646 */ +#line 3922 "awkgram.c" /* yacc.c:1646 */ break; - case 168: -#line 1746 "awkgram.y" /* yacc.c:1646 */ + case 173: +#line 1792 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & STRING) == 0 @@ -3848,11 +3937,11 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3852 "awkgram.c" /* yacc.c:1646 */ +#line 3941 "awkgram.c" /* yacc.c:1646 */ break; - case 169: -#line 1761 "awkgram.y" /* yacc.c:1646 */ + case 174: +#line 1807 "awkgram.y" /* yacc.c:1646 */ { /* * was: $$ = $2 @@ -3862,20 +3951,20 @@ regular_print: (yyvsp[-1])->memory = make_profile_number(0.0, "0", 1); (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } -#line 3866 "awkgram.c" /* yacc.c:1646 */ +#line 3955 "awkgram.c" /* yacc.c:1646 */ break; - case 170: -#line 1774 "awkgram.y" /* yacc.c:1646 */ + case 175: +#line 1820 "awkgram.y" /* yacc.c:1646 */ { func_use((yyvsp[0])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[0]); } -#line 3875 "awkgram.c" /* yacc.c:1646 */ +#line 3964 "awkgram.c" /* yacc.c:1646 */ break; - case 171: -#line 1779 "awkgram.y" /* yacc.c:1646 */ + case 176: +#line 1825 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3909,11 +3998,11 @@ regular_print: (yyval) = list_prepend((yyvsp[0]), t); at_seen = false; } -#line 3913 "awkgram.c" /* yacc.c:1646 */ +#line 4002 "awkgram.c" /* yacc.c:1646 */ break; - case 172: -#line 1816 "awkgram.y" /* yacc.c:1646 */ + case 177: +#line 1862 "awkgram.y" /* yacc.c:1646 */ { NODE *n; @@ -3938,49 +4027,49 @@ regular_print: (yyval) = list_append(t, (yyvsp[-3])); } } -#line 3942 "awkgram.c" /* yacc.c:1646 */ +#line 4031 "awkgram.c" /* yacc.c:1646 */ break; - case 173: -#line 1844 "awkgram.y" /* yacc.c:1646 */ + case 178: +#line 1890 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3948 "awkgram.c" /* yacc.c:1646 */ +#line 4037 "awkgram.c" /* yacc.c:1646 */ break; - case 174: -#line 1846 "awkgram.y" /* yacc.c:1646 */ + case 179: +#line 1892 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3954 "awkgram.c" /* yacc.c:1646 */ +#line 4043 "awkgram.c" /* yacc.c:1646 */ break; - case 175: -#line 1851 "awkgram.y" /* yacc.c:1646 */ + case 180: +#line 1897 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3960 "awkgram.c" /* yacc.c:1646 */ +#line 4049 "awkgram.c" /* yacc.c:1646 */ break; - case 176: -#line 1853 "awkgram.y" /* yacc.c:1646 */ + case 181: +#line 1899 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3966 "awkgram.c" /* yacc.c:1646 */ +#line 4055 "awkgram.c" /* yacc.c:1646 */ break; - case 177: -#line 1858 "awkgram.y" /* yacc.c:1646 */ + case 182: +#line 1904 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3972 "awkgram.c" /* yacc.c:1646 */ +#line 4061 "awkgram.c" /* yacc.c:1646 */ break; - case 178: -#line 1860 "awkgram.y" /* yacc.c:1646 */ + case 183: +#line 1906 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3980 "awkgram.c" /* yacc.c:1646 */ +#line 4069 "awkgram.c" /* yacc.c:1646 */ break; - case 179: -#line 1867 "awkgram.y" /* yacc.c:1646 */ + case 184: +#line 1913 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3994,11 +4083,11 @@ regular_print: sub_counter++; /* count # of dimensions */ (yyval) = (yyvsp[0]); } -#line 3998 "awkgram.c" /* yacc.c:1646 */ +#line 4087 "awkgram.c" /* yacc.c:1646 */ break; - case 180: -#line 1884 "awkgram.y" /* yacc.c:1646 */ + case 185: +#line 1930 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *t = (yyvsp[-1]); if ((yyvsp[-1]) == NULL) { @@ -4012,31 +4101,31 @@ regular_print: (yyvsp[0])->sub_count = count_expressions(&t, false); (yyval) = list_append(t, (yyvsp[0])); } -#line 4016 "awkgram.c" /* yacc.c:1646 */ +#line 4105 "awkgram.c" /* yacc.c:1646 */ break; - case 181: -#line 1901 "awkgram.y" /* yacc.c:1646 */ + case 186: +#line 1947 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 4022 "awkgram.c" /* yacc.c:1646 */ +#line 4111 "awkgram.c" /* yacc.c:1646 */ break; - case 182: -#line 1903 "awkgram.y" /* yacc.c:1646 */ + case 187: +#line 1949 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 4030 "awkgram.c" /* yacc.c:1646 */ +#line 4119 "awkgram.c" /* yacc.c:1646 */ break; - case 183: -#line 1910 "awkgram.y" /* yacc.c:1646 */ + case 188: +#line 1956 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 4036 "awkgram.c" /* yacc.c:1646 */ +#line 4125 "awkgram.c" /* yacc.c:1646 */ break; - case 184: -#line 1915 "awkgram.y" /* yacc.c:1646 */ + case 189: +#line 1961 "awkgram.y" /* yacc.c:1646 */ { char *var_name = (yyvsp[0])->lextok; @@ -4044,22 +4133,22 @@ regular_print: (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); (yyval) = list_create((yyvsp[0])); } -#line 4048 "awkgram.c" /* yacc.c:1646 */ +#line 4137 "awkgram.c" /* yacc.c:1646 */ break; - case 185: -#line 1923 "awkgram.y" /* yacc.c:1646 */ + case 190: +#line 1969 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-1])->lextok; (yyvsp[-1])->memory = variable((yyvsp[-1])->source_line, arr, Node_var_new); (yyvsp[-1])->opcode = Op_push_array; (yyval) = list_prepend((yyvsp[0]), (yyvsp[-1])); } -#line 4059 "awkgram.c" /* yacc.c:1646 */ +#line 4148 "awkgram.c" /* yacc.c:1646 */ break; - case 186: -#line 1933 "awkgram.y" /* yacc.c:1646 */ + case 191: +#line 1979 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push @@ -4071,73 +4160,73 @@ regular_print: } else (yyval) = (yyvsp[0]); } -#line 4075 "awkgram.c" /* yacc.c:1646 */ +#line 4164 "awkgram.c" /* yacc.c:1646 */ break; - case 187: -#line 1945 "awkgram.y" /* yacc.c:1646 */ + case 192: +#line 1991 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); if ((yyvsp[0]) != NULL) mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 4085 "awkgram.c" /* yacc.c:1646 */ +#line 4174 "awkgram.c" /* yacc.c:1646 */ break; - case 188: -#line 1954 "awkgram.y" /* yacc.c:1646 */ + case 193: +#line 2000 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; } -#line 4093 "awkgram.c" /* yacc.c:1646 */ +#line 4182 "awkgram.c" /* yacc.c:1646 */ break; - case 189: -#line 1958 "awkgram.y" /* yacc.c:1646 */ + case 194: +#line 2004 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; } -#line 4101 "awkgram.c" /* yacc.c:1646 */ +#line 4190 "awkgram.c" /* yacc.c:1646 */ break; - case 190: -#line 1961 "awkgram.y" /* yacc.c:1646 */ + case 195: +#line 2007 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 4107 "awkgram.c" /* yacc.c:1646 */ +#line 4196 "awkgram.c" /* yacc.c:1646 */ break; - case 192: -#line 1969 "awkgram.y" /* yacc.c:1646 */ + case 197: +#line 2015 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 4113 "awkgram.c" /* yacc.c:1646 */ +#line 4202 "awkgram.c" /* yacc.c:1646 */ break; - case 193: -#line 1973 "awkgram.y" /* yacc.c:1646 */ + case 198: +#line 2019 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 4119 "awkgram.c" /* yacc.c:1646 */ +#line 4208 "awkgram.c" /* yacc.c:1646 */ break; - case 196: -#line 1982 "awkgram.y" /* yacc.c:1646 */ + case 201: +#line 2028 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 4125 "awkgram.c" /* yacc.c:1646 */ +#line 4214 "awkgram.c" /* yacc.c:1646 */ break; - case 197: -#line 1986 "awkgram.y" /* yacc.c:1646 */ + case 202: +#line 2032 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); yyerrok; } -#line 4131 "awkgram.c" /* yacc.c:1646 */ +#line 4220 "awkgram.c" /* yacc.c:1646 */ break; - case 198: -#line 1990 "awkgram.y" /* yacc.c:1646 */ + case 203: +#line 2036 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 4137 "awkgram.c" /* yacc.c:1646 */ +#line 4226 "awkgram.c" /* yacc.c:1646 */ break; -#line 4141 "awkgram.c" /* yacc.c:1646 */ +#line 4230 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4365,7 +4454,7 @@ yyreturn: #endif return yyresult; } -#line 1992 "awkgram.y" /* yacc.c:1906 */ +#line 2038 "awkgram.y" /* yacc.c:1906 */ struct token { @@ -5695,6 +5784,7 @@ yylex(void) bool inhex = false; bool intlstr = false; AWKNUM d; + bool collecting_typed_regexp = false; #define GET_INSTRUCTION(op) bcalloc(op, 1, sourceline) @@ -5729,7 +5819,7 @@ yylex(void) lexeme = lexptr; thisline = NULL; - +collect_regexp: if (want_regexp) { int in_brack = 0; /* count brackets, [[:alnum:]] allowed */ int b_index = -1; @@ -5816,7 +5906,11 @@ end_regexp: peek); } } - lasttok = REGEXP; + if (collecting_typed_regexp) { + collecting_typed_regexp = false; + lasttok = TYPED_REGEXP; + } else + lasttok = REGEXP; return lasttok; case '\n': @@ -5876,6 +5970,13 @@ retry: return lasttok = NEWLINE; case '@': + c = nextc(true); + if (c == '/') { + want_regexp = true; + collecting_typed_regexp = true; + goto collect_regexp; + } + pushback(); at_seen = true; return lasttok = '@'; @@ -6933,6 +7034,8 @@ valinfo(NODE *n, Func_print print_func, FILE *fp) { if (n == Nnull_string) print_func(fp, "uninitialized scalar\n"); + else if (n->type == Node_typedregex) + print_func(fp, "@/%.*s/\n", n->re_exp->stlen, n->re_exp->stptr); else if ((n->flags & STRING) != 0) { pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', false); print_func(fp, "\n"); @@ -7307,7 +7410,7 @@ make_regnode(int type, NODE *exp) n->type = type; n->re_cnt = 1; - if (type == Node_regex) { + if (type == Node_regex || type == Node_typedregex) { n->re_reg = make_regexp(exp->stptr, exp->stlen, false, true, false); if (n->re_reg == NULL) { freenode(n); @@ -173,7 +173,7 @@ extern double fmod(double x, double y); %} %token FUNC_CALL NAME REGEXP FILENAME -%token YNUMBER YSTRING +%token YNUMBER YSTRING TYPED_REGEXP %token RELOP IO_OUT IO_IN %token ASSIGNOP ASSIGN MATCHOP CONCAT_OP %token SUBSCRIPT @@ -201,7 +201,7 @@ extern double fmod(double x, double y); %left MATCHOP %nonassoc RELOP '<' '>' IO_IN IO_OUT %left CONCAT_OP -%left YSTRING YNUMBER +%left YSTRING YNUMBER TYPED_REGEXP %left '+' '-' %left '*' '/' '%' %right '!' UNARY @@ -512,6 +512,28 @@ regexp } ; +typed_regexp + : TYPED_REGEXP + { + NODE *n, *exp; + char *re; + size_t len; + + re = $1->lextok; + $1->lextok = NULL; + len = strlen(re); + + exp = make_str_node(re, len, ALREADY_MALLOCED); + n = make_regnode(Node_typedregex, exp); + if (n == NULL) { + unref(exp); + YYABORT; + } + $$ = $1; + $$->opcode = Op_push_re; + $$->memory = n; + } + a_slash : '/' { bcfree($1); } @@ -1249,6 +1271,12 @@ case_value $1->opcode = Op_push; $$ = $1; } + | typed_regexp + { + assert($1->memory->type == Node_typedregex); + $1->opcode = Op_push_re; + $$ = $1; + } ; print @@ -1433,6 +1461,7 @@ fcall_expression_list fcall_exp : exp { $$ = $1; } + | typed_regexp { $$ = list_create($1); } ; /* Expressions, not including the comma operator. */ @@ -1444,10 +1473,27 @@ exp _("regular expression on right of assignment")); $$ = mk_assignment($1, $3, $2); } + | variable ASSIGN typed_regexp %prec ASSIGNOP + { + $$ = mk_assignment($1, list_create($3), $2); + } | exp LEX_AND exp { $$ = mk_boolean($1, $3, $2); } | exp LEX_OR exp { $$ = mk_boolean($1, $3, $2); } + | exp MATCHOP typed_regexp + { + if ($1->lasti->opcode == Op_match_rec) + warning_ln($2->source_line, + _("regular expression on left of `~' or `!~' operator")); + + assert($3->opcode == Op_push_re + && $3->memory->type == Node_typedregex); + /* RHS is @/.../ */ + $2->memory = $3->memory; + bcfree($3); + $$ = list_append($1, $2); + } | exp MATCHOP exp { if ($1->lasti->opcode == Op_match_rec) @@ -3318,6 +3364,7 @@ yylex(void) bool inhex = false; bool intlstr = false; AWKNUM d; + bool collecting_typed_regexp = false; #define GET_INSTRUCTION(op) bcalloc(op, 1, sourceline) @@ -3352,7 +3399,7 @@ yylex(void) lexeme = lexptr; thisline = NULL; - +collect_regexp: if (want_regexp) { int in_brack = 0; /* count brackets, [[:alnum:]] allowed */ int b_index = -1; @@ -3439,7 +3486,11 @@ end_regexp: peek); } } - lasttok = REGEXP; + if (collecting_typed_regexp) { + collecting_typed_regexp = false; + lasttok = TYPED_REGEXP; + } else + lasttok = REGEXP; return lasttok; case '\n': @@ -3499,6 +3550,13 @@ retry: return lasttok = NEWLINE; case '@': + c = nextc(true); + if (c == '/') { + want_regexp = true; + collecting_typed_regexp = true; + goto collect_regexp; + } + pushback(); at_seen = true; return lasttok = '@'; @@ -4556,6 +4614,8 @@ valinfo(NODE *n, Func_print print_func, FILE *fp) { if (n == Nnull_string) print_func(fp, "uninitialized scalar\n"); + else if (n->type == Node_typedregex) + print_func(fp, "@/%.*s/\n", n->re_exp->stlen, n->re_exp->stptr); else if ((n->flags & STRING) != 0) { pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', false); print_func(fp, "\n"); @@ -4930,7 +4990,7 @@ make_regnode(int type, NODE *exp) n->type = type; n->re_cnt = 1; - if (type == Node_regex) { + if (type == Node_regex || type == Node_typedregex) { n->re_reg = make_regexp(exp->stptr, exp->stlen, false, true, false); if (n->re_reg == NULL) { freenode(n); @@ -532,7 +532,7 @@ do_length(int nargs) return make_number(size); } - assert(tmp->type == Node_val); + assert(tmp->type == Node_val || tmp->type == Node_typedregex); if (do_lint && (fixtype(tmp)->flags & STRING) == 0) lintwarn(_("length: received non-string argument")); @@ -2191,10 +2191,12 @@ do_print(int nargs, int redirtype) fatal(_("attempt to use array `%s' in a scalar context"), array_vname(tmp)); } - if ( (tmp->flags & STRCUR) == 0 - || ( tmp->stfmt != STFMT_UNUSED - && tmp->stfmt != OFMTidx)) - args_array[i] = format_val(OFMT, OFMTidx, tmp); + if (tmp->type == Node_typedregex) + args_array[i] = force_string(tmp); + else if ( (tmp->flags & STRCUR) == 0 + || ( tmp->stfmt != STFMT_UNUSED + && tmp->stfmt != OFMTidx)) + args_array[i] = format_val(OFMT, OFMTidx, tmp); } if (redir_exp != NULL) { @@ -3197,7 +3199,8 @@ call_sub(const char *name, int nargs) * push replace * push $0 */ - regex = make_regnode(Node_regex, regex); + if (regex->type != Node_typedregex) + regex = make_regnode(Node_regex, regex); PUSH(regex); PUSH(replace); lhs = r_get_field(zero, (Func_ptr *) 0, true); @@ -3221,7 +3224,8 @@ call_sub(const char *name, int nargs) * nargs++ * } */ - regex = make_regnode(Node_regex, regex); + if (regex->type != Node_typedregex) + regex = make_regnode(Node_regex, regex); PUSH(regex); PUSH(replace); PUSH(glob_flag); @@ -3258,7 +3262,8 @@ call_match(int nargs) /* Don't need to pop the string just to push it back ... */ - regex = make_regnode(Node_regex, regex); + if (regex->type != Node_typedregex) + regex = make_regnode(Node_regex, regex); PUSH(regex); if (array) @@ -3286,7 +3291,8 @@ call_split_func(const char *name, int nargs) if (nargs >= 3) { regex = POP_STRING(); - regex = make_regnode(Node_regex, regex); + if (regex->type != Node_typedregex) + regex = make_regnode(Node_regex, regex); } else { if (name[0] == 's') { regex = make_regnode(Node_regex, FS_node->var_value); @@ -3942,6 +3948,9 @@ do_typeof(int nargs) res = "array"; deref = false; break; + case Node_typedregex: + res = "regexp"; + break; case Node_val: case Node_var: switch (arg->flags & (STRING|NUMBER|MAYBE_NUM)) { @@ -1736,6 +1736,8 @@ watchpoint_triggered(struct list_item *w) /* new != NULL */ if (t2->type == Node_val) w->cur_value = dupnode(t2); + else if (t2->type == Node_typedregex) + w->cur_value = dupnode(t2); else { w->flags |= CUR_IS_ARRAY; w->cur_size = (t2->type == Node_var_array) ? assoc_length(t2) : 0; @@ -1748,6 +1750,7 @@ watchpoint_triggered(struct list_item *w) w->flags |= CUR_IS_ARRAY; w->cur_size = assoc_length(t2); } else + /* works for Node_typedregex too */ w->cur_value = dupnode(t2); } @@ -1790,6 +1793,8 @@ initialize_watch_item(struct list_item *w) } else if (symbol->type == Node_var_array) { w->flags |= CUR_IS_ARRAY; w->cur_size = assoc_length(symbol); + } else if (symbol->type == Node_typedregex) { + w->cur_value = dupnode(symbol); } /* else can't happen */ } @@ -3708,6 +3713,9 @@ print_memory(NODE *m, NODE *func, Func_print print_func, FILE *fp) print_func(fp, " [%s]", flags2str(m->flags)); break; + case Node_typedregex: + print_func(fp, "@"); + /* fall through */ case Node_regex: pp_string_fp(print_func, fp, m->re_exp->stptr, m->re_exp->stlen, '/', false); break; diff --git a/doc/ChangeLog b/doc/ChangeLog index f5743cb0..b8f37013 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -37,6 +37,12 @@ 2016-08-03 Arnold D. Robbins <arnold@skeeve.com> + Restored doc on typed regexes. + + * gawk.1, gawktexi.in: Updated. + +2016-08-03 Arnold D. Robbins <arnold@skeeve.com> + Remove typed regexes until they can be done properly. * gawk.1, gawktexi.in: Updated. @@ -3230,6 +3230,7 @@ Return a string indicating the type of The string will be one of \fB"array"\fP, \fB"number"\fP, +\fB"regexp"\fP, \fB"string"\fP, \fB"strnum"\fP, or diff --git a/doc/gawk.info b/doc/gawk.info index 3c68a117..72703060 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -4139,6 +4139,54 @@ that you can define a variable to be a number or a string: str = "hi" String variable re = /foo/ Wrong! re is the result of $0 ~ /foo/ + For a number of more advanced use cases (described later on in this +Info file), it would be nice to have regexp constants that are "strongly +typed"; in other words, that denote a regexp useful for matching, and +not an expression. + + 'gawk' provides this feature. A strongly typed regexp constant looks +almost like a regular regexp constant, except that it is preceded by an +'@' sign: + + re = @/foo/ Regexp variable + + Strongly typed regexp constants _cannot_ be used eveywhere that a +regular regexp constant can, because this would make the language even +more confusing. Instead, you may use them only in certain contexts: + + * On the righthand side of the '~' and '!~' operators: 'some_var ~ + @/foo/' (*note Regexp Usage::). + + * In the 'case' part of a 'switch' statement (*note Switch + Statement::). + + * As an argument to one of the built-in functions that accept regexp + constants: 'gensub()', 'gsub()', 'match()', 'patsplit()', + 'split()', and 'sub()' (*note String Functions::). + + * As a parameter in a call to a user-defined function (*note + User-defined::). + + * On the righthand side of an assignment to a variable: 'some_var = + @/foo/'. In this case, the type of 'some_var' is regexp. + Additionally, 'some_var' can be used with '~' and '!~', passed to + one of the built-in functions listed above, or passed as a + parameter to a user-defined function. + + You may use the 'typeof()' built-in function (*note Type Functions::) +to determine if a variable or function parameter is a regexp variable. + + The true power of this feature comes from the ability to create +variables that have regexp type. Such variables can be passed on to +user-defined functions, without the confusing aspects of computed +regular expressions created from strings or string constants. They may +also be passed through indirect function calls (*note Indirect Calls::) +onto the built-in functions that accept regexp constants. + + When used in numeric conversions, strongly typed regexp variables +convert to zero. When used in string conversions, they convert to the +string value of the original regexp text. + File: gawk.info, Node: Regexp Summary, Prev: Strong Regexp Constants, Up: Regexp @@ -4176,6 +4224,9 @@ File: gawk.info, Node: Regexp Summary, Prev: Strong Regexp Constants, Up: Reg sensitivity of regexp matching. In other 'awk' versions, use 'tolower()' or 'toupper()'. + * Strongly typed regexp constants ('@/.../') enable certain advanced + use cases to be described later on in the Info file. + File: gawk.info, Node: Reading Files, Next: Printing, Prev: Regexp, Up: Top @@ -13570,6 +13621,10 @@ contexts. '"array"' X is an array. + '"regexp"' + X is a strongly typed regexp (*note Strong Regexp + Constants::). + '"number"' X is a number. @@ -13616,7 +13671,8 @@ parameter is an array or not. turning it into a scalar. The 'typeof()' function is general; it allows you to determine if a -variable or function parameter is a scalar, an array. +variable or function parameter is a scalar, an array, or a strongly +typed regexp. 'isarray()' is deprecated; you should use 'typeof()' instead. You should replace any existing uses of 'isarray(var)' in your code with @@ -35379,502 +35435,502 @@ Node: Case-sensitivity186200 Ref: Case-sensitivity-Footnote-1189096 Ref: Case-sensitivity-Footnote-2189331 Node: Strong Regexp Constants189439 -Node: Regexp Summary190228 -Node: Reading Files191703 -Node: Records193866 -Node: awk split records194599 -Node: gawk split records199530 -Ref: gawk split records-Footnote-1204070 -Node: Fields204107 -Node: Nonconstant Fields206848 -Ref: Nonconstant Fields-Footnote-1209084 -Node: Changing Fields209288 -Node: Field Separators215216 -Node: Default Field Splitting217914 -Node: Regexp Field Splitting219032 -Node: Single Character Fields222385 -Node: Command Line Field Separator223445 -Node: Full Line Fields226663 -Ref: Full Line Fields-Footnote-1228185 -Ref: Full Line Fields-Footnote-2228231 -Node: Field Splitting Summary228332 -Node: Constant Size230406 -Node: Splitting By Content234984 -Ref: Splitting By Content-Footnote-1238955 -Node: Multiple Line239118 -Ref: Multiple Line-Footnote-1245000 -Node: Getline245179 -Node: Plain Getline247646 -Node: Getline/Variable250285 -Node: Getline/File251434 -Node: Getline/Variable/File252820 -Ref: Getline/Variable/File-Footnote-1254423 -Node: Getline/Pipe254511 -Node: Getline/Variable/Pipe257216 -Node: Getline/Coprocess258349 -Node: Getline/Variable/Coprocess259614 -Node: Getline Notes260354 -Node: Getline Summary263149 -Ref: table-getline-variants263571 -Node: Read Timeout264319 -Ref: Read Timeout-Footnote-1268225 -Node: Retrying Input268283 -Node: Command-line directories269482 -Node: Input Summary270388 -Node: Input Exercises273560 -Node: Printing274288 -Node: Print276122 -Node: Print Examples277579 -Node: Output Separators280359 -Node: OFMT282376 -Node: Printf283732 -Node: Basic Printf284517 -Node: Control Letters286091 -Node: Format Modifiers290079 -Node: Printf Examples296094 -Node: Redirection298580 -Node: Special FD305421 -Ref: Special FD-Footnote-1308589 -Node: Special Files308663 -Node: Other Inherited Files309280 -Node: Special Network310281 -Node: Special Caveats311141 -Node: Close Files And Pipes312090 -Ref: table-close-pipe-return-values318997 -Ref: Close Files And Pipes-Footnote-1319780 -Ref: Close Files And Pipes-Footnote-2319928 -Node: Nonfatal320080 -Node: Output Summary322405 -Node: Output Exercises323627 -Node: Expressions324306 -Node: Values325494 -Node: Constants326172 -Node: Scalar Constants326863 -Ref: Scalar Constants-Footnote-1327727 -Node: Nondecimal-numbers327977 -Node: Regexp Constants330990 -Node: Using Constant Regexps331516 -Node: Variables334679 -Node: Using Variables335336 -Node: Assignment Options337246 -Node: Conversion339119 -Node: Strings And Numbers339643 -Ref: Strings And Numbers-Footnote-1342706 -Node: Locale influences conversions342815 -Ref: table-locale-affects345573 -Node: All Operators346191 -Node: Arithmetic Ops346820 -Node: Concatenation349326 -Ref: Concatenation-Footnote-1352173 -Node: Assignment Ops352280 -Ref: table-assign-ops357271 -Node: Increment Ops358584 -Node: Truth Values and Conditions362044 -Node: Truth Values363118 -Node: Typing and Comparison364166 -Node: Variable Typing364986 -Node: Comparison Operators368610 -Ref: table-relational-ops369029 -Node: POSIX String Comparison372524 -Ref: POSIX String Comparison-Footnote-1374219 -Ref: POSIX String Comparison-Footnote-2374358 -Node: Boolean Ops374442 -Ref: Boolean Ops-Footnote-1378924 -Node: Conditional Exp379016 -Node: Function Calls380752 -Node: Precedence384629 -Node: Locales388288 -Node: Expressions Summary389920 -Node: Patterns and Actions392493 -Node: Pattern Overview393613 -Node: Regexp Patterns395290 -Node: Expression Patterns395832 -Node: Ranges399613 -Node: BEGIN/END402721 -Node: Using BEGIN/END403482 -Ref: Using BEGIN/END-Footnote-1406218 -Node: I/O And BEGIN/END406324 -Node: BEGINFILE/ENDFILE408638 -Node: Empty411545 -Node: Using Shell Variables411862 -Node: Action Overview414136 -Node: Statements416461 -Node: If Statement418309 -Node: While Statement419804 -Node: Do Statement421832 -Node: For Statement422980 -Node: Switch Statement426138 -Node: Break Statement428524 -Node: Continue Statement430616 -Node: Next Statement432443 -Node: Nextfile Statement434826 -Node: Exit Statement437478 -Node: Built-in Variables439881 -Node: User-modified441014 -Node: Auto-set448600 -Ref: Auto-set-Footnote-1463253 -Ref: Auto-set-Footnote-2463459 -Node: ARGC and ARGV463515 -Node: Pattern Action Summary467728 -Node: Arrays470158 -Node: Array Basics471487 -Node: Array Intro472331 -Ref: figure-array-elements474306 -Ref: Array Intro-Footnote-1477010 -Node: Reference to Elements477138 -Node: Assigning Elements479602 -Node: Array Example480093 -Node: Scanning an Array481852 -Node: Controlling Scanning484874 -Ref: Controlling Scanning-Footnote-1490273 -Node: Numeric Array Subscripts490589 -Node: Uninitialized Subscripts492773 -Node: Delete494392 -Ref: Delete-Footnote-1497144 -Node: Multidimensional497201 -Node: Multiscanning500296 -Node: Arrays of Arrays501887 -Node: Arrays Summary506654 -Node: Functions508747 -Node: Built-in509785 -Node: Calling Built-in510866 -Node: Numeric Functions512862 -Ref: Numeric Functions-Footnote-1517695 -Ref: Numeric Functions-Footnote-2518052 -Ref: Numeric Functions-Footnote-3518100 -Node: String Functions518372 -Ref: String Functions-Footnote-1541876 -Ref: String Functions-Footnote-2542004 -Ref: String Functions-Footnote-3542252 -Node: Gory Details542339 -Ref: table-sub-escapes544130 -Ref: table-sub-proposed545649 -Ref: table-posix-sub547012 -Ref: table-gensub-escapes548553 -Ref: Gory Details-Footnote-1549376 -Node: I/O Functions549530 -Ref: table-system-return-values556112 -Ref: I/O Functions-Footnote-1558092 -Ref: I/O Functions-Footnote-2558240 -Node: Time Functions558360 -Ref: Time Functions-Footnote-1568882 -Ref: Time Functions-Footnote-2568950 -Ref: Time Functions-Footnote-3569108 -Ref: Time Functions-Footnote-4569219 -Ref: Time Functions-Footnote-5569331 -Ref: Time Functions-Footnote-6569558 -Node: Bitwise Functions569824 -Ref: table-bitwise-ops570418 -Ref: Bitwise Functions-Footnote-1574756 -Node: Type Functions574929 -Node: I18N Functions577461 -Node: User-defined579112 -Node: Definition Syntax579917 -Ref: Definition Syntax-Footnote-1585604 -Node: Function Example585675 -Ref: Function Example-Footnote-1588597 -Node: Function Caveats588619 -Node: Calling A Function589137 -Node: Variable Scope590095 -Node: Pass By Value/Reference593089 -Node: Return Statement596588 -Node: Dynamic Typing599567 -Node: Indirect Calls600497 -Ref: Indirect Calls-Footnote-1610748 -Node: Functions Summary610876 -Node: Library Functions613581 -Ref: Library Functions-Footnote-1617188 -Ref: Library Functions-Footnote-2617331 -Node: Library Names617502 -Ref: Library Names-Footnote-1620962 -Ref: Library Names-Footnote-2621185 -Node: General Functions621271 -Node: Strtonum Function622374 -Node: Assert Function625396 -Node: Round Function628722 -Node: Cliff Random Function630263 -Node: Ordinal Functions631279 -Ref: Ordinal Functions-Footnote-1634342 -Ref: Ordinal Functions-Footnote-2634594 -Node: Join Function634804 -Ref: Join Function-Footnote-1636574 -Node: Getlocaltime Function636774 -Node: Readfile Function640516 -Node: Shell Quoting642488 -Node: Data File Management643889 -Node: Filetrans Function644521 -Node: Rewind Function648617 -Node: File Checking650523 -Ref: File Checking-Footnote-1651857 -Node: Empty Files652058 -Node: Ignoring Assigns654037 -Node: Getopt Function655587 -Ref: Getopt Function-Footnote-1667056 -Node: Passwd Functions667256 -Ref: Passwd Functions-Footnote-1676095 -Node: Group Functions676183 -Ref: Group Functions-Footnote-1684081 -Node: Walking Arrays684288 -Node: Library Functions Summary687296 -Node: Library Exercises688702 -Node: Sample Programs689167 -Node: Running Examples689937 -Node: Clones690665 -Node: Cut Program691889 -Node: Egrep Program701818 -Ref: Egrep Program-Footnote-1709330 -Node: Id Program709440 -Node: Split Program713120 -Ref: Split Program-Footnote-1716579 -Node: Tee Program716708 -Node: Uniq Program719498 -Node: Wc Program726924 -Ref: Wc Program-Footnote-1731179 -Node: Miscellaneous Programs731273 -Node: Dupword Program732486 -Node: Alarm Program734516 -Node: Translate Program739371 -Ref: Translate Program-Footnote-1743936 -Node: Labels Program744206 -Ref: Labels Program-Footnote-1747557 -Node: Word Sorting747641 -Node: History Sorting751713 -Node: Extract Program753548 -Node: Simple Sed761077 -Node: Igawk Program764151 -Ref: Igawk Program-Footnote-1778482 -Ref: Igawk Program-Footnote-2778684 -Ref: Igawk Program-Footnote-3778806 -Node: Anagram Program778921 -Node: Signature Program781983 -Node: Programs Summary783230 -Node: Programs Exercises784444 -Ref: Programs Exercises-Footnote-1788573 -Node: Advanced Features788664 -Node: Nondecimal Data790654 -Node: Array Sorting792245 -Node: Controlling Array Traversal792945 -Ref: Controlling Array Traversal-Footnote-1801312 -Node: Array Sorting Functions801430 -Ref: Array Sorting Functions-Footnote-1806521 -Node: Two-way I/O806717 -Ref: Two-way I/O-Footnote-1813267 -Ref: Two-way I/O-Footnote-2813454 -Node: TCP/IP Networking813536 -Node: Profiling816654 -Ref: Profiling-Footnote-1825147 -Node: Advanced Features Summary825470 -Node: Internationalization827314 -Node: I18N and L10N828794 -Node: Explaining gettext829481 -Ref: Explaining gettext-Footnote-1835373 -Ref: Explaining gettext-Footnote-2835558 -Node: Programmer i18n835723 -Ref: Programmer i18n-Footnote-1840578 -Node: Translator i18n840627 -Node: String Extraction841421 -Ref: String Extraction-Footnote-1842553 -Node: Printf Ordering842639 -Ref: Printf Ordering-Footnote-1845425 -Node: I18N Portability845489 -Ref: I18N Portability-Footnote-1847945 -Node: I18N Example848008 -Ref: I18N Example-Footnote-1850814 -Node: Gawk I18N850887 -Node: I18N Summary851532 -Node: Debugger852873 -Node: Debugging853895 -Node: Debugging Concepts854336 -Node: Debugging Terms856145 -Node: Awk Debugging858720 -Node: Sample Debugging Session859626 -Node: Debugger Invocation860160 -Node: Finding The Bug861546 -Node: List of Debugger Commands868024 -Node: Breakpoint Control869357 -Node: Debugger Execution Control873051 -Node: Viewing And Changing Data876413 -Node: Execution Stack879787 -Node: Debugger Info881424 -Node: Miscellaneous Debugger Commands885495 -Node: Readline Support890583 -Node: Limitations891479 -Ref: Limitations-Footnote-1895710 -Node: Debugging Summary895761 -Node: Arbitrary Precision Arithmetic897040 -Node: Computer Arithmetic898456 -Ref: table-numeric-ranges902047 -Ref: Computer Arithmetic-Footnote-1902769 -Node: Math Definitions902826 -Ref: table-ieee-formats906140 -Ref: Math Definitions-Footnote-1906743 -Node: MPFR features906848 -Node: FP Math Caution908565 -Ref: FP Math Caution-Footnote-1909637 -Node: Inexactness of computations910006 -Node: Inexact representation910966 -Node: Comparing FP Values912326 -Node: Errors accumulate913408 -Node: Getting Accuracy914841 -Node: Try To Round917551 -Node: Setting precision918450 -Ref: table-predefined-precision-strings919147 -Node: Setting the rounding mode920977 -Ref: table-gawk-rounding-modes921351 -Ref: Setting the rounding mode-Footnote-1924759 -Node: Arbitrary Precision Integers924938 -Ref: Arbitrary Precision Integers-Footnote-1929855 -Node: POSIX Floating Point Problems930004 -Ref: POSIX Floating Point Problems-Footnote-1933886 -Node: Floating point summary933924 -Node: Dynamic Extensions936114 -Node: Extension Intro937667 -Node: Plugin License938933 -Node: Extension Mechanism Outline939730 -Ref: figure-load-extension940169 -Ref: figure-register-new-function941734 -Ref: figure-call-new-function942826 -Node: Extension API Description944888 -Node: Extension API Functions Introduction946420 -Node: General Data Types951279 -Ref: General Data Types-Footnote-1957234 -Node: Memory Allocation Functions957533 -Ref: Memory Allocation Functions-Footnote-1960378 -Node: Constructor Functions960477 -Node: Registration Functions962222 -Node: Extension Functions962907 -Node: Exit Callback Functions965530 -Node: Extension Version String966780 -Node: Input Parsers967443 -Node: Output Wrappers977325 -Node: Two-way processors981837 -Node: Printing Messages984102 -Ref: Printing Messages-Footnote-1985273 -Node: Updating ERRNO985426 -Node: Requesting Values986165 -Ref: table-value-types-returned986902 -Node: Accessing Parameters987785 -Node: Symbol Table Access989020 -Node: Symbol table by name989532 -Node: Symbol table by cookie991553 -Ref: Symbol table by cookie-Footnote-1995705 -Node: Cached values995769 -Ref: Cached values-Footnote-1999276 -Node: Array Manipulation999367 -Ref: Array Manipulation-Footnote-11000458 -Node: Array Data Types1000495 -Ref: Array Data Types-Footnote-11003153 -Node: Array Functions1003245 -Node: Flattening Arrays1007103 -Node: Creating Arrays1014011 -Node: Redirection API1018780 -Node: Extension API Variables1021611 -Node: Extension Versioning1022244 -Ref: gawk-api-version1022681 -Node: Extension API Informational Variables1024437 -Node: Extension API Boilerplate1025501 -Node: Finding Extensions1029315 -Node: Extension Example1029874 -Node: Internal File Description1030672 -Node: Internal File Ops1034752 -Ref: Internal File Ops-Footnote-11046514 -Node: Using Internal File Ops1046654 -Ref: Using Internal File Ops-Footnote-11049037 -Node: Extension Samples1049311 -Node: Extension Sample File Functions1050840 -Node: Extension Sample Fnmatch1058489 -Node: Extension Sample Fork1059976 -Node: Extension Sample Inplace1061194 -Node: Extension Sample Ord1064404 -Node: Extension Sample Readdir1065240 -Ref: table-readdir-file-types1066129 -Node: Extension Sample Revout1066934 -Node: Extension Sample Rev2way1067523 -Node: Extension Sample Read write array1068263 -Node: Extension Sample Readfile1070205 -Node: Extension Sample Time1071300 -Node: Extension Sample API Tests1072648 -Node: gawkextlib1073140 -Node: Extension summary1075587 -Node: Extension Exercises1079289 -Node: Language History1080787 -Node: V7/SVR3.11082443 -Node: SVR41084595 -Node: POSIX1086029 -Node: BTL1087408 -Node: POSIX/GNU1088137 -Node: Feature History1093999 -Node: Common Extensions1108369 -Node: Ranges and Locales1109652 -Ref: Ranges and Locales-Footnote-11114268 -Ref: Ranges and Locales-Footnote-21114295 -Ref: Ranges and Locales-Footnote-31114530 -Node: Contributors1114751 -Node: History summary1120311 -Node: Installation1121691 -Node: Gawk Distribution1122635 -Node: Getting1123119 -Node: Extracting1124080 -Node: Distribution contents1125718 -Node: Unix Installation1131812 -Node: Quick Installation1132494 -Node: Shell Startup Files1134908 -Node: Additional Configuration Options1135986 -Node: Configuration Philosophy1137791 -Node: Non-Unix Installation1140160 -Node: PC Installation1140618 -Node: PC Binary Installation1141938 -Node: PC Compiling1143790 -Ref: PC Compiling-Footnote-11146584 -Node: PC Testing1146693 -Node: PC Using1147873 -Ref: PC Using-Footnote-11152026 -Node: Cygwin1152099 -Node: MSYS1152869 -Node: VMS Installation1153370 -Node: VMS Compilation1154161 -Ref: VMS Compilation-Footnote-11155390 -Node: VMS Dynamic Extensions1155448 -Node: VMS Installation Details1157133 -Node: VMS Running1159386 -Node: VMS GNV1163665 -Node: VMS Old Gawk1164400 -Node: Bugs1164871 -Node: Bug address1165534 -Node: Usenet1167931 -Node: Maintainers1168706 -Node: Other Versions1170082 -Node: Installation summary1176666 -Node: Notes1177717 -Node: Compatibility Mode1178582 -Node: Additions1179364 -Node: Accessing The Source1180289 -Node: Adding Code1181724 -Node: New Ports1187943 -Node: Derived Files1192431 -Ref: Derived Files-Footnote-11197916 -Ref: Derived Files-Footnote-21197951 -Ref: Derived Files-Footnote-31198549 -Node: Future Extensions1198663 -Node: Implementation Limitations1199321 -Node: Extension Design1200504 -Node: Old Extension Problems1201658 -Ref: Old Extension Problems-Footnote-11203176 -Node: Extension New Mechanism Goals1203233 -Ref: Extension New Mechanism Goals-Footnote-11206597 -Node: Extension Other Design Decisions1206786 -Node: Extension Future Growth1208899 -Node: Old Extension Mechanism1209735 -Node: Notes summary1211498 -Node: Basic Concepts1212680 -Node: Basic High Level1213361 -Ref: figure-general-flow1213643 -Ref: figure-process-flow1214328 -Ref: Basic High Level-Footnote-11217629 -Node: Basic Data Typing1217814 -Node: Glossary1221142 -Node: Copying1253089 -Node: GNU Free Documentation License1290628 -Node: Index1315746 +Node: Regexp Summary192381 +Node: Reading Files193987 +Node: Records196150 +Node: awk split records196883 +Node: gawk split records201814 +Ref: gawk split records-Footnote-1206354 +Node: Fields206391 +Node: Nonconstant Fields209132 +Ref: Nonconstant Fields-Footnote-1211368 +Node: Changing Fields211572 +Node: Field Separators217500 +Node: Default Field Splitting220198 +Node: Regexp Field Splitting221316 +Node: Single Character Fields224669 +Node: Command Line Field Separator225729 +Node: Full Line Fields228947 +Ref: Full Line Fields-Footnote-1230469 +Ref: Full Line Fields-Footnote-2230515 +Node: Field Splitting Summary230616 +Node: Constant Size232690 +Node: Splitting By Content237268 +Ref: Splitting By Content-Footnote-1241239 +Node: Multiple Line241402 +Ref: Multiple Line-Footnote-1247284 +Node: Getline247463 +Node: Plain Getline249930 +Node: Getline/Variable252569 +Node: Getline/File253718 +Node: Getline/Variable/File255104 +Ref: Getline/Variable/File-Footnote-1256707 +Node: Getline/Pipe256795 +Node: Getline/Variable/Pipe259500 +Node: Getline/Coprocess260633 +Node: Getline/Variable/Coprocess261898 +Node: Getline Notes262638 +Node: Getline Summary265433 +Ref: table-getline-variants265855 +Node: Read Timeout266603 +Ref: Read Timeout-Footnote-1270509 +Node: Retrying Input270567 +Node: Command-line directories271766 +Node: Input Summary272672 +Node: Input Exercises275844 +Node: Printing276572 +Node: Print278406 +Node: Print Examples279863 +Node: Output Separators282643 +Node: OFMT284660 +Node: Printf286016 +Node: Basic Printf286801 +Node: Control Letters288375 +Node: Format Modifiers292363 +Node: Printf Examples298378 +Node: Redirection300864 +Node: Special FD307705 +Ref: Special FD-Footnote-1310873 +Node: Special Files310947 +Node: Other Inherited Files311564 +Node: Special Network312565 +Node: Special Caveats313425 +Node: Close Files And Pipes314374 +Ref: table-close-pipe-return-values321281 +Ref: Close Files And Pipes-Footnote-1322064 +Ref: Close Files And Pipes-Footnote-2322212 +Node: Nonfatal322364 +Node: Output Summary324689 +Node: Output Exercises325911 +Node: Expressions326590 +Node: Values327778 +Node: Constants328456 +Node: Scalar Constants329147 +Ref: Scalar Constants-Footnote-1330011 +Node: Nondecimal-numbers330261 +Node: Regexp Constants333274 +Node: Using Constant Regexps333800 +Node: Variables336963 +Node: Using Variables337620 +Node: Assignment Options339530 +Node: Conversion341403 +Node: Strings And Numbers341927 +Ref: Strings And Numbers-Footnote-1344990 +Node: Locale influences conversions345099 +Ref: table-locale-affects347857 +Node: All Operators348475 +Node: Arithmetic Ops349104 +Node: Concatenation351610 +Ref: Concatenation-Footnote-1354457 +Node: Assignment Ops354564 +Ref: table-assign-ops359555 +Node: Increment Ops360868 +Node: Truth Values and Conditions364328 +Node: Truth Values365402 +Node: Typing and Comparison366450 +Node: Variable Typing367270 +Node: Comparison Operators370894 +Ref: table-relational-ops371313 +Node: POSIX String Comparison374808 +Ref: POSIX String Comparison-Footnote-1376503 +Ref: POSIX String Comparison-Footnote-2376642 +Node: Boolean Ops376726 +Ref: Boolean Ops-Footnote-1381208 +Node: Conditional Exp381300 +Node: Function Calls383036 +Node: Precedence386913 +Node: Locales390572 +Node: Expressions Summary392204 +Node: Patterns and Actions394777 +Node: Pattern Overview395897 +Node: Regexp Patterns397574 +Node: Expression Patterns398116 +Node: Ranges401897 +Node: BEGIN/END405005 +Node: Using BEGIN/END405766 +Ref: Using BEGIN/END-Footnote-1408502 +Node: I/O And BEGIN/END408608 +Node: BEGINFILE/ENDFILE410922 +Node: Empty413829 +Node: Using Shell Variables414146 +Node: Action Overview416420 +Node: Statements418745 +Node: If Statement420593 +Node: While Statement422088 +Node: Do Statement424116 +Node: For Statement425264 +Node: Switch Statement428422 +Node: Break Statement430808 +Node: Continue Statement432900 +Node: Next Statement434727 +Node: Nextfile Statement437110 +Node: Exit Statement439762 +Node: Built-in Variables442165 +Node: User-modified443298 +Node: Auto-set450884 +Ref: Auto-set-Footnote-1465537 +Ref: Auto-set-Footnote-2465743 +Node: ARGC and ARGV465799 +Node: Pattern Action Summary470012 +Node: Arrays472442 +Node: Array Basics473771 +Node: Array Intro474615 +Ref: figure-array-elements476590 +Ref: Array Intro-Footnote-1479294 +Node: Reference to Elements479422 +Node: Assigning Elements481886 +Node: Array Example482377 +Node: Scanning an Array484136 +Node: Controlling Scanning487158 +Ref: Controlling Scanning-Footnote-1492557 +Node: Numeric Array Subscripts492873 +Node: Uninitialized Subscripts495057 +Node: Delete496676 +Ref: Delete-Footnote-1499428 +Node: Multidimensional499485 +Node: Multiscanning502580 +Node: Arrays of Arrays504171 +Node: Arrays Summary508938 +Node: Functions511031 +Node: Built-in512069 +Node: Calling Built-in513150 +Node: Numeric Functions515146 +Ref: Numeric Functions-Footnote-1519979 +Ref: Numeric Functions-Footnote-2520336 +Ref: Numeric Functions-Footnote-3520384 +Node: String Functions520656 +Ref: String Functions-Footnote-1544160 +Ref: String Functions-Footnote-2544288 +Ref: String Functions-Footnote-3544536 +Node: Gory Details544623 +Ref: table-sub-escapes546414 +Ref: table-sub-proposed547933 +Ref: table-posix-sub549296 +Ref: table-gensub-escapes550837 +Ref: Gory Details-Footnote-1551660 +Node: I/O Functions551814 +Ref: table-system-return-values558396 +Ref: I/O Functions-Footnote-1560376 +Ref: I/O Functions-Footnote-2560524 +Node: Time Functions560644 +Ref: Time Functions-Footnote-1571166 +Ref: Time Functions-Footnote-2571234 +Ref: Time Functions-Footnote-3571392 +Ref: Time Functions-Footnote-4571503 +Ref: Time Functions-Footnote-5571615 +Ref: Time Functions-Footnote-6571842 +Node: Bitwise Functions572108 +Ref: table-bitwise-ops572702 +Ref: Bitwise Functions-Footnote-1577040 +Node: Type Functions577213 +Node: I18N Functions579874 +Node: User-defined581525 +Node: Definition Syntax582330 +Ref: Definition Syntax-Footnote-1588017 +Node: Function Example588088 +Ref: Function Example-Footnote-1591010 +Node: Function Caveats591032 +Node: Calling A Function591550 +Node: Variable Scope592508 +Node: Pass By Value/Reference595502 +Node: Return Statement599001 +Node: Dynamic Typing601980 +Node: Indirect Calls602910 +Ref: Indirect Calls-Footnote-1613161 +Node: Functions Summary613289 +Node: Library Functions615994 +Ref: Library Functions-Footnote-1619601 +Ref: Library Functions-Footnote-2619744 +Node: Library Names619915 +Ref: Library Names-Footnote-1623375 +Ref: Library Names-Footnote-2623598 +Node: General Functions623684 +Node: Strtonum Function624787 +Node: Assert Function627809 +Node: Round Function631135 +Node: Cliff Random Function632676 +Node: Ordinal Functions633692 +Ref: Ordinal Functions-Footnote-1636755 +Ref: Ordinal Functions-Footnote-2637007 +Node: Join Function637217 +Ref: Join Function-Footnote-1638987 +Node: Getlocaltime Function639187 +Node: Readfile Function642929 +Node: Shell Quoting644901 +Node: Data File Management646302 +Node: Filetrans Function646934 +Node: Rewind Function651030 +Node: File Checking652936 +Ref: File Checking-Footnote-1654270 +Node: Empty Files654471 +Node: Ignoring Assigns656450 +Node: Getopt Function658000 +Ref: Getopt Function-Footnote-1669469 +Node: Passwd Functions669669 +Ref: Passwd Functions-Footnote-1678508 +Node: Group Functions678596 +Ref: Group Functions-Footnote-1686494 +Node: Walking Arrays686701 +Node: Library Functions Summary689709 +Node: Library Exercises691115 +Node: Sample Programs691580 +Node: Running Examples692350 +Node: Clones693078 +Node: Cut Program694302 +Node: Egrep Program704231 +Ref: Egrep Program-Footnote-1711743 +Node: Id Program711853 +Node: Split Program715533 +Ref: Split Program-Footnote-1718992 +Node: Tee Program719121 +Node: Uniq Program721911 +Node: Wc Program729337 +Ref: Wc Program-Footnote-1733592 +Node: Miscellaneous Programs733686 +Node: Dupword Program734899 +Node: Alarm Program736929 +Node: Translate Program741784 +Ref: Translate Program-Footnote-1746349 +Node: Labels Program746619 +Ref: Labels Program-Footnote-1749970 +Node: Word Sorting750054 +Node: History Sorting754126 +Node: Extract Program755961 +Node: Simple Sed763490 +Node: Igawk Program766564 +Ref: Igawk Program-Footnote-1780895 +Ref: Igawk Program-Footnote-2781097 +Ref: Igawk Program-Footnote-3781219 +Node: Anagram Program781334 +Node: Signature Program784396 +Node: Programs Summary785643 +Node: Programs Exercises786857 +Ref: Programs Exercises-Footnote-1790986 +Node: Advanced Features791077 +Node: Nondecimal Data793067 +Node: Array Sorting794658 +Node: Controlling Array Traversal795358 +Ref: Controlling Array Traversal-Footnote-1803725 +Node: Array Sorting Functions803843 +Ref: Array Sorting Functions-Footnote-1808934 +Node: Two-way I/O809130 +Ref: Two-way I/O-Footnote-1815680 +Ref: Two-way I/O-Footnote-2815867 +Node: TCP/IP Networking815949 +Node: Profiling819067 +Ref: Profiling-Footnote-1827560 +Node: Advanced Features Summary827883 +Node: Internationalization829727 +Node: I18N and L10N831207 +Node: Explaining gettext831894 +Ref: Explaining gettext-Footnote-1837786 +Ref: Explaining gettext-Footnote-2837971 +Node: Programmer i18n838136 +Ref: Programmer i18n-Footnote-1842991 +Node: Translator i18n843040 +Node: String Extraction843834 +Ref: String Extraction-Footnote-1844966 +Node: Printf Ordering845052 +Ref: Printf Ordering-Footnote-1847838 +Node: I18N Portability847902 +Ref: I18N Portability-Footnote-1850358 +Node: I18N Example850421 +Ref: I18N Example-Footnote-1853227 +Node: Gawk I18N853300 +Node: I18N Summary853945 +Node: Debugger855286 +Node: Debugging856308 +Node: Debugging Concepts856749 +Node: Debugging Terms858558 +Node: Awk Debugging861133 +Node: Sample Debugging Session862039 +Node: Debugger Invocation862573 +Node: Finding The Bug863959 +Node: List of Debugger Commands870437 +Node: Breakpoint Control871770 +Node: Debugger Execution Control875464 +Node: Viewing And Changing Data878826 +Node: Execution Stack882200 +Node: Debugger Info883837 +Node: Miscellaneous Debugger Commands887908 +Node: Readline Support892996 +Node: Limitations893892 +Ref: Limitations-Footnote-1898123 +Node: Debugging Summary898174 +Node: Arbitrary Precision Arithmetic899453 +Node: Computer Arithmetic900869 +Ref: table-numeric-ranges904460 +Ref: Computer Arithmetic-Footnote-1905182 +Node: Math Definitions905239 +Ref: table-ieee-formats908553 +Ref: Math Definitions-Footnote-1909156 +Node: MPFR features909261 +Node: FP Math Caution910978 +Ref: FP Math Caution-Footnote-1912050 +Node: Inexactness of computations912419 +Node: Inexact representation913379 +Node: Comparing FP Values914739 +Node: Errors accumulate915821 +Node: Getting Accuracy917254 +Node: Try To Round919964 +Node: Setting precision920863 +Ref: table-predefined-precision-strings921560 +Node: Setting the rounding mode923390 +Ref: table-gawk-rounding-modes923764 +Ref: Setting the rounding mode-Footnote-1927172 +Node: Arbitrary Precision Integers927351 +Ref: Arbitrary Precision Integers-Footnote-1932268 +Node: POSIX Floating Point Problems932417 +Ref: POSIX Floating Point Problems-Footnote-1936299 +Node: Floating point summary936337 +Node: Dynamic Extensions938527 +Node: Extension Intro940080 +Node: Plugin License941346 +Node: Extension Mechanism Outline942143 +Ref: figure-load-extension942582 +Ref: figure-register-new-function944147 +Ref: figure-call-new-function945239 +Node: Extension API Description947301 +Node: Extension API Functions Introduction948833 +Node: General Data Types953692 +Ref: General Data Types-Footnote-1959647 +Node: Memory Allocation Functions959946 +Ref: Memory Allocation Functions-Footnote-1962791 +Node: Constructor Functions962890 +Node: Registration Functions964635 +Node: Extension Functions965320 +Node: Exit Callback Functions967943 +Node: Extension Version String969193 +Node: Input Parsers969856 +Node: Output Wrappers979738 +Node: Two-way processors984250 +Node: Printing Messages986515 +Ref: Printing Messages-Footnote-1987686 +Node: Updating ERRNO987839 +Node: Requesting Values988578 +Ref: table-value-types-returned989315 +Node: Accessing Parameters990198 +Node: Symbol Table Access991433 +Node: Symbol table by name991945 +Node: Symbol table by cookie993966 +Ref: Symbol table by cookie-Footnote-1998118 +Node: Cached values998182 +Ref: Cached values-Footnote-11001689 +Node: Array Manipulation1001780 +Ref: Array Manipulation-Footnote-11002871 +Node: Array Data Types1002908 +Ref: Array Data Types-Footnote-11005566 +Node: Array Functions1005658 +Node: Flattening Arrays1009516 +Node: Creating Arrays1016424 +Node: Redirection API1021193 +Node: Extension API Variables1024024 +Node: Extension Versioning1024657 +Ref: gawk-api-version1025094 +Node: Extension API Informational Variables1026850 +Node: Extension API Boilerplate1027914 +Node: Finding Extensions1031728 +Node: Extension Example1032287 +Node: Internal File Description1033085 +Node: Internal File Ops1037165 +Ref: Internal File Ops-Footnote-11048927 +Node: Using Internal File Ops1049067 +Ref: Using Internal File Ops-Footnote-11051450 +Node: Extension Samples1051724 +Node: Extension Sample File Functions1053253 +Node: Extension Sample Fnmatch1060902 +Node: Extension Sample Fork1062389 +Node: Extension Sample Inplace1063607 +Node: Extension Sample Ord1066817 +Node: Extension Sample Readdir1067653 +Ref: table-readdir-file-types1068542 +Node: Extension Sample Revout1069347 +Node: Extension Sample Rev2way1069936 +Node: Extension Sample Read write array1070676 +Node: Extension Sample Readfile1072618 +Node: Extension Sample Time1073713 +Node: Extension Sample API Tests1075061 +Node: gawkextlib1075553 +Node: Extension summary1078000 +Node: Extension Exercises1081702 +Node: Language History1083200 +Node: V7/SVR3.11084856 +Node: SVR41087008 +Node: POSIX1088442 +Node: BTL1089821 +Node: POSIX/GNU1090550 +Node: Feature History1096412 +Node: Common Extensions1110782 +Node: Ranges and Locales1112065 +Ref: Ranges and Locales-Footnote-11116681 +Ref: Ranges and Locales-Footnote-21116708 +Ref: Ranges and Locales-Footnote-31116943 +Node: Contributors1117164 +Node: History summary1122724 +Node: Installation1124104 +Node: Gawk Distribution1125048 +Node: Getting1125532 +Node: Extracting1126493 +Node: Distribution contents1128131 +Node: Unix Installation1134225 +Node: Quick Installation1134907 +Node: Shell Startup Files1137321 +Node: Additional Configuration Options1138399 +Node: Configuration Philosophy1140204 +Node: Non-Unix Installation1142573 +Node: PC Installation1143031 +Node: PC Binary Installation1144351 +Node: PC Compiling1146203 +Ref: PC Compiling-Footnote-11148997 +Node: PC Testing1149106 +Node: PC Using1150286 +Ref: PC Using-Footnote-11154439 +Node: Cygwin1154512 +Node: MSYS1155282 +Node: VMS Installation1155783 +Node: VMS Compilation1156574 +Ref: VMS Compilation-Footnote-11157803 +Node: VMS Dynamic Extensions1157861 +Node: VMS Installation Details1159546 +Node: VMS Running1161799 +Node: VMS GNV1166078 +Node: VMS Old Gawk1166813 +Node: Bugs1167284 +Node: Bug address1167947 +Node: Usenet1170344 +Node: Maintainers1171119 +Node: Other Versions1172495 +Node: Installation summary1179079 +Node: Notes1180130 +Node: Compatibility Mode1180995 +Node: Additions1181777 +Node: Accessing The Source1182702 +Node: Adding Code1184137 +Node: New Ports1190356 +Node: Derived Files1194844 +Ref: Derived Files-Footnote-11200329 +Ref: Derived Files-Footnote-21200364 +Ref: Derived Files-Footnote-31200962 +Node: Future Extensions1201076 +Node: Implementation Limitations1201734 +Node: Extension Design1202917 +Node: Old Extension Problems1204071 +Ref: Old Extension Problems-Footnote-11205589 +Node: Extension New Mechanism Goals1205646 +Ref: Extension New Mechanism Goals-Footnote-11209010 +Node: Extension Other Design Decisions1209199 +Node: Extension Future Growth1211312 +Node: Old Extension Mechanism1212148 +Node: Notes summary1213911 +Node: Basic Concepts1215093 +Node: Basic High Level1215774 +Ref: figure-general-flow1216056 +Ref: figure-process-flow1216741 +Ref: Basic High Level-Footnote-11220042 +Node: Basic Data Typing1220227 +Node: Glossary1223555 +Node: Copying1255502 +Node: GNU Free Documentation License1293041 +Node: Index1318159 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index aaecb6d2..5270d419 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -6298,6 +6298,70 @@ str = "hi" @ii{String variable} re = /foo/ @ii{Wrong!} re @ii{is the result of} $0 ~ /foo/ @end example +For a number of more advanced use cases (described later on in this +@value{DOCUMENT}), it would be nice to have regexp constants that +are @dfn{strongly typed}; in other words, that denote a regexp useful +for matching, and not an expression. + +@command{gawk} provides this feature. A strongly typed regexp constant +looks almost like a regular regexp constant, except that it is preceded +by an @samp{@@} sign: + +@example +re = @@/foo/ @ii{Regexp variable} +@end example + +Strongly typed regexp constants @emph{cannot} be used eveywhere that a +regular regexp constant can, because this would make the language even more +confusing. Instead, you may use them only in certain contexts: + +@itemize @bullet +@item +On the righthand side of the @samp{~} and @samp{!~} operators: @samp{some_var ~ @@/foo/} +(@pxref{Regexp Usage}). + +@item +In the @code{case} part of a @code{switch} statement +(@pxref{Switch Statement}). + +@item +As an argument to one of the built-in functions that accept regexp constants: +@code{gensub()}, +@code{gsub()}, +@code{match()}, +@code{patsplit()}, +@code{split()}, +and +@code{sub()} +(@pxref{String Functions}). + +@item +As a parameter in a call to a user-defined function +(@pxref{User-defined}). + +@item +On the righthand side of an assignment to a variable: @samp{some_var = @@/foo/}. +In this case, the type of @code{some_var} is regexp. Additionally, @code{some_var} +can be used with @samp{~} and @samp{!~}, passed to one of the built-in functions +listed above, or passed as a parameter to a user-defined function. +@end itemize + +You may use the @code{typeof()} built-in function +(@pxref{Type Functions}) +to determine if a variable or function parameter is +a regexp variable. + +The true power of this feature comes from the ability to create variables that +have regexp type. Such variables can be passed on to user-defined functions, +without the confusing aspects of computed regular expressions created from +strings or string constants. They may also be passed through indirect function +calls (@pxref{Indirect Calls}) +onto the built-in functions that accept regexp constants. + +When used in numeric conversions, strongly typed regexp variables convert +to zero. When used in string conversions, they convert to the string +value of the original regexp text. + @node Regexp Summary @section Summary @@ -6341,6 +6405,11 @@ treated as regular expressions). case sensitivity of regexp matching. In other @command{awk} versions, use @code{tolower()} or @code{toupper()}. +@item +Strongly typed regexp constants (@code{@@/.../}) enable +certain advanced use cases to be described later on in the +@value{DOCUMENT}. + @end itemize @@ -19529,6 +19598,9 @@ Return one of the following strings, depending upon the type of @var{x}: @item "array" @var{x} is an array. +@item "regexp" +@var{x} is a strongly typed regexp (@pxref{Strong Regexp Constants}). + @item "number" @var{x} is a number. @@ -19585,7 +19657,8 @@ ends up turning it into a scalar. @end quotation The @code{typeof()} function is general; it allows you to determine -if a variable or function parameter is a scalar, an array. +if a variable or function parameter is a scalar, an array, or a strongly +typed regexp. @code{isarray()} is deprecated; you should use @code{typeof()} instead. You should replace any existing uses of @samp{isarray(var)} in your diff --git a/doc/gawktexi.in b/doc/gawktexi.in index 5bf0c815..322f3a2f 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -6082,6 +6082,70 @@ str = "hi" @ii{String variable} re = /foo/ @ii{Wrong!} re @ii{is the result of} $0 ~ /foo/ @end example +For a number of more advanced use cases (described later on in this +@value{DOCUMENT}), it would be nice to have regexp constants that +are @dfn{strongly typed}; in other words, that denote a regexp useful +for matching, and not an expression. + +@command{gawk} provides this feature. A strongly typed regexp constant +looks almost like a regular regexp constant, except that it is preceded +by an @samp{@@} sign: + +@example +re = @@/foo/ @ii{Regexp variable} +@end example + +Strongly typed regexp constants @emph{cannot} be used eveywhere that a +regular regexp constant can, because this would make the language even more +confusing. Instead, you may use them only in certain contexts: + +@itemize @bullet +@item +On the righthand side of the @samp{~} and @samp{!~} operators: @samp{some_var ~ @@/foo/} +(@pxref{Regexp Usage}). + +@item +In the @code{case} part of a @code{switch} statement +(@pxref{Switch Statement}). + +@item +As an argument to one of the built-in functions that accept regexp constants: +@code{gensub()}, +@code{gsub()}, +@code{match()}, +@code{patsplit()}, +@code{split()}, +and +@code{sub()} +(@pxref{String Functions}). + +@item +As a parameter in a call to a user-defined function +(@pxref{User-defined}). + +@item +On the righthand side of an assignment to a variable: @samp{some_var = @@/foo/}. +In this case, the type of @code{some_var} is regexp. Additionally, @code{some_var} +can be used with @samp{~} and @samp{!~}, passed to one of the built-in functions +listed above, or passed as a parameter to a user-defined function. +@end itemize + +You may use the @code{typeof()} built-in function +(@pxref{Type Functions}) +to determine if a variable or function parameter is +a regexp variable. + +The true power of this feature comes from the ability to create variables that +have regexp type. Such variables can be passed on to user-defined functions, +without the confusing aspects of computed regular expressions created from +strings or string constants. They may also be passed through indirect function +calls (@pxref{Indirect Calls}) +onto the built-in functions that accept regexp constants. + +When used in numeric conversions, strongly typed regexp variables convert +to zero. When used in string conversions, they convert to the string +value of the original regexp text. + @node Regexp Summary @section Summary @@ -6125,6 +6189,11 @@ treated as regular expressions). case sensitivity of regexp matching. In other @command{awk} versions, use @code{tolower()} or @code{toupper()}. +@item +Strongly typed regexp constants (@code{@@/.../}) enable +certain advanced use cases to be described later on in the +@value{DOCUMENT}. + @end itemize @@ -18641,6 +18710,9 @@ Return one of the following strings, depending upon the type of @var{x}: @item "array" @var{x} is an array. +@item "regexp" +@var{x} is a strongly typed regexp (@pxref{Strong Regexp Constants}). + @item "number" @var{x} is a number. @@ -18697,7 +18769,8 @@ ends up turning it into a scalar. @end quotation The @code{typeof()} function is general; it allows you to determine -if a variable or function parameter is a scalar, an array. +if a variable or function parameter is a scalar, an array, or a strongly +typed regexp. @code{isarray()} is deprecated; you should use @code{typeof()} instead. You should replace any existing uses of @samp{isarray(var)} in your @@ -236,6 +236,7 @@ static const char *const nodetypes[] = { "Node_val", "Node_regex", "Node_dynregex", + "Node_typedregex", "Node_var", "Node_var_array", "Node_var_new", @@ -1326,6 +1327,11 @@ setup_frame(INSTRUCTION *pc) r->var_value = m; break; + case Node_typedregex: + r->type = Node_var; + r->var_value = m; + break; + default: cant_happen(); } diff --git a/interpret.h b/interpret.h index 5aa62a8a..5467aa87 100644 --- a/interpret.h +++ b/interpret.h @@ -268,7 +268,7 @@ uninitialized_scalar: r = r->var_value; } - if (r->type == Node_val) + if (r->type == Node_val || r->type == Node_typedregex) UPREF(r); PUSH(r); break; @@ -986,6 +986,8 @@ arrayfor: r = POP_STRING(); unref(m->re_exp); m->re_exp = r; + } else if (m->type == Node_typedregex) { + UPREF(m); } PUSH(m); break; @@ -33,6 +33,7 @@ static char *pp_list(int nargs, const char *paren, const char *delim); static char *pp_group3(const char *s1, const char *s2, const char *s3); static char *pp_concat(int nargs); static char *pp_string_or_strong_regex(const char *in_str, size_t len, int delim, bool strong_regex); +static char *pp_strong_regex(const char *in_str, size_t len, int delim); static bool is_binary(int type); static bool is_scalar(int type); static int prec_level(int type); @@ -636,14 +637,17 @@ cleanup: break; case Op_push_re: - if (pc->memory->type != Node_regex) + if (pc->memory->type != Node_regex && pc->memory->type != Node_typedregex) break; /* else fall through */ case Op_match_rec: { NODE *re = pc->memory->re_exp; - str = pp_string(re->stptr, re->stlen, '/'); + if (pc->memory->type == Node_regex) + str = pp_string(re->stptr, re->stlen, '/'); + else + str = pp_strong_regex(re->stptr, re->stlen, '/'); pp_push(pc->opcode, str, CAN_FREE); } break; @@ -665,6 +669,11 @@ cleanup: txt = t2->pp_str; str = pp_group3(txt, op2str(pc->opcode), restr); pp_free(t2); + } else if (m->type == Node_typedregex) { + NODE *re = m->re_exp; + restr = pp_strong_regex(re->stptr, re->stlen, '/'); + str = pp_group3(txt, op2str(pc->opcode), restr); + efree(restr); } else { NODE *re = m->re_exp; restr = pp_string(re->stptr, re->stlen, '/'); @@ -1405,6 +1414,13 @@ pp_string(const char *in_str, size_t len, int delim) return pp_string_or_strong_regex(in_str, len, delim, false); } +/* pp_strong_regex --- pretty format a hard regex constant */ + +static char * +pp_strong_regex(const char *in_str, size_t len, int delim) +{ + return pp_string_or_strong_regex(in_str, len, delim, true); +} /* pp_string_or_strong_regex --- pretty format a string, regex, or hard regex constant */ @@ -1448,6 +1464,9 @@ pp_string_or_strong_regex(const char *in_str, size_t len, int delim, bool strong obufout = obuf; ofre = osiz - 1; + if (strong_regex) + *obufout++ = '@'; + *obufout++ = delim; for (; len > 0; len--, str++) { chksize(2); /* make space for 2 chars */ @@ -349,10 +349,14 @@ re_update(NODE *t) /* regex was compiled with settings matching IGNORECASE */ if ((t->re_flags & CONSTANT) != 0) { /* it's a constant, so just return it as is */ - assert(t->type == Node_regex); + assert(t->type == Node_regex || t->type == Node_typedregex); return t->re_reg; } t1 = t->re_exp; + if (t1->type == Node_typedregex) { + assert((t1->re_flags & CONSTANT) != 0); + return t1->re_reg; + } if (t->re_text != NULL) { /* if contents haven't changed, just return it */ if (cmp_nodes(t->re_text, t1, true) == 0) diff --git a/test/ChangeLog b/test/ChangeLog index 10809205..ec0794bb 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -26,6 +26,17 @@ 2016-08-03 Arnold D. Robbins <arnold@skeeve.com> + Restore typed regexp tests. + + * typeof1.awk, typeof1.ok: Adjusted. + * typeof3.awk, typeof3.ok: Adjusted. + * gsubind.awk, gsubind.ok: Adjusted. + * Makefile.am (TYPED_RE_TESTS): Removed. + (dbugtypedre1, dbugtypedre2, typedregex1, typedregex2, + typedregex3): Moved back into regular tests. + +2016-08-03 Arnold D. Robbins <arnold@skeeve.com> + Remove typed regexes until they can be done correctly. * typeof1.awk, typeof1.ok: Adjusted. diff --git a/test/Makefile.am b/test/Makefile.am index 9dbedb35..2ca18c24 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1194,15 +1194,11 @@ UNIX_TESTS = \ fflush getlnhd localenl pid pipeio1 pipeio2 poundbang \ rtlen rtlen01 space strftlng -TYPED_RE_TESTS = \ - dbugtypedre1 dbugtypedre2 \ - typedregex1 typedregex2 typedregex3 - GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ colonwarn clos1way clos1way2 clos1way3 clos1way4 clos1way5 clos1way6 \ - crlf dbugeval dbugeval2 delsub \ + crlf dbugeval dbugeval2 dbugtypedre1 dbugtypedre2 delsub \ devfd devfd1 devfd2 dumpvars errno exit \ fieldwdth forcenum fpat1 fpat2 fpat3 fpat4 fpat5 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ @@ -1224,7 +1220,7 @@ GAWK_EXT_TESTS = \ splitarg4 strftime \ strtonum strtonum1 switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ symtab7 symtab8 symtab9 symtab10 \ - typeof1 typeof2 typeof3 typeof4 \ + typedregex1 typedregex2 typedregex3 typeof1 typeof2 typeof3 typeof4 \ timeout \ watchpoint1 diff --git a/test/Makefile.in b/test/Makefile.in index f1ffc0db..a0520a55 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1450,15 +1450,11 @@ UNIX_TESTS = \ fflush getlnhd localenl pid pipeio1 pipeio2 poundbang \ rtlen rtlen01 space strftlng -TYPED_RE_TESTS = \ - dbugtypedre1 dbugtypedre2 \ - typedregex1 typedregex2 typedregex3 - GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ colonwarn clos1way clos1way2 clos1way3 clos1way4 clos1way5 clos1way6 \ - crlf dbugeval dbugeval2 delsub \ + crlf dbugeval dbugeval2 dbugtypedre1 dbugtypedre2 delsub \ devfd devfd1 devfd2 dumpvars errno exit \ fieldwdth forcenum fpat1 fpat2 fpat3 fpat4 fpat5 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ @@ -1480,7 +1476,7 @@ GAWK_EXT_TESTS = \ splitarg4 strftime \ strtonum strtonum1 switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 \ symtab7 symtab8 symtab9 symtab10 \ - typeof1 typeof2 typeof3 typeof4 \ + typedregex1 typedregex2 typedregex3 typeof1 typeof2 typeof3 typeof4 \ timeout \ watchpoint1 @@ -3815,21 +3811,6 @@ getlnhd: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ -typedregex1: - @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ - -typedregex2: - @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ - -typedregex3: - @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ - aadelete1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -4280,6 +4261,21 @@ symtab7: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +typedregex1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +typedregex2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +typedregex3: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + typeof1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index a13ed244..081d96ef 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1022,21 +1022,6 @@ getlnhd: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ -typedregex1: - @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ - -typedregex2: - @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ - -typedregex3: - @echo $@ - @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ - @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ - aadelete1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1487,6 +1472,21 @@ symtab7: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +typedregex1: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +typedregex2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +typedregex3: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + typeof1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/gsubind.awk b/test/gsubind.awk index fec6cbc6..fce0d818 100644 --- a/test/gsubind.awk +++ b/test/gsubind.awk @@ -1,10 +1,9 @@ BEGIN { f = "foo" -# p = @/o/ -p = "o" + p = @/o/ gsub(p, "q", f) print f -# fun = "gsub" -# @fun(p, "q", f) -# print f + fun = "gsub" + @fun(p, "q", f) + print f } diff --git a/test/gsubind.ok b/test/gsubind.ok index ca6662e5..d25f018a 100644 --- a/test/gsubind.ok +++ b/test/gsubind.ok @@ -1 +1,3 @@ fqq +gawk: gsubind.awk:7: fatal: gsub: can be called indirectly only with two arguments +EXIT CODE: 2 diff --git a/test/typeof1.awk b/test/typeof1.awk index 9db64484..c301030e 100644 --- a/test/typeof1.awk +++ b/test/typeof1.awk @@ -1,9 +1,9 @@ BEGIN { a = 5 ; print typeof(a) print typeof(b) -# print typeof(@/foo/) + print typeof(@/foo/) c = "foo" ; print typeof(c) d[1] = 1 ; print typeof(d), typeof(d[1]) -# e = @/foo/ ; print typeof(e) -# print typeof(@/bar/) + e = @/foo/ ; print typeof(e) + print typeof(@/bar/) } diff --git a/test/typeof1.ok b/test/typeof1.ok index c172da5e..132cc24e 100644 --- a/test/typeof1.ok +++ b/test/typeof1.ok @@ -1,4 +1,7 @@ number untyped +regexp string array number +regexp +regexp diff --git a/test/typeof3.awk b/test/typeof3.awk index e31bf602..d148f373 100644 --- a/test/typeof3.awk +++ b/test/typeof3.awk @@ -1,13 +1,13 @@ -#BEGIN { -# x = @/xx/ -# print typeof(x) -# print x -#} +BEGIN { + x = @/xx/ + print typeof(x) + print x +} # this set may not really be needed for the test BEGIN { x = 4 -# print typeof(@/xxx/) + print typeof(@/xxx/) print typeof(3) print x } diff --git a/test/typeof3.ok b/test/typeof3.ok index 9a897048..a6cd6c4a 100644 --- a/test/typeof3.ok +++ b/test/typeof3.ok @@ -1,3 +1,6 @@ +regexp +xx +regexp number 4 number |