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 */ @@ -1817,6 +1818,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) ) @@ -1843,6 +1847,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); } @@ -1867,7 +1874,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); @@ -250,51 +250,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. */ @@ -304,51 +305,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 @@ -366,7 +368,7 @@ int yyparse (void); /* Copy the second part of user declarations. */ -#line 370 "awkgram.c" /* yacc.c:358 */ +#line 372 "awkgram.c" /* yacc.c:358 */ #ifdef short # undef short @@ -608,21 +610,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) @@ -634,16 +636,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, @@ -661,7 +663,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 @@ -671,23 +673,24 @@ static const yytype_uint16 yyrline[] = 0, 215, 215, 217, 222, 223, 227, 239, 244, 255, 262, 268, 277, 285, 287, 292, 300, 302, 308, 316, 326, 356, 370, 384, 392, 403, 415, 417, 419, 425, - 433, 434, 438, 438, 484, 483, 517, 519, 524, 534, - 581, 586, 587, 591, 593, 595, 602, 692, 734, 776, - 889, 896, 903, 914, 924, 934, 944, 956, 973, 972, - 997, 1009, 1009, 1108, 1108, 1142, 1173, 1182, 1183, 1189, - 1190, 1197, 1202, 1214, 1228, 1230, 1238, 1245, 1247, 1258, - 1260, 1269, 1270, 1278, 1283, 1283, 1294, 1298, 1306, 1307, - 1310, 1312, 1317, 1318, 1327, 1328, 1333, 1338, 1347, 1349, - 1351, 1358, 1359, 1365, 1366, 1371, 1373, 1378, 1380, 1388, - 1393, 1402, 1403, 1408, 1410, 1415, 1417, 1425, 1430, 1438, - 1443, 1450, 1452, 1454, 1471, 1481, 1488, 1490, 1495, 1497, - 1499, 1507, 1509, 1514, 1516, 1521, 1523, 1525, 1581, 1583, - 1585, 1587, 1589, 1591, 1593, 1595, 1609, 1614, 1619, 1644, - 1650, 1652, 1654, 1656, 1658, 1660, 1665, 1669, 1701, 1703, - 1709, 1715, 1728, 1729, 1730, 1735, 1740, 1744, 1748, 1763, - 1784, 1789, 1826, 1855, 1856, 1862, 1863, 1868, 1870, 1877, - 1894, 1911, 1913, 1920, 1925, 1933, 1943, 1955, 1964, 1968, - 1972, 1976, 1980, 1984, 1987, 1989, 1993, 1997, 2001 + 433, 434, 438, 438, 484, 483, 517, 539, 541, 546, + 556, 603, 608, 609, 613, 615, 617, 624, 714, 756, + 798, 911, 918, 925, 936, 946, 956, 966, 978, 995, + 994, 1019, 1031, 1031, 1130, 1130, 1164, 1195, 1204, 1205, + 1211, 1212, 1219, 1224, 1236, 1250, 1252, 1260, 1267, 1269, + 1277, 1286, 1288, 1297, 1298, 1306, 1311, 1311, 1322, 1326, + 1334, 1335, 1338, 1340, 1345, 1346, 1355, 1356, 1361, 1366, + 1375, 1377, 1379, 1386, 1387, 1393, 1394, 1399, 1401, 1406, + 1408, 1416, 1421, 1430, 1431, 1436, 1438, 1443, 1445, 1453, + 1458, 1466, 1467, 1472, 1479, 1483, 1485, 1487, 1500, 1517, + 1527, 1534, 1536, 1541, 1543, 1545, 1553, 1555, 1560, 1562, + 1567, 1569, 1571, 1627, 1629, 1631, 1633, 1635, 1637, 1639, + 1641, 1655, 1660, 1665, 1690, 1696, 1698, 1700, 1702, 1704, + 1706, 1711, 1715, 1747, 1749, 1755, 1761, 1774, 1775, 1776, + 1781, 1786, 1790, 1794, 1809, 1830, 1835, 1872, 1901, 1902, + 1908, 1909, 1914, 1916, 1923, 1940, 1957, 1959, 1966, 1971, + 1979, 1989, 2001, 2010, 2014, 2018, 2022, 2026, 2030, 2033, + 2035, 2039, 2043, 2047 }; #endif @@ -697,31 +700,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 @@ -735,61 +739,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. @@ -797,65 +801,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 @@ -863,306 +867,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. */ @@ -1171,23 +1194,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 }; @@ -1869,7 +1893,7 @@ yyreduce: rule = 0; yyerrok; } -#line 1873 "awkgram.c" /* yacc.c:1646 */ +#line 1897 "awkgram.c" /* yacc.c:1646 */ break; case 5: @@ -1877,7 +1901,7 @@ yyreduce: { next_sourcefile(); } -#line 1881 "awkgram.c" /* yacc.c:1646 */ +#line 1905 "awkgram.c" /* yacc.c:1646 */ break; case 6: @@ -1890,7 +1914,7 @@ yyreduce: */ /* yyerrok; */ } -#line 1894 "awkgram.c" /* yacc.c:1646 */ +#line 1918 "awkgram.c" /* yacc.c:1646 */ break; case 7: @@ -1899,7 +1923,7 @@ yyreduce: (void) append_rule((yyvsp[-1]), (yyvsp[0])); first_rule = false; } -#line 1903 "awkgram.c" /* yacc.c:1646 */ +#line 1927 "awkgram.c" /* yacc.c:1646 */ break; case 8: @@ -1914,7 +1938,7 @@ yyreduce: } else /* pattern rule with non-empty pattern */ (void) append_rule((yyvsp[-1]), NULL); } -#line 1918 "awkgram.c" /* yacc.c:1646 */ +#line 1942 "awkgram.c" /* yacc.c:1646 */ break; case 9: @@ -1925,7 +1949,7 @@ yyreduce: want_param_names = DONT_CHECK; yyerrok; } -#line 1929 "awkgram.c" /* yacc.c:1646 */ +#line 1953 "awkgram.c" /* yacc.c:1646 */ break; case 10: @@ -1935,7 +1959,7 @@ yyreduce: at_seen = false; yyerrok; } -#line 1939 "awkgram.c" /* yacc.c:1646 */ +#line 1963 "awkgram.c" /* yacc.c:1646 */ break; case 11: @@ -1945,7 +1969,7 @@ yyreduce: at_seen = false; yyerrok; } -#line 1949 "awkgram.c" /* yacc.c:1646 */ +#line 1973 "awkgram.c" /* yacc.c:1646 */ break; case 12: @@ -1957,19 +1981,19 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1961 "awkgram.c" /* yacc.c:1646 */ +#line 1985 "awkgram.c" /* yacc.c:1646 */ break; case 13: #line 286 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1967 "awkgram.c" /* yacc.c:1646 */ +#line 1991 "awkgram.c" /* yacc.c:1646 */ break; case 14: #line 288 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1973 "awkgram.c" /* yacc.c:1646 */ +#line 1997 "awkgram.c" /* yacc.c:1646 */ break; case 15: @@ -1981,19 +2005,19 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1985 "awkgram.c" /* yacc.c:1646 */ +#line 2009 "awkgram.c" /* yacc.c:1646 */ break; case 16: #line 301 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1991 "awkgram.c" /* yacc.c:1646 */ +#line 2015 "awkgram.c" /* yacc.c:1646 */ break; case 17: #line 303 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1997 "awkgram.c" /* yacc.c:1646 */ +#line 2021 "awkgram.c" /* yacc.c:1646 */ break; case 18: @@ -2006,7 +2030,7 @@ yyreduce: } else (yyval) = NULL; } -#line 2010 "awkgram.c" /* yacc.c:1646 */ +#line 2034 "awkgram.c" /* yacc.c:1646 */ break; case 19: @@ -2019,7 +2043,7 @@ yyreduce: } else (yyval) = (yyvsp[0]); } -#line 2023 "awkgram.c" /* yacc.c:1646 */ +#line 2047 "awkgram.c" /* yacc.c:1646 */ break; case 20: @@ -2053,7 +2077,7 @@ yyreduce: (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); rule = Rule; } -#line 2057 "awkgram.c" /* yacc.c:1646 */ +#line 2081 "awkgram.c" /* yacc.c:1646 */ break; case 21: @@ -2071,7 +2095,7 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2075 "awkgram.c" /* yacc.c:1646 */ +#line 2099 "awkgram.c" /* yacc.c:1646 */ break; case 22: @@ -2089,7 +2113,7 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2093 "awkgram.c" /* yacc.c:1646 */ +#line 2117 "awkgram.c" /* yacc.c:1646 */ break; case 23: @@ -2101,7 +2125,7 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2105 "awkgram.c" /* yacc.c:1646 */ +#line 2129 "awkgram.c" /* yacc.c:1646 */ break; case 24: @@ -2113,7 +2137,7 @@ yyreduce: check_comment(); (yyval) = (yyvsp[0]); } -#line 2117 "awkgram.c" /* yacc.c:1646 */ +#line 2141 "awkgram.c" /* yacc.c:1646 */ break; case 25: @@ -2126,19 +2150,19 @@ yyreduce: ip = (yyvsp[-3]); (yyval) = ip; } -#line 2130 "awkgram.c" /* yacc.c:1646 */ +#line 2154 "awkgram.c" /* yacc.c:1646 */ break; case 26: #line 416 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2136 "awkgram.c" /* yacc.c:1646 */ +#line 2160 "awkgram.c" /* yacc.c:1646 */ break; case 27: #line 418 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2142 "awkgram.c" /* yacc.c:1646 */ +#line 2166 "awkgram.c" /* yacc.c:1646 */ break; case 28: @@ -2148,7 +2172,7 @@ yyreduce: tokstart); YYABORT; } -#line 2152 "awkgram.c" /* yacc.c:1646 */ +#line 2176 "awkgram.c" /* yacc.c:1646 */ break; case 29: @@ -2157,13 +2181,13 @@ yyreduce: (yyval) = (yyvsp[0]); at_seen = false; } -#line 2161 "awkgram.c" /* yacc.c:1646 */ +#line 2185 "awkgram.c" /* yacc.c:1646 */ break; case 32: #line 438 "awkgram.y" /* yacc.c:1646 */ { want_param_names = FUNC_HEADER; } -#line 2167 "awkgram.c" /* yacc.c:1646 */ +#line 2191 "awkgram.c" /* yacc.c:1646 */ break; case 33: @@ -2205,13 +2229,13 @@ yyreduce: (yyval) = (yyvsp[-6]); want_param_names = FUNC_BODY; } -#line 2209 "awkgram.c" /* yacc.c:1646 */ +#line 2233 "awkgram.c" /* yacc.c:1646 */ break; case 34: #line 484 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } -#line 2215 "awkgram.c" /* yacc.c:1646 */ +#line 2239 "awkgram.c" /* yacc.c:1646 */ break; case 35: @@ -2244,17 +2268,41 @@ yyreduce: (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2248 "awkgram.c" /* yacc.c:1646 */ +#line 2272 "awkgram.c" /* yacc.c:1646 */ break; case 36: #line 518 "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 2296 "awkgram.c" /* yacc.c:1646 */ + break; + + case 37: +#line 540 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[0])); } -#line 2254 "awkgram.c" /* yacc.c:1646 */ +#line 2302 "awkgram.c" /* yacc.c:1646 */ break; - case 38: -#line 524 "awkgram.y" /* yacc.c:1646 */ + case 39: +#line 546 "awkgram.y" /* yacc.c:1646 */ { if (prior_comment != NULL) { (yyval) = list_create(prior_comment); @@ -2265,11 +2313,11 @@ yyreduce: } else (yyval) = NULL; } -#line 2269 "awkgram.c" /* yacc.c:1646 */ +#line 2317 "awkgram.c" /* yacc.c:1646 */ break; - case 39: -#line 535 "awkgram.y" /* yacc.c:1646 */ + case 40: +#line 557 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0]) == NULL) { if (prior_comment != NULL) { @@ -2316,40 +2364,40 @@ yyreduce: } yyerrok; } -#line 2320 "awkgram.c" /* yacc.c:1646 */ +#line 2368 "awkgram.c" /* yacc.c:1646 */ break; - case 40: -#line 582 "awkgram.y" /* yacc.c:1646 */ + case 41: +#line 604 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2326 "awkgram.c" /* yacc.c:1646 */ +#line 2374 "awkgram.c" /* yacc.c:1646 */ break; - case 43: -#line 592 "awkgram.y" /* yacc.c:1646 */ + case 44: +#line 614 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2332 "awkgram.c" /* yacc.c:1646 */ +#line 2380 "awkgram.c" /* yacc.c:1646 */ break; - case 44: -#line 594 "awkgram.y" /* yacc.c:1646 */ + case 45: +#line 616 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2338 "awkgram.c" /* yacc.c:1646 */ +#line 2386 "awkgram.c" /* yacc.c:1646 */ break; - case 45: -#line 596 "awkgram.y" /* yacc.c:1646 */ + case 46: +#line 618 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2349 "awkgram.c" /* yacc.c:1646 */ +#line 2397 "awkgram.c" /* yacc.c:1646 */ break; - case 46: -#line 603 "awkgram.y" /* yacc.c:1646 */ + case 47: +#line 625 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2439,11 +2487,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2443 "awkgram.c" /* yacc.c:1646 */ +#line 2491 "awkgram.c" /* yacc.c:1646 */ break; - case 47: -#line 693 "awkgram.y" /* yacc.c:1646 */ + case 48: +#line 715 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2485,11 +2533,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2489 "awkgram.c" /* yacc.c:1646 */ +#line 2537 "awkgram.c" /* yacc.c:1646 */ break; - case 48: -#line 735 "awkgram.y" /* yacc.c:1646 */ + case 49: +#line 757 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2531,11 +2579,11 @@ yyreduce: } /* else $1 and $4 are NULLs */ } -#line 2535 "awkgram.c" /* yacc.c:1646 */ +#line 2583 "awkgram.c" /* yacc.c:1646 */ break; - case 49: -#line 777 "awkgram.y" /* yacc.c:1646 */ + case 50: +#line 799 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; char *var_name = (yyvsp[-5])->lextok; @@ -2648,33 +2696,33 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2652 "awkgram.c" /* yacc.c:1646 */ +#line 2700 "awkgram.c" /* yacc.c:1646 */ break; - case 50: -#line 890 "awkgram.y" /* yacc.c:1646 */ + case 51: +#line 912 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2663 "awkgram.c" /* yacc.c:1646 */ +#line 2711 "awkgram.c" /* yacc.c:1646 */ break; - case 51: -#line 897 "awkgram.y" /* yacc.c:1646 */ + case 52: +#line 919 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2674 "awkgram.c" /* yacc.c:1646 */ +#line 2722 "awkgram.c" /* yacc.c:1646 */ break; - case 52: -#line 904 "awkgram.y" /* yacc.c:1646 */ + case 53: +#line 926 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); @@ -2682,11 +2730,11 @@ regular_loop: (yyval) = (yyvsp[0]); (yyval) = add_pending_comment((yyval)); } -#line 2686 "awkgram.c" /* yacc.c:1646 */ +#line 2734 "awkgram.c" /* yacc.c:1646 */ break; - case 53: -#line 915 "awkgram.y" /* yacc.c:1646 */ + case 54: +#line 937 "awkgram.y" /* yacc.c:1646 */ { if (! break_allowed) error_ln((yyvsp[-1])->source_line, @@ -2696,11 +2744,11 @@ regular_loop: (yyval) = add_pending_comment((yyval)); } -#line 2700 "awkgram.c" /* yacc.c:1646 */ +#line 2748 "awkgram.c" /* yacc.c:1646 */ break; - case 54: -#line 925 "awkgram.y" /* yacc.c:1646 */ + case 55: +#line 947 "awkgram.y" /* yacc.c:1646 */ { if (! continue_allowed) error_ln((yyvsp[-1])->source_line, @@ -2710,11 +2758,11 @@ regular_loop: (yyval) = add_pending_comment((yyval)); } -#line 2714 "awkgram.c" /* yacc.c:1646 */ +#line 2762 "awkgram.c" /* yacc.c:1646 */ break; - case 55: -#line 935 "awkgram.y" /* yacc.c:1646 */ + case 56: +#line 957 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2724,11 +2772,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); (yyval) = add_pending_comment((yyval)); } -#line 2728 "awkgram.c" /* yacc.c:1646 */ +#line 2776 "awkgram.c" /* yacc.c:1646 */ break; - case 56: -#line 945 "awkgram.y" /* yacc.c:1646 */ + case 57: +#line 967 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2740,11 +2788,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); (yyval) = add_pending_comment((yyval)); } -#line 2744 "awkgram.c" /* yacc.c:1646 */ +#line 2792 "awkgram.c" /* yacc.c:1646 */ break; - case 57: -#line 957 "awkgram.y" /* yacc.c:1646 */ + case 58: +#line 979 "awkgram.y" /* yacc.c:1646 */ { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2760,20 +2808,20 @@ regular_loop: (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); (yyval) = add_pending_comment((yyval)); } -#line 2764 "awkgram.c" /* yacc.c:1646 */ +#line 2812 "awkgram.c" /* yacc.c:1646 */ break; - case 58: -#line 973 "awkgram.y" /* yacc.c:1646 */ + case 59: +#line 995 "awkgram.y" /* yacc.c:1646 */ { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2773 "awkgram.c" /* yacc.c:1646 */ +#line 2821 "awkgram.c" /* yacc.c:1646 */ break; - case 59: -#line 976 "awkgram.y" /* yacc.c:1646 */ + case 60: +#line 998 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) { (yyval) = list_create((yyvsp[-3])); @@ -2795,17 +2843,17 @@ regular_loop: } (yyval) = add_pending_comment((yyval)); } -#line 2799 "awkgram.c" /* yacc.c:1646 */ +#line 2847 "awkgram.c" /* yacc.c:1646 */ break; - case 61: -#line 1009 "awkgram.y" /* yacc.c:1646 */ + case 62: +#line 1031 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } -#line 2805 "awkgram.c" /* yacc.c:1646 */ +#line 2853 "awkgram.c" /* yacc.c:1646 */ break; - case 62: -#line 1010 "awkgram.y" /* yacc.c:1646 */ + case 63: +#line 1032 "awkgram.y" /* yacc.c:1646 */ { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2903,17 +2951,17 @@ regular_print: } (yyval) = add_pending_comment((yyval)); } -#line 2907 "awkgram.c" /* yacc.c:1646 */ +#line 2955 "awkgram.c" /* yacc.c:1646 */ break; - case 63: -#line 1108 "awkgram.y" /* yacc.c:1646 */ + case 64: +#line 1130 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } -#line 2913 "awkgram.c" /* yacc.c:1646 */ +#line 2961 "awkgram.c" /* yacc.c:1646 */ break; - case 64: -#line 1109 "awkgram.y" /* yacc.c:1646 */ + case 65: +#line 1131 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-2])->lextok; @@ -2947,11 +2995,11 @@ regular_print: } (yyval) = add_pending_comment((yyval)); } -#line 2951 "awkgram.c" /* yacc.c:1646 */ +#line 2999 "awkgram.c" /* yacc.c:1646 */ break; - case 65: -#line 1147 "awkgram.y" /* yacc.c:1646 */ + case 66: +#line 1169 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; char *arr = (yyvsp[-1])->lextok; @@ -2978,55 +3026,55 @@ regular_print: } (yyval) = add_pending_comment((yyval)); } -#line 2982 "awkgram.c" /* yacc.c:1646 */ +#line 3030 "awkgram.c" /* yacc.c:1646 */ break; - case 66: -#line 1174 "awkgram.y" /* yacc.c:1646 */ + case 67: +#line 1196 "awkgram.y" /* yacc.c:1646 */ { (yyval) = optimize_assignment((yyvsp[0])); (yyval) = add_pending_comment((yyval)); } -#line 2991 "awkgram.c" /* yacc.c:1646 */ +#line 3039 "awkgram.c" /* yacc.c:1646 */ break; - case 67: -#line 1182 "awkgram.y" /* yacc.c:1646 */ + case 68: +#line 1204 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2997 "awkgram.c" /* yacc.c:1646 */ +#line 3045 "awkgram.c" /* yacc.c:1646 */ break; - case 68: -#line 1184 "awkgram.y" /* yacc.c:1646 */ + case 69: +#line 1206 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3003 "awkgram.c" /* yacc.c:1646 */ +#line 3051 "awkgram.c" /* yacc.c:1646 */ break; - case 69: -#line 1189 "awkgram.y" /* yacc.c:1646 */ + case 70: +#line 1211 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3009 "awkgram.c" /* yacc.c:1646 */ +#line 3057 "awkgram.c" /* yacc.c:1646 */ break; - case 70: -#line 1191 "awkgram.y" /* yacc.c:1646 */ + case 71: +#line 1213 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) (yyval) = list_create((yyvsp[0])); else (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } -#line 3020 "awkgram.c" /* yacc.c:1646 */ +#line 3068 "awkgram.c" /* yacc.c:1646 */ break; - case 71: -#line 1198 "awkgram.y" /* yacc.c:1646 */ + case 72: +#line 1220 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3026 "awkgram.c" /* yacc.c:1646 */ +#line 3074 "awkgram.c" /* yacc.c:1646 */ break; - case 72: -#line 1203 "awkgram.y" /* yacc.c:1646 */ + case 73: +#line 1225 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -3038,11 +3086,11 @@ regular_print: bcfree((yyvsp[-2])); (yyval) = (yyvsp[-4]); } -#line 3042 "awkgram.c" /* yacc.c:1646 */ +#line 3090 "awkgram.c" /* yacc.c:1646 */ break; - case 73: -#line 1215 "awkgram.y" /* yacc.c:1646 */ + case 74: +#line 1237 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -3053,17 +3101,17 @@ regular_print: (yyvsp[-3])->case_stmt = casestmt; (yyval) = (yyvsp[-3]); } -#line 3057 "awkgram.c" /* yacc.c:1646 */ +#line 3105 "awkgram.c" /* yacc.c:1646 */ break; - case 74: -#line 1229 "awkgram.y" /* yacc.c:1646 */ + case 75: +#line 1251 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3063 "awkgram.c" /* yacc.c:1646 */ +#line 3111 "awkgram.c" /* yacc.c:1646 */ break; - case 75: -#line 1231 "awkgram.y" /* yacc.c:1646 */ + case 76: +#line 1253 "awkgram.y" /* yacc.c:1646 */ { NODE *n = (yyvsp[0])->memory; (void) force_number(n); @@ -3071,28 +3119,28 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3075 "awkgram.c" /* yacc.c:1646 */ +#line 3123 "awkgram.c" /* yacc.c:1646 */ break; - case 76: -#line 1239 "awkgram.y" /* yacc.c:1646 */ + case 77: +#line 1261 "awkgram.y" /* yacc.c:1646 */ { NODE *n = (yyvsp[0])->lasti->memory; bcfree((yyvsp[-1])); add_sign_to_num(n, "+"); (yyval) = (yyvsp[0]); } -#line 3086 "awkgram.c" /* yacc.c:1646 */ +#line 3134 "awkgram.c" /* yacc.c:1646 */ break; - case 77: -#line 1246 "awkgram.y" /* yacc.c:1646 */ + case 78: +#line 1268 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3092 "awkgram.c" /* yacc.c:1646 */ +#line 3140 "awkgram.c" /* yacc.c:1646 */ break; - case 78: -#line 1248 "awkgram.y" /* yacc.c:1646 */ + case 79: +#line 1270 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->memory->type == Node_regex) (yyvsp[0])->opcode = Op_push_re; @@ -3100,47 +3148,57 @@ regular_print: (yyvsp[0])->opcode = Op_push; (yyval) = (yyvsp[0]); } -#line 3104 "awkgram.c" /* yacc.c:1646 */ +#line 3152 "awkgram.c" /* yacc.c:1646 */ break; - case 79: -#line 1259 "awkgram.y" /* yacc.c:1646 */ - { (yyval) = (yyvsp[0]); } -#line 3110 "awkgram.c" /* yacc.c:1646 */ + case 80: +#line 1278 "awkgram.y" /* yacc.c:1646 */ + { + assert((yyvsp[0])->memory->type == Node_typedregex); + (yyvsp[0])->opcode = Op_push_re; + (yyval) = (yyvsp[0]); + } +#line 3162 "awkgram.c" /* yacc.c:1646 */ break; - case 80: -#line 1261 "awkgram.y" /* yacc.c:1646 */ + case 81: +#line 1287 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3116 "awkgram.c" /* yacc.c:1646 */ +#line 3168 "awkgram.c" /* yacc.c:1646 */ break; case 82: -#line 1271 "awkgram.y" /* yacc.c:1646 */ +#line 1289 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = (yyvsp[0]); } +#line 3174 "awkgram.c" /* yacc.c:1646 */ + break; + + case 84: +#line 1299 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3124 "awkgram.c" /* yacc.c:1646 */ +#line 3182 "awkgram.c" /* yacc.c:1646 */ break; - case 83: -#line 1278 "awkgram.y" /* yacc.c:1646 */ + case 85: +#line 1306 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; (yyval) = NULL; } -#line 3134 "awkgram.c" /* yacc.c:1646 */ +#line 3192 "awkgram.c" /* yacc.c:1646 */ break; - case 84: -#line 1283 "awkgram.y" /* yacc.c:1646 */ + case 86: +#line 1311 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } -#line 3140 "awkgram.c" /* yacc.c:1646 */ +#line 3198 "awkgram.c" /* yacc.c:1646 */ break; - case 85: -#line 1284 "awkgram.y" /* yacc.c:1646 */ + case 87: +#line 1312 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->redir_type == redirect_twoway && (yyvsp[0])->lasti->opcode == Op_K_getline_redir @@ -3148,63 +3206,63 @@ regular_print: yyerror(_("multistage two-way pipelines don't work")); (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } -#line 3152 "awkgram.c" /* yacc.c:1646 */ +#line 3210 "awkgram.c" /* yacc.c:1646 */ break; - case 86: -#line 1295 "awkgram.y" /* yacc.c:1646 */ + case 88: +#line 1323 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } -#line 3160 "awkgram.c" /* yacc.c:1646 */ +#line 3218 "awkgram.c" /* yacc.c:1646 */ break; - case 87: -#line 1300 "awkgram.y" /* yacc.c:1646 */ + case 89: +#line 1328 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } -#line 3168 "awkgram.c" /* yacc.c:1646 */ +#line 3226 "awkgram.c" /* yacc.c:1646 */ break; - case 92: -#line 1317 "awkgram.y" /* yacc.c:1646 */ + case 94: +#line 1345 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3174 "awkgram.c" /* yacc.c:1646 */ +#line 3232 "awkgram.c" /* yacc.c:1646 */ break; - case 93: -#line 1319 "awkgram.y" /* yacc.c:1646 */ + case 95: +#line 1347 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3183 "awkgram.c" /* yacc.c:1646 */ +#line 3241 "awkgram.c" /* yacc.c:1646 */ break; - case 94: -#line 1327 "awkgram.y" /* yacc.c:1646 */ + case 96: +#line 1355 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3189 "awkgram.c" /* yacc.c:1646 */ +#line 3247 "awkgram.c" /* yacc.c:1646 */ break; - case 95: -#line 1329 "awkgram.y" /* yacc.c:1646 */ + case 97: +#line 1357 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3195 "awkgram.c" /* yacc.c:1646 */ +#line 3253 "awkgram.c" /* yacc.c:1646 */ break; - case 96: -#line 1334 "awkgram.y" /* yacc.c:1646 */ + case 98: +#line 1362 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = 0; (yyval) = list_create((yyvsp[0])); } -#line 3204 "awkgram.c" /* yacc.c:1646 */ +#line 3262 "awkgram.c" /* yacc.c:1646 */ break; - case 97: -#line 1339 "awkgram.y" /* yacc.c:1646 */ + case 99: +#line 1367 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2]) != NULL && (yyvsp[0]) != NULL) { (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; @@ -3213,74 +3271,74 @@ regular_print: } else (yyval) = NULL; } -#line 3217 "awkgram.c" /* yacc.c:1646 */ +#line 3275 "awkgram.c" /* yacc.c:1646 */ break; - case 98: -#line 1348 "awkgram.y" /* yacc.c:1646 */ + case 100: +#line 1376 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3223 "awkgram.c" /* yacc.c:1646 */ +#line 3281 "awkgram.c" /* yacc.c:1646 */ break; - case 99: -#line 1350 "awkgram.y" /* yacc.c:1646 */ + case 101: +#line 1378 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3229 "awkgram.c" /* yacc.c:1646 */ +#line 3287 "awkgram.c" /* yacc.c:1646 */ break; - case 100: -#line 1352 "awkgram.y" /* yacc.c:1646 */ + case 102: +#line 1380 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } -#line 3235 "awkgram.c" /* yacc.c:1646 */ +#line 3293 "awkgram.c" /* yacc.c:1646 */ break; - case 101: -#line 1358 "awkgram.y" /* yacc.c:1646 */ + case 103: +#line 1386 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3241 "awkgram.c" /* yacc.c:1646 */ +#line 3299 "awkgram.c" /* yacc.c:1646 */ break; - case 102: -#line 1360 "awkgram.y" /* yacc.c:1646 */ + case 104: +#line 1388 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3247 "awkgram.c" /* yacc.c:1646 */ +#line 3305 "awkgram.c" /* yacc.c:1646 */ break; - case 103: -#line 1365 "awkgram.y" /* yacc.c:1646 */ + case 105: +#line 1393 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3253 "awkgram.c" /* yacc.c:1646 */ +#line 3311 "awkgram.c" /* yacc.c:1646 */ break; - case 104: -#line 1367 "awkgram.y" /* yacc.c:1646 */ + case 106: +#line 1395 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3259 "awkgram.c" /* yacc.c:1646 */ +#line 3317 "awkgram.c" /* yacc.c:1646 */ break; - case 105: -#line 1372 "awkgram.y" /* yacc.c:1646 */ + case 107: +#line 1400 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3265 "awkgram.c" /* yacc.c:1646 */ +#line 3323 "awkgram.c" /* yacc.c:1646 */ break; - case 106: -#line 1374 "awkgram.y" /* yacc.c:1646 */ + case 108: +#line 1402 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3274 "awkgram.c" /* yacc.c:1646 */ +#line 3332 "awkgram.c" /* yacc.c:1646 */ break; - case 107: -#line 1379 "awkgram.y" /* yacc.c:1646 */ + case 109: +#line 1407 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3280 "awkgram.c" /* yacc.c:1646 */ +#line 3338 "awkgram.c" /* yacc.c:1646 */ break; - case 108: -#line 1381 "awkgram.y" /* yacc.c:1646 */ + case 110: +#line 1409 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3288,62 +3346,62 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3292 "awkgram.c" /* yacc.c:1646 */ +#line 3350 "awkgram.c" /* yacc.c:1646 */ break; - case 109: -#line 1389 "awkgram.y" /* yacc.c:1646 */ + case 111: +#line 1417 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3301 "awkgram.c" /* yacc.c:1646 */ +#line 3359 "awkgram.c" /* yacc.c:1646 */ break; - case 110: -#line 1394 "awkgram.y" /* yacc.c:1646 */ + case 112: +#line 1422 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3310 "awkgram.c" /* yacc.c:1646 */ +#line 3368 "awkgram.c" /* yacc.c:1646 */ break; - case 111: -#line 1402 "awkgram.y" /* yacc.c:1646 */ + case 113: +#line 1430 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3316 "awkgram.c" /* yacc.c:1646 */ +#line 3374 "awkgram.c" /* yacc.c:1646 */ break; - case 112: -#line 1404 "awkgram.y" /* yacc.c:1646 */ + case 114: +#line 1432 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3322 "awkgram.c" /* yacc.c:1646 */ +#line 3380 "awkgram.c" /* yacc.c:1646 */ break; - case 113: -#line 1409 "awkgram.y" /* yacc.c:1646 */ + case 115: +#line 1437 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3328 "awkgram.c" /* yacc.c:1646 */ +#line 3386 "awkgram.c" /* yacc.c:1646 */ break; - case 114: -#line 1411 "awkgram.y" /* yacc.c:1646 */ + case 116: +#line 1439 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3337 "awkgram.c" /* yacc.c:1646 */ +#line 3395 "awkgram.c" /* yacc.c:1646 */ break; - case 115: -#line 1416 "awkgram.y" /* yacc.c:1646 */ + case 117: +#line 1444 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3343 "awkgram.c" /* yacc.c:1646 */ +#line 3401 "awkgram.c" /* yacc.c:1646 */ break; - case 116: -#line 1418 "awkgram.y" /* yacc.c:1646 */ + case 118: +#line 1446 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3351,58 +3409,89 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3355 "awkgram.c" /* yacc.c:1646 */ +#line 3413 "awkgram.c" /* yacc.c:1646 */ break; - case 117: -#line 1426 "awkgram.y" /* yacc.c:1646 */ + case 119: +#line 1454 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3364 "awkgram.c" /* yacc.c:1646 */ +#line 3422 "awkgram.c" /* yacc.c:1646 */ break; - case 118: -#line 1431 "awkgram.y" /* yacc.c:1646 */ + case 120: +#line 1459 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3373 "awkgram.c" /* yacc.c:1646 */ +#line 3431 "awkgram.c" /* yacc.c:1646 */ break; - case 119: -#line 1438 "awkgram.y" /* yacc.c:1646 */ + case 121: +#line 1466 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3379 "awkgram.c" /* yacc.c:1646 */ +#line 3437 "awkgram.c" /* yacc.c:1646 */ break; - case 120: -#line 1444 "awkgram.y" /* yacc.c:1646 */ + case 122: +#line 1467 "awkgram.y" /* yacc.c:1646 */ + { (yyval) = list_create((yyvsp[0])); } +#line 3443 "awkgram.c" /* yacc.c:1646 */ + break; + + case 123: +#line 1473 "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 3390 "awkgram.c" /* yacc.c:1646 */ +#line 3454 "awkgram.c" /* yacc.c:1646 */ break; - case 121: -#line 1451 "awkgram.y" /* yacc.c:1646 */ + case 124: +#line 1480 "awkgram.y" /* yacc.c:1646 */ + { + (yyval) = mk_assignment((yyvsp[-2]), list_create((yyvsp[0])), (yyvsp[-1])); + } +#line 3462 "awkgram.c" /* yacc.c:1646 */ + break; + + case 125: +#line 1484 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3396 "awkgram.c" /* yacc.c:1646 */ +#line 3468 "awkgram.c" /* yacc.c:1646 */ break; - case 122: -#line 1453 "awkgram.y" /* yacc.c:1646 */ + case 126: +#line 1486 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3402 "awkgram.c" /* yacc.c:1646 */ +#line 3474 "awkgram.c" /* yacc.c:1646 */ break; - case 123: -#line 1455 "awkgram.y" /* yacc.c:1646 */ + case 127: +#line 1488 "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 3491 "awkgram.c" /* yacc.c:1646 */ + break; + + case 128: +#line 1501 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[-1])->source_line, @@ -3419,11 +3508,11 @@ regular_print: (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } -#line 3423 "awkgram.c" /* yacc.c:1646 */ +#line 3512 "awkgram.c" /* yacc.c:1646 */ break; - case 124: -#line 1472 "awkgram.y" /* yacc.c:1646 */ + case 129: +#line 1518 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) warning_ln((yyvsp[-1])->source_line, @@ -3433,91 +3522,91 @@ regular_print: (yyvsp[-1])->expr_count = 1; (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3437 "awkgram.c" /* yacc.c:1646 */ +#line 3526 "awkgram.c" /* yacc.c:1646 */ break; - case 125: -#line 1482 "awkgram.y" /* yacc.c:1646 */ + case 130: +#line 1528 "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 3448 "awkgram.c" /* yacc.c:1646 */ +#line 3537 "awkgram.c" /* yacc.c:1646 */ break; - case 126: -#line 1489 "awkgram.y" /* yacc.c:1646 */ + case 131: +#line 1535 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3454 "awkgram.c" /* yacc.c:1646 */ +#line 3543 "awkgram.c" /* yacc.c:1646 */ break; - case 127: -#line 1491 "awkgram.y" /* yacc.c:1646 */ + case 132: +#line 1537 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3460 "awkgram.c" /* yacc.c:1646 */ +#line 3549 "awkgram.c" /* yacc.c:1646 */ break; - case 128: -#line 1496 "awkgram.y" /* yacc.c:1646 */ + case 133: +#line 1542 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3466 "awkgram.c" /* yacc.c:1646 */ +#line 3555 "awkgram.c" /* yacc.c:1646 */ break; - case 129: -#line 1498 "awkgram.y" /* yacc.c:1646 */ + case 134: +#line 1544 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3472 "awkgram.c" /* yacc.c:1646 */ +#line 3561 "awkgram.c" /* yacc.c:1646 */ break; - case 130: -#line 1500 "awkgram.y" /* yacc.c:1646 */ + case 135: +#line 1546 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_assign_quotient; (yyval) = (yyvsp[0]); } -#line 3481 "awkgram.c" /* yacc.c:1646 */ +#line 3570 "awkgram.c" /* yacc.c:1646 */ break; - case 131: -#line 1508 "awkgram.y" /* yacc.c:1646 */ + case 136: +#line 1554 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3487 "awkgram.c" /* yacc.c:1646 */ +#line 3576 "awkgram.c" /* yacc.c:1646 */ break; - case 132: -#line 1510 "awkgram.y" /* yacc.c:1646 */ + case 137: +#line 1556 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3493 "awkgram.c" /* yacc.c:1646 */ +#line 3582 "awkgram.c" /* yacc.c:1646 */ break; - case 133: -#line 1515 "awkgram.y" /* yacc.c:1646 */ + case 138: +#line 1561 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3499 "awkgram.c" /* yacc.c:1646 */ +#line 3588 "awkgram.c" /* yacc.c:1646 */ break; - case 134: -#line 1517 "awkgram.y" /* yacc.c:1646 */ + case 139: +#line 1563 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3505 "awkgram.c" /* yacc.c:1646 */ +#line 3594 "awkgram.c" /* yacc.c:1646 */ break; - case 135: -#line 1522 "awkgram.y" /* yacc.c:1646 */ + case 140: +#line 1568 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3511 "awkgram.c" /* yacc.c:1646 */ +#line 3600 "awkgram.c" /* yacc.c:1646 */ break; - case 136: -#line 1524 "awkgram.y" /* yacc.c:1646 */ + case 141: +#line 1570 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3517 "awkgram.c" /* yacc.c:1646 */ +#line 3606 "awkgram.c" /* yacc.c:1646 */ break; - case 137: -#line 1526 "awkgram.y" /* yacc.c:1646 */ + case 142: +#line 1572 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; @@ -3570,47 +3659,47 @@ regular_print: max_args = count; } } -#line 3574 "awkgram.c" /* yacc.c:1646 */ +#line 3663 "awkgram.c" /* yacc.c:1646 */ break; - case 139: -#line 1584 "awkgram.y" /* yacc.c:1646 */ + case 144: +#line 1630 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3580 "awkgram.c" /* yacc.c:1646 */ +#line 3669 "awkgram.c" /* yacc.c:1646 */ break; - case 140: -#line 1586 "awkgram.y" /* yacc.c:1646 */ + case 145: +#line 1632 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3586 "awkgram.c" /* yacc.c:1646 */ +#line 3675 "awkgram.c" /* yacc.c:1646 */ break; - case 141: -#line 1588 "awkgram.y" /* yacc.c:1646 */ + case 146: +#line 1634 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3592 "awkgram.c" /* yacc.c:1646 */ +#line 3681 "awkgram.c" /* yacc.c:1646 */ break; - case 142: -#line 1590 "awkgram.y" /* yacc.c:1646 */ + case 147: +#line 1636 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3598 "awkgram.c" /* yacc.c:1646 */ +#line 3687 "awkgram.c" /* yacc.c:1646 */ break; - case 143: -#line 1592 "awkgram.y" /* yacc.c:1646 */ + case 148: +#line 1638 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3604 "awkgram.c" /* yacc.c:1646 */ +#line 3693 "awkgram.c" /* yacc.c:1646 */ break; - case 144: -#line 1594 "awkgram.y" /* yacc.c:1646 */ + case 149: +#line 1640 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3610 "awkgram.c" /* yacc.c:1646 */ +#line 3699 "awkgram.c" /* yacc.c:1646 */ break; - case 145: -#line 1596 "awkgram.y" /* yacc.c:1646 */ + case 150: +#line 1642 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3624,29 +3713,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } -#line 3628 "awkgram.c" /* yacc.c:1646 */ +#line 3717 "awkgram.c" /* yacc.c:1646 */ break; - case 146: -#line 1610 "awkgram.y" /* yacc.c:1646 */ + case 151: +#line 1656 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3637 "awkgram.c" /* yacc.c:1646 */ +#line 3726 "awkgram.c" /* yacc.c:1646 */ break; - case 147: -#line 1615 "awkgram.y" /* yacc.c:1646 */ + case 152: +#line 1661 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3646 "awkgram.c" /* yacc.c:1646 */ +#line 3735 "awkgram.c" /* yacc.c:1646 */ break; - case 148: -#line 1620 "awkgram.y" /* yacc.c:1646 */ + case 153: +#line 1666 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { warning_ln((yyvsp[-1])->source_line, @@ -3666,64 +3755,64 @@ regular_print: (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } -#line 3670 "awkgram.c" /* yacc.c:1646 */ +#line 3759 "awkgram.c" /* yacc.c:1646 */ break; - case 149: -#line 1645 "awkgram.y" /* yacc.c:1646 */ + case 154: +#line 1691 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); bcfree((yyvsp[-2])); } -#line 3679 "awkgram.c" /* yacc.c:1646 */ +#line 3768 "awkgram.c" /* yacc.c:1646 */ break; - case 150: -#line 1651 "awkgram.y" /* yacc.c:1646 */ + case 155: +#line 1697 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3685 "awkgram.c" /* yacc.c:1646 */ +#line 3774 "awkgram.c" /* yacc.c:1646 */ break; - case 151: -#line 1653 "awkgram.y" /* yacc.c:1646 */ + case 156: +#line 1699 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3691 "awkgram.c" /* yacc.c:1646 */ +#line 3780 "awkgram.c" /* yacc.c:1646 */ break; - case 152: -#line 1655 "awkgram.y" /* yacc.c:1646 */ + case 157: +#line 1701 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3697 "awkgram.c" /* yacc.c:1646 */ +#line 3786 "awkgram.c" /* yacc.c:1646 */ break; - case 153: -#line 1657 "awkgram.y" /* yacc.c:1646 */ + case 158: +#line 1703 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3703 "awkgram.c" /* yacc.c:1646 */ +#line 3792 "awkgram.c" /* yacc.c:1646 */ break; - case 154: -#line 1659 "awkgram.y" /* yacc.c:1646 */ + case 159: +#line 1705 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3709 "awkgram.c" /* yacc.c:1646 */ +#line 3798 "awkgram.c" /* yacc.c:1646 */ break; - case 155: -#line 1661 "awkgram.y" /* yacc.c:1646 */ + case 160: +#line 1707 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3715 "awkgram.c" /* yacc.c:1646 */ +#line 3804 "awkgram.c" /* yacc.c:1646 */ break; - case 156: -#line 1666 "awkgram.y" /* yacc.c:1646 */ + case 161: +#line 1712 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3723 "awkgram.c" /* yacc.c:1646 */ +#line 3812 "awkgram.c" /* yacc.c:1646 */ break; - case 157: -#line 1670 "awkgram.y" /* yacc.c:1646 */ + case 162: +#line 1716 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->opcode == Op_match_rec) { (yyvsp[0])->opcode = Op_nomatch; @@ -3755,37 +3844,37 @@ regular_print: } } } -#line 3759 "awkgram.c" /* yacc.c:1646 */ +#line 3848 "awkgram.c" /* yacc.c:1646 */ break; - case 158: -#line 1702 "awkgram.y" /* yacc.c:1646 */ + case 163: +#line 1748 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3765 "awkgram.c" /* yacc.c:1646 */ +#line 3854 "awkgram.c" /* yacc.c:1646 */ break; - case 159: -#line 1704 "awkgram.y" /* yacc.c:1646 */ + case 164: +#line 1750 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3775 "awkgram.c" /* yacc.c:1646 */ +#line 3864 "awkgram.c" /* yacc.c:1646 */ break; - case 160: -#line 1710 "awkgram.y" /* yacc.c:1646 */ + case 165: +#line 1756 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3785 "awkgram.c" /* yacc.c:1646 */ +#line 3874 "awkgram.c" /* yacc.c:1646 */ break; - case 161: -#line 1716 "awkgram.y" /* yacc.c:1646 */ + case 166: +#line 1762 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; @@ -3798,45 +3887,45 @@ regular_print: if ((yyval) == NULL) YYABORT; } -#line 3802 "awkgram.c" /* yacc.c:1646 */ +#line 3891 "awkgram.c" /* yacc.c:1646 */ break; - case 164: -#line 1731 "awkgram.y" /* yacc.c:1646 */ + case 169: +#line 1777 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3811 "awkgram.c" /* yacc.c:1646 */ +#line 3900 "awkgram.c" /* yacc.c:1646 */ break; - case 165: -#line 1736 "awkgram.y" /* yacc.c:1646 */ + case 170: +#line 1782 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3820 "awkgram.c" /* yacc.c:1646 */ +#line 3909 "awkgram.c" /* yacc.c:1646 */ break; - case 166: -#line 1741 "awkgram.y" /* yacc.c:1646 */ + case 171: +#line 1787 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3828 "awkgram.c" /* yacc.c:1646 */ +#line 3917 "awkgram.c" /* yacc.c:1646 */ break; - case 167: -#line 1745 "awkgram.y" /* yacc.c:1646 */ + case 172: +#line 1791 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3836 "awkgram.c" /* yacc.c:1646 */ +#line 3925 "awkgram.c" /* yacc.c:1646 */ break; - case 168: -#line 1749 "awkgram.y" /* yacc.c:1646 */ + case 173: +#line 1795 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & STRING) == 0 @@ -3851,11 +3940,11 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3855 "awkgram.c" /* yacc.c:1646 */ +#line 3944 "awkgram.c" /* yacc.c:1646 */ break; - case 169: -#line 1764 "awkgram.y" /* yacc.c:1646 */ + case 174: +#line 1810 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & STRING) == 0 @@ -3873,20 +3962,20 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3877 "awkgram.c" /* yacc.c:1646 */ +#line 3966 "awkgram.c" /* yacc.c:1646 */ break; - case 170: -#line 1785 "awkgram.y" /* yacc.c:1646 */ + case 175: +#line 1831 "awkgram.y" /* yacc.c:1646 */ { func_use((yyvsp[0])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[0]); } -#line 3886 "awkgram.c" /* yacc.c:1646 */ +#line 3975 "awkgram.c" /* yacc.c:1646 */ break; - case 171: -#line 1790 "awkgram.y" /* yacc.c:1646 */ + case 176: +#line 1836 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3920,11 +4009,11 @@ regular_print: (yyval) = list_prepend((yyvsp[0]), t); at_seen = false; } -#line 3924 "awkgram.c" /* yacc.c:1646 */ +#line 4013 "awkgram.c" /* yacc.c:1646 */ break; - case 172: -#line 1827 "awkgram.y" /* yacc.c:1646 */ + case 177: +#line 1873 "awkgram.y" /* yacc.c:1646 */ { NODE *n; @@ -3949,49 +4038,49 @@ regular_print: (yyval) = list_append(t, (yyvsp[-3])); } } -#line 3953 "awkgram.c" /* yacc.c:1646 */ +#line 4042 "awkgram.c" /* yacc.c:1646 */ break; - case 173: -#line 1855 "awkgram.y" /* yacc.c:1646 */ + case 178: +#line 1901 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3959 "awkgram.c" /* yacc.c:1646 */ +#line 4048 "awkgram.c" /* yacc.c:1646 */ break; - case 174: -#line 1857 "awkgram.y" /* yacc.c:1646 */ + case 179: +#line 1903 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3965 "awkgram.c" /* yacc.c:1646 */ +#line 4054 "awkgram.c" /* yacc.c:1646 */ break; - case 175: -#line 1862 "awkgram.y" /* yacc.c:1646 */ + case 180: +#line 1908 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3971 "awkgram.c" /* yacc.c:1646 */ +#line 4060 "awkgram.c" /* yacc.c:1646 */ break; - case 176: -#line 1864 "awkgram.y" /* yacc.c:1646 */ + case 181: +#line 1910 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3977 "awkgram.c" /* yacc.c:1646 */ +#line 4066 "awkgram.c" /* yacc.c:1646 */ break; - case 177: -#line 1869 "awkgram.y" /* yacc.c:1646 */ + case 182: +#line 1915 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3983 "awkgram.c" /* yacc.c:1646 */ +#line 4072 "awkgram.c" /* yacc.c:1646 */ break; - case 178: -#line 1871 "awkgram.y" /* yacc.c:1646 */ + case 183: +#line 1917 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3991 "awkgram.c" /* yacc.c:1646 */ +#line 4080 "awkgram.c" /* yacc.c:1646 */ break; - case 179: -#line 1878 "awkgram.y" /* yacc.c:1646 */ + case 184: +#line 1924 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -4005,11 +4094,11 @@ regular_print: sub_counter++; /* count # of dimensions */ (yyval) = (yyvsp[0]); } -#line 4009 "awkgram.c" /* yacc.c:1646 */ +#line 4098 "awkgram.c" /* yacc.c:1646 */ break; - case 180: -#line 1895 "awkgram.y" /* yacc.c:1646 */ + case 185: +#line 1941 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *t = (yyvsp[-1]); if ((yyvsp[-1]) == NULL) { @@ -4023,31 +4112,31 @@ regular_print: (yyvsp[0])->sub_count = count_expressions(&t, false); (yyval) = list_append(t, (yyvsp[0])); } -#line 4027 "awkgram.c" /* yacc.c:1646 */ +#line 4116 "awkgram.c" /* yacc.c:1646 */ break; - case 181: -#line 1912 "awkgram.y" /* yacc.c:1646 */ + case 186: +#line 1958 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 4033 "awkgram.c" /* yacc.c:1646 */ +#line 4122 "awkgram.c" /* yacc.c:1646 */ break; - case 182: -#line 1914 "awkgram.y" /* yacc.c:1646 */ + case 187: +#line 1960 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 4041 "awkgram.c" /* yacc.c:1646 */ +#line 4130 "awkgram.c" /* yacc.c:1646 */ break; - case 183: -#line 1921 "awkgram.y" /* yacc.c:1646 */ + case 188: +#line 1967 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 4047 "awkgram.c" /* yacc.c:1646 */ +#line 4136 "awkgram.c" /* yacc.c:1646 */ break; - case 184: -#line 1926 "awkgram.y" /* yacc.c:1646 */ + case 189: +#line 1972 "awkgram.y" /* yacc.c:1646 */ { char *var_name = (yyvsp[0])->lextok; @@ -4055,22 +4144,22 @@ regular_print: (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); (yyval) = list_create((yyvsp[0])); } -#line 4059 "awkgram.c" /* yacc.c:1646 */ +#line 4148 "awkgram.c" /* yacc.c:1646 */ break; - case 185: -#line 1934 "awkgram.y" /* yacc.c:1646 */ + case 190: +#line 1980 "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 4070 "awkgram.c" /* yacc.c:1646 */ +#line 4159 "awkgram.c" /* yacc.c:1646 */ break; - case 186: -#line 1944 "awkgram.y" /* yacc.c:1646 */ + case 191: +#line 1990 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push @@ -4082,73 +4171,73 @@ regular_print: } else (yyval) = (yyvsp[0]); } -#line 4086 "awkgram.c" /* yacc.c:1646 */ +#line 4175 "awkgram.c" /* yacc.c:1646 */ break; - case 187: -#line 1956 "awkgram.y" /* yacc.c:1646 */ + case 192: +#line 2002 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); if ((yyvsp[0]) != NULL) mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 4096 "awkgram.c" /* yacc.c:1646 */ +#line 4185 "awkgram.c" /* yacc.c:1646 */ break; - case 188: -#line 1965 "awkgram.y" /* yacc.c:1646 */ + case 193: +#line 2011 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; } -#line 4104 "awkgram.c" /* yacc.c:1646 */ +#line 4193 "awkgram.c" /* yacc.c:1646 */ break; - case 189: -#line 1969 "awkgram.y" /* yacc.c:1646 */ + case 194: +#line 2015 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; } -#line 4112 "awkgram.c" /* yacc.c:1646 */ +#line 4201 "awkgram.c" /* yacc.c:1646 */ break; - case 190: -#line 1972 "awkgram.y" /* yacc.c:1646 */ + case 195: +#line 2018 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 4118 "awkgram.c" /* yacc.c:1646 */ +#line 4207 "awkgram.c" /* yacc.c:1646 */ break; - case 192: -#line 1980 "awkgram.y" /* yacc.c:1646 */ + case 197: +#line 2026 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 4124 "awkgram.c" /* yacc.c:1646 */ +#line 4213 "awkgram.c" /* yacc.c:1646 */ break; - case 193: -#line 1984 "awkgram.y" /* yacc.c:1646 */ + case 198: +#line 2030 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 4130 "awkgram.c" /* yacc.c:1646 */ +#line 4219 "awkgram.c" /* yacc.c:1646 */ break; - case 196: -#line 1993 "awkgram.y" /* yacc.c:1646 */ + case 201: +#line 2039 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 4136 "awkgram.c" /* yacc.c:1646 */ +#line 4225 "awkgram.c" /* yacc.c:1646 */ break; - case 197: -#line 1997 "awkgram.y" /* yacc.c:1646 */ + case 202: +#line 2043 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); yyerrok; } -#line 4142 "awkgram.c" /* yacc.c:1646 */ +#line 4231 "awkgram.c" /* yacc.c:1646 */ break; - case 198: -#line 2001 "awkgram.y" /* yacc.c:1646 */ + case 203: +#line 2047 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 4148 "awkgram.c" /* yacc.c:1646 */ +#line 4237 "awkgram.c" /* yacc.c:1646 */ break; -#line 4152 "awkgram.c" /* yacc.c:1646 */ +#line 4241 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4376,7 +4465,7 @@ yyreturn: #endif return yyresult; } -#line 2003 "awkgram.y" /* yacc.c:1906 */ +#line 2049 "awkgram.y" /* yacc.c:1906 */ struct token { @@ -5712,6 +5801,7 @@ yylex(void) bool inhex = false; bool intlstr = false; AWKNUM d; + bool collecting_typed_regexp = false; #define GET_INSTRUCTION(op) bcalloc(op, 1, sourceline) @@ -5746,7 +5836,7 @@ yylex(void) lexeme = lexptr; thisline = NULL; - +collect_regexp: if (want_regexp) { int in_brack = 0; /* count brackets, [[:alnum:]] allowed */ int b_index = -1; @@ -5833,7 +5923,11 @@ end_regexp: peek); } } - lasttok = REGEXP; + if (collecting_typed_regexp) { + collecting_typed_regexp = false; + lasttok = TYPED_REGEXP; + } else + lasttok = REGEXP; return lasttok; case '\n': @@ -5893,6 +5987,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 = '@'; @@ -6950,6 +7051,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"); @@ -7324,7 +7427,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); @@ -174,7 +174,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 @@ -202,7 +202,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 @@ -513,6 +513,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); } @@ -1252,6 +1274,12 @@ case_value $1->opcode = Op_push; $$ = $1; } + | typed_regexp + { + assert($1->memory->type == Node_typedregex); + $1->opcode = Op_push_re; + $$ = $1; + } ; print @@ -1436,6 +1464,7 @@ fcall_expression_list fcall_exp : exp { $$ = $1; } + | typed_regexp { $$ = list_create($1); } ; /* Expressions, not including the comma operator. */ @@ -1447,10 +1476,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) @@ -3335,6 +3381,7 @@ yylex(void) bool inhex = false; bool intlstr = false; AWKNUM d; + bool collecting_typed_regexp = false; #define GET_INSTRUCTION(op) bcalloc(op, 1, sourceline) @@ -3369,7 +3416,7 @@ yylex(void) lexeme = lexptr; thisline = NULL; - +collect_regexp: if (want_regexp) { int in_brack = 0; /* count brackets, [[:alnum:]] allowed */ int b_index = -1; @@ -3456,7 +3503,11 @@ end_regexp: peek); } } - lasttok = REGEXP; + if (collecting_typed_regexp) { + collecting_typed_regexp = false; + lasttok = TYPED_REGEXP; + } else + lasttok = REGEXP; return lasttok; case '\n': @@ -3516,6 +3567,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 = '@'; @@ -4573,6 +4631,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"); @@ -4947,7 +5007,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", @@ -1327,6 +1328,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 50eea9f2..135f4e58 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; @@ -991,6 +991,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); @@ -639,14 +640,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; @@ -668,6 +672,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, '/'); @@ -1410,6 +1419,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 */ @@ -1453,6 +1469,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 |