summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-11-22 20:30:09 +0200
committerArnold D. Robbins <arnold@skeeve.com>2016-11-22 20:30:09 +0200
commit52715ba9f8510f30368462fee1b1d24bf282b0aa (patch)
tree2b7569bb73d64433f84ccf2672c3973809804b51
parentf7ae9cfb843379b95d8cb44dbb8de7bbf11862de (diff)
parent033faa34a743231a88a6c555503397045726666f (diff)
downloadgawk-52715ba9f8510f30368462fee1b1d24bf282b0aa.tar.gz
Merge branch 'master' into feature/cmake
-rw-r--r--ChangeLog39
-rw-r--r--NEWS17
-rw-r--r--awk.h6
-rw-r--r--awkgram.c2125
-rw-r--r--awkgram.y74
-rw-r--r--builtin.c26
-rw-r--r--debug.c7
-rw-r--r--doc/ChangeLog13
-rw-r--r--doc/gawk.11
-rw-r--r--doc/gawk.info1301
-rw-r--r--doc/gawk.texi150
-rw-r--r--doc/gawktexi.in150
-rw-r--r--doc/wordlist1
-rw-r--r--eval.c1
-rw-r--r--field.c6
-rw-r--r--interpret.h3
-rw-r--r--profile.c36
-rw-r--r--re.c3
-rw-r--r--test/ChangeLog11
-rw-r--r--test/Makefile.am8
-rw-r--r--test/Makefile.in38
-rw-r--r--test/Maketests30
-rw-r--r--test/gsubind.awk9
-rw-r--r--test/gsubind.ok2
-rw-r--r--test/typeof1.awk6
-rw-r--r--test/typeof1.ok3
-rw-r--r--test/typeof3.awk12
-rw-r--r--test/typeof3.ok3
28 files changed, 2318 insertions, 1763 deletions
diff --git a/ChangeLog b/ChangeLog
index d6566363..a2e5d750 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,45 @@
* builtin.c, eval.c, field.c, int_array.c, io.c, main.c,
mpfr.c, node.c: Change all uses.
+2016-11-15 Arnold D. Robbins <arnold@skeeve.com>
+
+ Finish reworking typed regexes.
+
+ * awk.h (typed_re): Replaces tre_reg.
+ * awkgram.y (typed_regexp production): Node_val points to a regular
+ Node_regex and also has string value and length.
+ (make_regnode): Simplified back to its original form.
+ * builtin.c (call_sub, call_match, call_split_func): For REGEX,
+ get n->typed_re.
+ * field.c (do_split, do_patsplit): Ditto, for separator regexp.
+ * profile.c (pprint): Op_match_rec, handle REGEX correctly.
+ * re.c (re_update): If REGEX, get t->typed_re->re_reg.
+
+2016-11-15 Arnold D. Robbins <arnold@skeeve.com>
+
+ Start reworking typed regexes.
+
+ * awk.h (Node_typedregex): Nuked.
+ [REGEX]: New flag.
+ (tre_reg): New member in val part of NODE union.
+ (force_string, force_number, fixtype): Remove use of Node_typedregex.
+ * awkgram.y (grammer): Use REGEX flag instead of node type.
+ (valinfo); Ditto.
+ (make_regnode): Adjust creation based on node type.
+ * builtin.c (do_length, do_print, call_sub, call_match,
+ call_split_func, do_typeof): Adjust code.
+ * debug.c (watchpoint_triggered, initialize_watch_item,
+ print_memory): Adjust code.
+ * eval.c (nodetypes): Remove Node_typedregex.
+ (flags2str): Add REGEX.
+ (setup_frame): Adjust code after removal of Node_typedregex.
+ * interpret.h (r_interpret): Adjust code after removal
+ of Node_typedregex.
+ * profile.c (pp_typed_regex): Renamed from pp_strong_regex.
+ (pp_string_or_strong_regex): Renamed from pp_string_or_strong_regex.
+ (pprint): Adjust code after removal of Node_typedregex.
+ * re.c (re_update): Adjust code after removal of Node_typedregex.
+
2016-11-04 Eli Zaretskii <eliz@gnu.org>
* builtin.c (efwrite) [__MINGW32__]: Call w32_maybe_set_errno if
diff --git a/NEWS b/NEWS
index a06db845..98d99498 100644
--- a/NEWS
+++ b/NEWS
@@ -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%
diff --git a/awk.h b/awk.h
index dcf97bb0..55746927 100644
--- a/awk.h
+++ b/awk.h
@@ -384,6 +384,7 @@ typedef struct exp_node {
int idx;
wchar_t *wsp;
size_t wslen;
+ struct exp_node *typre;
} val;
} sub;
NODETYPE type;
@@ -459,6 +460,7 @@ typedef struct exp_node {
* See cint_array.c */
# define XARRAY 0x10000
# define NUMCONSTSTR 0x20000 /* have string value for numeric constant */
+# define REGEX 0x40000 /* this is a typed regex */
} NODE;
#define vname sub.nodep.name
@@ -507,6 +509,7 @@ typedef struct exp_node {
#else
#define numbr sub.val.fltnum
#endif
+#define typed_re sub.val.typre
/*
* If stfmt is set to STFMT_UNUSED, it means that the string representation
@@ -1872,9 +1875,6 @@ force_number(NODE *n)
* It is safe to assume that the return value will be the same NODE,
* since force_number on a USER_INPUT should always return the same NODE,
* and force_string on an INTIND should as well.
- *
- * There is no way to handle a Node_typedregex correctly, so we ignore
- * that case.
*/
static inline NODE *
diff --git a/awkgram.c b/awkgram.c
index f552d2b9..89eecdbe 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -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, 546, 548, 553,
+ 563, 610, 615, 616, 620, 622, 624, 631, 721, 763,
+ 805, 918, 925, 932, 943, 953, 963, 973, 985, 1002,
+ 1001, 1026, 1038, 1038, 1137, 1137, 1171, 1202, 1211, 1212,
+ 1218, 1219, 1226, 1231, 1243, 1257, 1259, 1267, 1274, 1276,
+ 1284, 1293, 1295, 1304, 1305, 1313, 1318, 1318, 1329, 1333,
+ 1341, 1342, 1345, 1347, 1352, 1353, 1362, 1363, 1368, 1373,
+ 1382, 1384, 1386, 1393, 1394, 1400, 1401, 1406, 1408, 1413,
+ 1415, 1423, 1428, 1437, 1438, 1443, 1445, 1450, 1452, 1460,
+ 1465, 1473, 1474, 1479, 1486, 1490, 1492, 1494, 1507, 1524,
+ 1534, 1541, 1543, 1548, 1550, 1552, 1560, 1562, 1567, 1569,
+ 1574, 1576, 1578, 1634, 1636, 1638, 1640, 1642, 1644, 1646,
+ 1648, 1662, 1667, 1672, 1697, 1703, 1705, 1707, 1709, 1711,
+ 1713, 1718, 1722, 1754, 1756, 1762, 1768, 1781, 1782, 1783,
+ 1788, 1793, 1797, 1801, 1816, 1837, 1842, 1879, 1908, 1909,
+ 1915, 1916, 1921, 1923, 1930, 1947, 1964, 1966, 1973, 1978,
+ 1986, 1996, 2008, 2017, 2021, 2025, 2029, 2033, 2037, 2040,
+ 2042, 2046, 2050, 2054
};
#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,48 @@ 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, *n2;
+ 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_regex, exp);
+ if (n == NULL) {
+ unref(exp);
+ YYABORT;
+ }
+
+ n2 = make_string(re, len);
+ n2->typed_re = n;
+ n2->numbr = 0;
+ n2->flags |= NUMCUR|STRCUR|REGEX;
+ n2->flags &= ~(STRING|NUMBER);
+
+ (yyval) = (yyvsp[0]);
+ (yyval)->opcode = Op_push_re;
+ (yyval)->memory = n2;
+ }
+#line 2303 "awkgram.c" /* yacc.c:1646 */
+ break;
+
+ case 37:
+#line 547 "awkgram.y" /* yacc.c:1646 */
{ bcfree((yyvsp[0])); }
-#line 2254 "awkgram.c" /* yacc.c:1646 */
+#line 2309 "awkgram.c" /* yacc.c:1646 */
break;
- case 38:
-#line 524 "awkgram.y" /* yacc.c:1646 */
+ case 39:
+#line 553 "awkgram.y" /* yacc.c:1646 */
{
if (prior_comment != NULL) {
(yyval) = list_create(prior_comment);
@@ -2265,11 +2320,11 @@ yyreduce:
} else
(yyval) = NULL;
}
-#line 2269 "awkgram.c" /* yacc.c:1646 */
+#line 2324 "awkgram.c" /* yacc.c:1646 */
break;
- case 39:
-#line 535 "awkgram.y" /* yacc.c:1646 */
+ case 40:
+#line 564 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0]) == NULL) {
if (prior_comment != NULL) {
@@ -2316,40 +2371,40 @@ yyreduce:
}
yyerrok;
}
-#line 2320 "awkgram.c" /* yacc.c:1646 */
+#line 2375 "awkgram.c" /* yacc.c:1646 */
break;
- case 40:
-#line 582 "awkgram.y" /* yacc.c:1646 */
+ case 41:
+#line 611 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2326 "awkgram.c" /* yacc.c:1646 */
+#line 2381 "awkgram.c" /* yacc.c:1646 */
break;
- case 43:
-#line 592 "awkgram.y" /* yacc.c:1646 */
+ case 44:
+#line 621 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2332 "awkgram.c" /* yacc.c:1646 */
+#line 2387 "awkgram.c" /* yacc.c:1646 */
break;
- case 44:
-#line 594 "awkgram.y" /* yacc.c:1646 */
+ case 45:
+#line 623 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 2338 "awkgram.c" /* yacc.c:1646 */
+#line 2393 "awkgram.c" /* yacc.c:1646 */
break;
- case 45:
-#line 596 "awkgram.y" /* yacc.c:1646 */
+ case 46:
+#line 625 "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 2404 "awkgram.c" /* yacc.c:1646 */
break;
- case 46:
-#line 603 "awkgram.y" /* yacc.c:1646 */
+ case 47:
+#line 632 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
INSTRUCTION *ip, *nextc, *tbreak;
@@ -2439,11 +2494,11 @@ yyreduce:
break_allowed--;
fix_break_continue(ip, tbreak, NULL);
}
-#line 2443 "awkgram.c" /* yacc.c:1646 */
+#line 2498 "awkgram.c" /* yacc.c:1646 */
break;
- case 47:
-#line 693 "awkgram.y" /* yacc.c:1646 */
+ case 48:
+#line 722 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@ -2485,11 +2540,11 @@ yyreduce:
continue_allowed--;
fix_break_continue(ip, tbreak, tcont);
}
-#line 2489 "awkgram.c" /* yacc.c:1646 */
+#line 2544 "awkgram.c" /* yacc.c:1646 */
break;
- case 48:
-#line 735 "awkgram.y" /* yacc.c:1646 */
+ case 49:
+#line 764 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@ -2531,11 +2586,11 @@ yyreduce:
} /* else
$1 and $4 are NULLs */
}
-#line 2535 "awkgram.c" /* yacc.c:1646 */
+#line 2590 "awkgram.c" /* yacc.c:1646 */
break;
- case 49:
-#line 777 "awkgram.y" /* yacc.c:1646 */
+ case 50:
+#line 806 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip;
char *var_name = (yyvsp[-5])->lextok;
@@ -2648,33 +2703,33 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
-#line 2652 "awkgram.c" /* yacc.c:1646 */
+#line 2707 "awkgram.c" /* yacc.c:1646 */
break;
- case 50:
-#line 890 "awkgram.y" /* yacc.c:1646 */
+ case 51:
+#line 919 "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 2718 "awkgram.c" /* yacc.c:1646 */
break;
- case 51:
-#line 897 "awkgram.y" /* yacc.c:1646 */
+ case 52:
+#line 926 "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 2729 "awkgram.c" /* yacc.c:1646 */
break;
- case 52:
-#line 904 "awkgram.y" /* yacc.c:1646 */
+ case 53:
+#line 933 "awkgram.y" /* yacc.c:1646 */
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count));
@@ -2682,11 +2737,11 @@ regular_loop:
(yyval) = (yyvsp[0]);
(yyval) = add_pending_comment((yyval));
}
-#line 2686 "awkgram.c" /* yacc.c:1646 */
+#line 2741 "awkgram.c" /* yacc.c:1646 */
break;
- case 53:
-#line 915 "awkgram.y" /* yacc.c:1646 */
+ case 54:
+#line 944 "awkgram.y" /* yacc.c:1646 */
{
if (! break_allowed)
error_ln((yyvsp[-1])->source_line,
@@ -2696,11 +2751,11 @@ regular_loop:
(yyval) = add_pending_comment((yyval));
}
-#line 2700 "awkgram.c" /* yacc.c:1646 */
+#line 2755 "awkgram.c" /* yacc.c:1646 */
break;
- case 54:
-#line 925 "awkgram.y" /* yacc.c:1646 */
+ case 55:
+#line 954 "awkgram.y" /* yacc.c:1646 */
{
if (! continue_allowed)
error_ln((yyvsp[-1])->source_line,
@@ -2710,11 +2765,11 @@ regular_loop:
(yyval) = add_pending_comment((yyval));
}
-#line 2714 "awkgram.c" /* yacc.c:1646 */
+#line 2769 "awkgram.c" /* yacc.c:1646 */
break;
- case 55:
-#line 935 "awkgram.y" /* yacc.c:1646 */
+ case 56:
+#line 964 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule && rule != Rule)
@@ -2724,11 +2779,11 @@ regular_loop:
(yyval) = list_create((yyvsp[-1]));
(yyval) = add_pending_comment((yyval));
}
-#line 2728 "awkgram.c" /* yacc.c:1646 */
+#line 2783 "awkgram.c" /* yacc.c:1646 */
break;
- case 56:
-#line 945 "awkgram.y" /* yacc.c:1646 */
+ case 57:
+#line 974 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule == BEGIN || rule == END || rule == ENDFILE)
@@ -2740,11 +2795,11 @@ regular_loop:
(yyval) = list_create((yyvsp[-1]));
(yyval) = add_pending_comment((yyval));
}
-#line 2744 "awkgram.c" /* yacc.c:1646 */
+#line 2799 "awkgram.c" /* yacc.c:1646 */
break;
- case 57:
-#line 957 "awkgram.y" /* yacc.c:1646 */
+ case 58:
+#line 986 "awkgram.y" /* yacc.c:1646 */
{
/* Initialize the two possible jump targets, the actual target
* is resolved at run-time.
@@ -2760,20 +2815,20 @@ regular_loop:
(yyval) = list_append((yyvsp[-1]), (yyvsp[-2]));
(yyval) = add_pending_comment((yyval));
}
-#line 2764 "awkgram.c" /* yacc.c:1646 */
+#line 2819 "awkgram.c" /* yacc.c:1646 */
break;
- case 58:
-#line 973 "awkgram.y" /* yacc.c:1646 */
+ case 59:
+#line 1002 "awkgram.y" /* yacc.c:1646 */
{
if (! in_function)
yyerror(_("`return' used outside function context"));
}
-#line 2773 "awkgram.c" /* yacc.c:1646 */
+#line 2828 "awkgram.c" /* yacc.c:1646 */
break;
- case 59:
-#line 976 "awkgram.y" /* yacc.c:1646 */
+ case 60:
+#line 1005 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) == NULL) {
(yyval) = list_create((yyvsp[-3]));
@@ -2795,17 +2850,17 @@ regular_loop:
}
(yyval) = add_pending_comment((yyval));
}
-#line 2799 "awkgram.c" /* yacc.c:1646 */
+#line 2854 "awkgram.c" /* yacc.c:1646 */
break;
- case 61:
-#line 1009 "awkgram.y" /* yacc.c:1646 */
+ case 62:
+#line 1038 "awkgram.y" /* yacc.c:1646 */
{ in_print = true; in_parens = 0; }
-#line 2805 "awkgram.c" /* yacc.c:1646 */
+#line 2860 "awkgram.c" /* yacc.c:1646 */
break;
- case 62:
-#line 1010 "awkgram.y" /* yacc.c:1646 */
+ case 63:
+#line 1039 "awkgram.y" /* yacc.c:1646 */
{
/*
* Optimization: plain `print' has no expression list, so $3 is null.
@@ -2903,17 +2958,17 @@ regular_print:
}
(yyval) = add_pending_comment((yyval));
}
-#line 2907 "awkgram.c" /* yacc.c:1646 */
+#line 2962 "awkgram.c" /* yacc.c:1646 */
break;
- case 63:
-#line 1108 "awkgram.y" /* yacc.c:1646 */
+ case 64:
+#line 1137 "awkgram.y" /* yacc.c:1646 */
{ sub_counter = 0; }
-#line 2913 "awkgram.c" /* yacc.c:1646 */
+#line 2968 "awkgram.c" /* yacc.c:1646 */
break;
- case 64:
-#line 1109 "awkgram.y" /* yacc.c:1646 */
+ case 65:
+#line 1138 "awkgram.y" /* yacc.c:1646 */
{
char *arr = (yyvsp[-2])->lextok;
@@ -2947,11 +3002,11 @@ regular_print:
}
(yyval) = add_pending_comment((yyval));
}
-#line 2951 "awkgram.c" /* yacc.c:1646 */
+#line 3006 "awkgram.c" /* yacc.c:1646 */
break;
- case 65:
-#line 1147 "awkgram.y" /* yacc.c:1646 */
+ case 66:
+#line 1176 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
char *arr = (yyvsp[-1])->lextok;
@@ -2978,55 +3033,55 @@ regular_print:
}
(yyval) = add_pending_comment((yyval));
}
-#line 2982 "awkgram.c" /* yacc.c:1646 */
+#line 3037 "awkgram.c" /* yacc.c:1646 */
break;
- case 66:
-#line 1174 "awkgram.y" /* yacc.c:1646 */
+ case 67:
+#line 1203 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = optimize_assignment((yyvsp[0]));
(yyval) = add_pending_comment((yyval));
}
-#line 2991 "awkgram.c" /* yacc.c:1646 */
+#line 3046 "awkgram.c" /* yacc.c:1646 */
break;
- case 67:
-#line 1182 "awkgram.y" /* yacc.c:1646 */
+ case 68:
+#line 1211 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2997 "awkgram.c" /* yacc.c:1646 */
+#line 3052 "awkgram.c" /* yacc.c:1646 */
break;
- case 68:
-#line 1184 "awkgram.y" /* yacc.c:1646 */
+ case 69:
+#line 1213 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3003 "awkgram.c" /* yacc.c:1646 */
+#line 3058 "awkgram.c" /* yacc.c:1646 */
break;
- case 69:
-#line 1189 "awkgram.y" /* yacc.c:1646 */
+ case 70:
+#line 1218 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3009 "awkgram.c" /* yacc.c:1646 */
+#line 3064 "awkgram.c" /* yacc.c:1646 */
break;
- case 70:
-#line 1191 "awkgram.y" /* yacc.c:1646 */
+ case 71:
+#line 1220 "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 3075 "awkgram.c" /* yacc.c:1646 */
break;
- case 71:
-#line 1198 "awkgram.y" /* yacc.c:1646 */
+ case 72:
+#line 1227 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3026 "awkgram.c" /* yacc.c:1646 */
+#line 3081 "awkgram.c" /* yacc.c:1646 */
break;
- case 72:
-#line 1203 "awkgram.y" /* yacc.c:1646 */
+ case 73:
+#line 1232 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -3038,11 +3093,11 @@ regular_print:
bcfree((yyvsp[-2]));
(yyval) = (yyvsp[-4]);
}
-#line 3042 "awkgram.c" /* yacc.c:1646 */
+#line 3097 "awkgram.c" /* yacc.c:1646 */
break;
- case 73:
-#line 1215 "awkgram.y" /* yacc.c:1646 */
+ case 74:
+#line 1244 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -3053,17 +3108,17 @@ regular_print:
(yyvsp[-3])->case_stmt = casestmt;
(yyval) = (yyvsp[-3]);
}
-#line 3057 "awkgram.c" /* yacc.c:1646 */
+#line 3112 "awkgram.c" /* yacc.c:1646 */
break;
- case 74:
-#line 1229 "awkgram.y" /* yacc.c:1646 */
+ case 75:
+#line 1258 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3063 "awkgram.c" /* yacc.c:1646 */
+#line 3118 "awkgram.c" /* yacc.c:1646 */
break;
- case 75:
-#line 1231 "awkgram.y" /* yacc.c:1646 */
+ case 76:
+#line 1260 "awkgram.y" /* yacc.c:1646 */
{
NODE *n = (yyvsp[0])->memory;
(void) force_number(n);
@@ -3071,28 +3126,28 @@ regular_print:
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3075 "awkgram.c" /* yacc.c:1646 */
+#line 3130 "awkgram.c" /* yacc.c:1646 */
break;
- case 76:
-#line 1239 "awkgram.y" /* yacc.c:1646 */
+ case 77:
+#line 1268 "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 3141 "awkgram.c" /* yacc.c:1646 */
break;
- case 77:
-#line 1246 "awkgram.y" /* yacc.c:1646 */
+ case 78:
+#line 1275 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3092 "awkgram.c" /* yacc.c:1646 */
+#line 3147 "awkgram.c" /* yacc.c:1646 */
break;
- case 78:
-#line 1248 "awkgram.y" /* yacc.c:1646 */
+ case 79:
+#line 1277 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->memory->type == Node_regex)
(yyvsp[0])->opcode = Op_push_re;
@@ -3100,47 +3155,57 @@ regular_print:
(yyvsp[0])->opcode = Op_push;
(yyval) = (yyvsp[0]);
}
-#line 3104 "awkgram.c" /* yacc.c:1646 */
+#line 3159 "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 1285 "awkgram.y" /* yacc.c:1646 */
+ {
+ assert(((yyvsp[0])->memory->flags & REGEX) == REGEX);
+ (yyvsp[0])->opcode = Op_push_re;
+ (yyval) = (yyvsp[0]);
+ }
+#line 3169 "awkgram.c" /* yacc.c:1646 */
break;
- case 80:
-#line 1261 "awkgram.y" /* yacc.c:1646 */
+ case 81:
+#line 1294 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3116 "awkgram.c" /* yacc.c:1646 */
+#line 3175 "awkgram.c" /* yacc.c:1646 */
break;
case 82:
-#line 1271 "awkgram.y" /* yacc.c:1646 */
+#line 1296 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = (yyvsp[0]); }
+#line 3181 "awkgram.c" /* yacc.c:1646 */
+ break;
+
+ case 84:
+#line 1306 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = (yyvsp[-1]);
}
-#line 3124 "awkgram.c" /* yacc.c:1646 */
+#line 3189 "awkgram.c" /* yacc.c:1646 */
break;
- case 83:
-#line 1278 "awkgram.y" /* yacc.c:1646 */
+ case 85:
+#line 1313 "awkgram.y" /* yacc.c:1646 */
{
in_print = false;
in_parens = 0;
(yyval) = NULL;
}
-#line 3134 "awkgram.c" /* yacc.c:1646 */
+#line 3199 "awkgram.c" /* yacc.c:1646 */
break;
- case 84:
-#line 1283 "awkgram.y" /* yacc.c:1646 */
+ case 86:
+#line 1318 "awkgram.y" /* yacc.c:1646 */
{ in_print = false; in_parens = 0; }
-#line 3140 "awkgram.c" /* yacc.c:1646 */
+#line 3205 "awkgram.c" /* yacc.c:1646 */
break;
- case 85:
-#line 1284 "awkgram.y" /* yacc.c:1646 */
+ case 87:
+#line 1319 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->redir_type == redirect_twoway
&& (yyvsp[0])->lasti->opcode == Op_K_getline_redir
@@ -3148,63 +3213,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 3217 "awkgram.c" /* yacc.c:1646 */
break;
- case 86:
-#line 1295 "awkgram.y" /* yacc.c:1646 */
+ case 88:
+#line 1330 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL);
}
-#line 3160 "awkgram.c" /* yacc.c:1646 */
+#line 3225 "awkgram.c" /* yacc.c:1646 */
break;
- case 87:
-#line 1300 "awkgram.y" /* yacc.c:1646 */
+ case 89:
+#line 1335 "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 3233 "awkgram.c" /* yacc.c:1646 */
break;
- case 92:
-#line 1317 "awkgram.y" /* yacc.c:1646 */
+ case 94:
+#line 1352 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3174 "awkgram.c" /* yacc.c:1646 */
+#line 3239 "awkgram.c" /* yacc.c:1646 */
break;
- case 93:
-#line 1319 "awkgram.y" /* yacc.c:1646 */
+ case 95:
+#line 1354 "awkgram.y" /* yacc.c:1646 */
{
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3183 "awkgram.c" /* yacc.c:1646 */
+#line 3248 "awkgram.c" /* yacc.c:1646 */
break;
- case 94:
-#line 1327 "awkgram.y" /* yacc.c:1646 */
+ case 96:
+#line 1362 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3189 "awkgram.c" /* yacc.c:1646 */
+#line 3254 "awkgram.c" /* yacc.c:1646 */
break;
- case 95:
-#line 1329 "awkgram.y" /* yacc.c:1646 */
+ case 97:
+#line 1364 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3195 "awkgram.c" /* yacc.c:1646 */
+#line 3260 "awkgram.c" /* yacc.c:1646 */
break;
- case 96:
-#line 1334 "awkgram.y" /* yacc.c:1646 */
+ case 98:
+#line 1369 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->param_count = 0;
(yyval) = list_create((yyvsp[0]));
}
-#line 3204 "awkgram.c" /* yacc.c:1646 */
+#line 3269 "awkgram.c" /* yacc.c:1646 */
break;
- case 97:
-#line 1339 "awkgram.y" /* yacc.c:1646 */
+ case 99:
+#line 1374 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2]) != NULL && (yyvsp[0]) != NULL) {
(yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1;
@@ -3213,74 +3278,74 @@ regular_print:
} else
(yyval) = NULL;
}
-#line 3217 "awkgram.c" /* yacc.c:1646 */
+#line 3282 "awkgram.c" /* yacc.c:1646 */
break;
- case 98:
-#line 1348 "awkgram.y" /* yacc.c:1646 */
+ case 100:
+#line 1383 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3223 "awkgram.c" /* yacc.c:1646 */
+#line 3288 "awkgram.c" /* yacc.c:1646 */
break;
- case 99:
-#line 1350 "awkgram.y" /* yacc.c:1646 */
+ case 101:
+#line 1385 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3229 "awkgram.c" /* yacc.c:1646 */
+#line 3294 "awkgram.c" /* yacc.c:1646 */
break;
- case 100:
-#line 1352 "awkgram.y" /* yacc.c:1646 */
+ case 102:
+#line 1387 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-2]); }
-#line 3235 "awkgram.c" /* yacc.c:1646 */
+#line 3300 "awkgram.c" /* yacc.c:1646 */
break;
- case 101:
-#line 1358 "awkgram.y" /* yacc.c:1646 */
+ case 103:
+#line 1393 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3241 "awkgram.c" /* yacc.c:1646 */
+#line 3306 "awkgram.c" /* yacc.c:1646 */
break;
- case 102:
-#line 1360 "awkgram.y" /* yacc.c:1646 */
+ case 104:
+#line 1395 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3247 "awkgram.c" /* yacc.c:1646 */
+#line 3312 "awkgram.c" /* yacc.c:1646 */
break;
- case 103:
-#line 1365 "awkgram.y" /* yacc.c:1646 */
+ case 105:
+#line 1400 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3253 "awkgram.c" /* yacc.c:1646 */
+#line 3318 "awkgram.c" /* yacc.c:1646 */
break;
- case 104:
-#line 1367 "awkgram.y" /* yacc.c:1646 */
+ case 106:
+#line 1402 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3259 "awkgram.c" /* yacc.c:1646 */
+#line 3324 "awkgram.c" /* yacc.c:1646 */
break;
- case 105:
-#line 1372 "awkgram.y" /* yacc.c:1646 */
+ case 107:
+#line 1407 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3265 "awkgram.c" /* yacc.c:1646 */
+#line 3330 "awkgram.c" /* yacc.c:1646 */
break;
- case 106:
-#line 1374 "awkgram.y" /* yacc.c:1646 */
+ case 108:
+#line 1409 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3274 "awkgram.c" /* yacc.c:1646 */
+#line 3339 "awkgram.c" /* yacc.c:1646 */
break;
- case 107:
-#line 1379 "awkgram.y" /* yacc.c:1646 */
+ case 109:
+#line 1414 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3280 "awkgram.c" /* yacc.c:1646 */
+#line 3345 "awkgram.c" /* yacc.c:1646 */
break;
- case 108:
-#line 1381 "awkgram.y" /* yacc.c:1646 */
+ case 110:
+#line 1416 "awkgram.y" /* yacc.c:1646 */
{
/*
* Returning the expression list instead of NULL lets
@@ -3288,62 +3353,62 @@ regular_print:
*/
(yyval) = (yyvsp[-1]);
}
-#line 3292 "awkgram.c" /* yacc.c:1646 */
+#line 3357 "awkgram.c" /* yacc.c:1646 */
break;
- case 109:
-#line 1389 "awkgram.y" /* yacc.c:1646 */
+ case 111:
+#line 1424 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3301 "awkgram.c" /* yacc.c:1646 */
+#line 3366 "awkgram.c" /* yacc.c:1646 */
break;
- case 110:
-#line 1394 "awkgram.y" /* yacc.c:1646 */
+ case 112:
+#line 1429 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = (yyvsp[-2]);
}
-#line 3310 "awkgram.c" /* yacc.c:1646 */
+#line 3375 "awkgram.c" /* yacc.c:1646 */
break;
- case 111:
-#line 1402 "awkgram.y" /* yacc.c:1646 */
+ case 113:
+#line 1437 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3316 "awkgram.c" /* yacc.c:1646 */
+#line 3381 "awkgram.c" /* yacc.c:1646 */
break;
- case 112:
-#line 1404 "awkgram.y" /* yacc.c:1646 */
+ case 114:
+#line 1439 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3322 "awkgram.c" /* yacc.c:1646 */
+#line 3387 "awkgram.c" /* yacc.c:1646 */
break;
- case 113:
-#line 1409 "awkgram.y" /* yacc.c:1646 */
+ case 115:
+#line 1444 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3328 "awkgram.c" /* yacc.c:1646 */
+#line 3393 "awkgram.c" /* yacc.c:1646 */
break;
- case 114:
-#line 1411 "awkgram.y" /* yacc.c:1646 */
+ case 116:
+#line 1446 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3337 "awkgram.c" /* yacc.c:1646 */
+#line 3402 "awkgram.c" /* yacc.c:1646 */
break;
- case 115:
-#line 1416 "awkgram.y" /* yacc.c:1646 */
+ case 117:
+#line 1451 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3343 "awkgram.c" /* yacc.c:1646 */
+#line 3408 "awkgram.c" /* yacc.c:1646 */
break;
- case 116:
-#line 1418 "awkgram.y" /* yacc.c:1646 */
+ case 118:
+#line 1453 "awkgram.y" /* yacc.c:1646 */
{
/*
* Returning the expression list instead of NULL lets
@@ -3351,58 +3416,89 @@ regular_print:
*/
(yyval) = (yyvsp[-1]);
}
-#line 3355 "awkgram.c" /* yacc.c:1646 */
+#line 3420 "awkgram.c" /* yacc.c:1646 */
break;
- case 117:
-#line 1426 "awkgram.y" /* yacc.c:1646 */
+ case 119:
+#line 1461 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3364 "awkgram.c" /* yacc.c:1646 */
+#line 3429 "awkgram.c" /* yacc.c:1646 */
break;
- case 118:
-#line 1431 "awkgram.y" /* yacc.c:1646 */
+ case 120:
+#line 1466 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = (yyvsp[-2]);
}
-#line 3373 "awkgram.c" /* yacc.c:1646 */
+#line 3438 "awkgram.c" /* yacc.c:1646 */
break;
- case 119:
-#line 1438 "awkgram.y" /* yacc.c:1646 */
+ case 121:
+#line 1473 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3379 "awkgram.c" /* yacc.c:1646 */
+#line 3444 "awkgram.c" /* yacc.c:1646 */
break;
- case 120:
-#line 1444 "awkgram.y" /* yacc.c:1646 */
+ case 122:
+#line 1474 "awkgram.y" /* yacc.c:1646 */
+ { (yyval) = list_create((yyvsp[0])); }
+#line 3450 "awkgram.c" /* yacc.c:1646 */
+ break;
+
+ case 123:
+#line 1480 "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 3461 "awkgram.c" /* yacc.c:1646 */
break;
- case 121:
-#line 1451 "awkgram.y" /* yacc.c:1646 */
+ case 124:
+#line 1487 "awkgram.y" /* yacc.c:1646 */
+ {
+ (yyval) = mk_assignment((yyvsp[-2]), list_create((yyvsp[0])), (yyvsp[-1]));
+ }
+#line 3469 "awkgram.c" /* yacc.c:1646 */
+ break;
+
+ case 125:
+#line 1491 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3396 "awkgram.c" /* yacc.c:1646 */
+#line 3475 "awkgram.c" /* yacc.c:1646 */
break;
- case 122:
-#line 1453 "awkgram.y" /* yacc.c:1646 */
+ case 126:
+#line 1493 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3402 "awkgram.c" /* yacc.c:1646 */
+#line 3481 "awkgram.c" /* yacc.c:1646 */
break;
- case 123:
-#line 1455 "awkgram.y" /* yacc.c:1646 */
+ case 127:
+#line 1495 "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->flags & REGEX) != 0);
+ /* RHS is @/.../ */
+ (yyvsp[-1])->memory = (yyvsp[0])->memory;
+ bcfree((yyvsp[0]));
+ (yyval) = list_append((yyvsp[-2]), (yyvsp[-1]));
+ }
+#line 3498 "awkgram.c" /* yacc.c:1646 */
+ break;
+
+ case 128:
+#line 1508 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[-1])->source_line,
@@ -3419,11 +3515,11 @@ regular_print:
(yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1]));
}
}
-#line 3423 "awkgram.c" /* yacc.c:1646 */
+#line 3519 "awkgram.c" /* yacc.c:1646 */
break;
- case 124:
-#line 1472 "awkgram.y" /* yacc.c:1646 */
+ case 129:
+#line 1525 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old)
warning_ln((yyvsp[-1])->source_line,
@@ -3433,91 +3529,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 3533 "awkgram.c" /* yacc.c:1646 */
break;
- case 125:
-#line 1482 "awkgram.y" /* yacc.c:1646 */
+ case 130:
+#line 1535 "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 3544 "awkgram.c" /* yacc.c:1646 */
break;
- case 126:
-#line 1489 "awkgram.y" /* yacc.c:1646 */
+ case 131:
+#line 1542 "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 3550 "awkgram.c" /* yacc.c:1646 */
break;
- case 127:
-#line 1491 "awkgram.y" /* yacc.c:1646 */
+ case 132:
+#line 1544 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3460 "awkgram.c" /* yacc.c:1646 */
+#line 3556 "awkgram.c" /* yacc.c:1646 */
break;
- case 128:
-#line 1496 "awkgram.y" /* yacc.c:1646 */
+ case 133:
+#line 1549 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3466 "awkgram.c" /* yacc.c:1646 */
+#line 3562 "awkgram.c" /* yacc.c:1646 */
break;
- case 129:
-#line 1498 "awkgram.y" /* yacc.c:1646 */
+ case 134:
+#line 1551 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3472 "awkgram.c" /* yacc.c:1646 */
+#line 3568 "awkgram.c" /* yacc.c:1646 */
break;
- case 130:
-#line 1500 "awkgram.y" /* yacc.c:1646 */
+ case 135:
+#line 1553 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_assign_quotient;
(yyval) = (yyvsp[0]);
}
-#line 3481 "awkgram.c" /* yacc.c:1646 */
+#line 3577 "awkgram.c" /* yacc.c:1646 */
break;
- case 131:
-#line 1508 "awkgram.y" /* yacc.c:1646 */
+ case 136:
+#line 1561 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3487 "awkgram.c" /* yacc.c:1646 */
+#line 3583 "awkgram.c" /* yacc.c:1646 */
break;
- case 132:
-#line 1510 "awkgram.y" /* yacc.c:1646 */
+ case 137:
+#line 1563 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3493 "awkgram.c" /* yacc.c:1646 */
+#line 3589 "awkgram.c" /* yacc.c:1646 */
break;
- case 133:
-#line 1515 "awkgram.y" /* yacc.c:1646 */
+ case 138:
+#line 1568 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3499 "awkgram.c" /* yacc.c:1646 */
+#line 3595 "awkgram.c" /* yacc.c:1646 */
break;
- case 134:
-#line 1517 "awkgram.y" /* yacc.c:1646 */
+ case 139:
+#line 1570 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3505 "awkgram.c" /* yacc.c:1646 */
+#line 3601 "awkgram.c" /* yacc.c:1646 */
break;
- case 135:
-#line 1522 "awkgram.y" /* yacc.c:1646 */
+ case 140:
+#line 1575 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3511 "awkgram.c" /* yacc.c:1646 */
+#line 3607 "awkgram.c" /* yacc.c:1646 */
break;
- case 136:
-#line 1524 "awkgram.y" /* yacc.c:1646 */
+ case 141:
+#line 1577 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3517 "awkgram.c" /* yacc.c:1646 */
+#line 3613 "awkgram.c" /* yacc.c:1646 */
break;
- case 137:
-#line 1526 "awkgram.y" /* yacc.c:1646 */
+ case 142:
+#line 1579 "awkgram.y" /* yacc.c:1646 */
{
int count = 2;
bool is_simple_var = false;
@@ -3570,47 +3666,47 @@ regular_print:
max_args = count;
}
}
-#line 3574 "awkgram.c" /* yacc.c:1646 */
+#line 3670 "awkgram.c" /* yacc.c:1646 */
break;
- case 139:
-#line 1584 "awkgram.y" /* yacc.c:1646 */
+ case 144:
+#line 1637 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3580 "awkgram.c" /* yacc.c:1646 */
+#line 3676 "awkgram.c" /* yacc.c:1646 */
break;
- case 140:
-#line 1586 "awkgram.y" /* yacc.c:1646 */
+ case 145:
+#line 1639 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3586 "awkgram.c" /* yacc.c:1646 */
+#line 3682 "awkgram.c" /* yacc.c:1646 */
break;
- case 141:
-#line 1588 "awkgram.y" /* yacc.c:1646 */
+ case 146:
+#line 1641 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3592 "awkgram.c" /* yacc.c:1646 */
+#line 3688 "awkgram.c" /* yacc.c:1646 */
break;
- case 142:
-#line 1590 "awkgram.y" /* yacc.c:1646 */
+ case 147:
+#line 1643 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3598 "awkgram.c" /* yacc.c:1646 */
+#line 3694 "awkgram.c" /* yacc.c:1646 */
break;
- case 143:
-#line 1592 "awkgram.y" /* yacc.c:1646 */
+ case 148:
+#line 1645 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3604 "awkgram.c" /* yacc.c:1646 */
+#line 3700 "awkgram.c" /* yacc.c:1646 */
break;
- case 144:
-#line 1594 "awkgram.y" /* yacc.c:1646 */
+ case 149:
+#line 1647 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3610 "awkgram.c" /* yacc.c:1646 */
+#line 3706 "awkgram.c" /* yacc.c:1646 */
break;
- case 145:
-#line 1596 "awkgram.y" /* yacc.c:1646 */
+ case 150:
+#line 1649 "awkgram.y" /* yacc.c:1646 */
{
/*
* In BEGINFILE/ENDFILE, allow `getline [var] < file'
@@ -3624,29 +3720,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 3724 "awkgram.c" /* yacc.c:1646 */
break;
- case 146:
-#line 1610 "awkgram.y" /* yacc.c:1646 */
+ case 151:
+#line 1663 "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 3733 "awkgram.c" /* yacc.c:1646 */
break;
- case 147:
-#line 1615 "awkgram.y" /* yacc.c:1646 */
+ case 152:
+#line 1668 "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 3742 "awkgram.c" /* yacc.c:1646 */
break;
- case 148:
-#line 1620 "awkgram.y" /* yacc.c:1646 */
+ case 153:
+#line 1673 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old) {
warning_ln((yyvsp[-1])->source_line,
@@ -3666,64 +3762,64 @@ regular_print:
(yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1]));
}
}
-#line 3670 "awkgram.c" /* yacc.c:1646 */
+#line 3766 "awkgram.c" /* yacc.c:1646 */
break;
- case 149:
-#line 1645 "awkgram.y" /* yacc.c:1646 */
+ case 154:
+#line 1698 "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 3775 "awkgram.c" /* yacc.c:1646 */
break;
- case 150:
-#line 1651 "awkgram.y" /* yacc.c:1646 */
+ case 155:
+#line 1704 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3685 "awkgram.c" /* yacc.c:1646 */
+#line 3781 "awkgram.c" /* yacc.c:1646 */
break;
- case 151:
-#line 1653 "awkgram.y" /* yacc.c:1646 */
+ case 156:
+#line 1706 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3691 "awkgram.c" /* yacc.c:1646 */
+#line 3787 "awkgram.c" /* yacc.c:1646 */
break;
- case 152:
-#line 1655 "awkgram.y" /* yacc.c:1646 */
+ case 157:
+#line 1708 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3697 "awkgram.c" /* yacc.c:1646 */
+#line 3793 "awkgram.c" /* yacc.c:1646 */
break;
- case 153:
-#line 1657 "awkgram.y" /* yacc.c:1646 */
+ case 158:
+#line 1710 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3703 "awkgram.c" /* yacc.c:1646 */
+#line 3799 "awkgram.c" /* yacc.c:1646 */
break;
- case 154:
-#line 1659 "awkgram.y" /* yacc.c:1646 */
+ case 159:
+#line 1712 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3709 "awkgram.c" /* yacc.c:1646 */
+#line 3805 "awkgram.c" /* yacc.c:1646 */
break;
- case 155:
-#line 1661 "awkgram.y" /* yacc.c:1646 */
+ case 160:
+#line 1714 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3715 "awkgram.c" /* yacc.c:1646 */
+#line 3811 "awkgram.c" /* yacc.c:1646 */
break;
- case 156:
-#line 1666 "awkgram.y" /* yacc.c:1646 */
+ case 161:
+#line 1719 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3723 "awkgram.c" /* yacc.c:1646 */
+#line 3819 "awkgram.c" /* yacc.c:1646 */
break;
- case 157:
-#line 1670 "awkgram.y" /* yacc.c:1646 */
+ case 162:
+#line 1723 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->opcode == Op_match_rec) {
(yyvsp[0])->opcode = Op_nomatch;
@@ -3755,37 +3851,37 @@ regular_print:
}
}
}
-#line 3759 "awkgram.c" /* yacc.c:1646 */
+#line 3855 "awkgram.c" /* yacc.c:1646 */
break;
- case 158:
-#line 1702 "awkgram.y" /* yacc.c:1646 */
+ case 163:
+#line 1755 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3765 "awkgram.c" /* yacc.c:1646 */
+#line 3861 "awkgram.c" /* yacc.c:1646 */
break;
- case 159:
-#line 1704 "awkgram.y" /* yacc.c:1646 */
+ case 164:
+#line 1757 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3775 "awkgram.c" /* yacc.c:1646 */
+#line 3871 "awkgram.c" /* yacc.c:1646 */
break;
- case 160:
-#line 1710 "awkgram.y" /* yacc.c:1646 */
+ case 165:
+#line 1763 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3785 "awkgram.c" /* yacc.c:1646 */
+#line 3881 "awkgram.c" /* yacc.c:1646 */
break;
- case 161:
-#line 1716 "awkgram.y" /* yacc.c:1646 */
+ case 166:
+#line 1769 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
@@ -3798,45 +3894,45 @@ regular_print:
if ((yyval) == NULL)
YYABORT;
}
-#line 3802 "awkgram.c" /* yacc.c:1646 */
+#line 3898 "awkgram.c" /* yacc.c:1646 */
break;
- case 164:
-#line 1731 "awkgram.y" /* yacc.c:1646 */
+ case 169:
+#line 1784 "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 3907 "awkgram.c" /* yacc.c:1646 */
break;
- case 165:
-#line 1736 "awkgram.y" /* yacc.c:1646 */
+ case 170:
+#line 1789 "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 3916 "awkgram.c" /* yacc.c:1646 */
break;
- case 166:
-#line 1741 "awkgram.y" /* yacc.c:1646 */
+ case 171:
+#line 1794 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3828 "awkgram.c" /* yacc.c:1646 */
+#line 3924 "awkgram.c" /* yacc.c:1646 */
break;
- case 167:
-#line 1745 "awkgram.y" /* yacc.c:1646 */
+ case 172:
+#line 1798 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3836 "awkgram.c" /* yacc.c:1646 */
+#line 3932 "awkgram.c" /* yacc.c:1646 */
break;
- case 168:
-#line 1749 "awkgram.y" /* yacc.c:1646 */
+ case 173:
+#line 1802 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->lasti->opcode == Op_push_i
&& ((yyvsp[0])->lasti->memory->flags & STRING) == 0
@@ -3851,11 +3947,11 @@ regular_print:
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
}
-#line 3855 "awkgram.c" /* yacc.c:1646 */
+#line 3951 "awkgram.c" /* yacc.c:1646 */
break;
- case 169:
-#line 1764 "awkgram.y" /* yacc.c:1646 */
+ case 174:
+#line 1817 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->lasti->opcode == Op_push_i
&& ((yyvsp[0])->lasti->memory->flags & STRING) == 0
@@ -3873,20 +3969,20 @@ regular_print:
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
}
-#line 3877 "awkgram.c" /* yacc.c:1646 */
+#line 3973 "awkgram.c" /* yacc.c:1646 */
break;
- case 170:
-#line 1785 "awkgram.y" /* yacc.c:1646 */
+ case 175:
+#line 1838 "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 3982 "awkgram.c" /* yacc.c:1646 */
break;
- case 171:
-#line 1790 "awkgram.y" /* yacc.c:1646 */
+ case 176:
+#line 1843 "awkgram.y" /* yacc.c:1646 */
{
/* indirect function call */
INSTRUCTION *f, *t;
@@ -3920,11 +4016,11 @@ regular_print:
(yyval) = list_prepend((yyvsp[0]), t);
at_seen = false;
}
-#line 3924 "awkgram.c" /* yacc.c:1646 */
+#line 4020 "awkgram.c" /* yacc.c:1646 */
break;
- case 172:
-#line 1827 "awkgram.y" /* yacc.c:1646 */
+ case 177:
+#line 1880 "awkgram.y" /* yacc.c:1646 */
{
NODE *n;
@@ -3949,49 +4045,49 @@ regular_print:
(yyval) = list_append(t, (yyvsp[-3]));
}
}
-#line 3953 "awkgram.c" /* yacc.c:1646 */
+#line 4049 "awkgram.c" /* yacc.c:1646 */
break;
- case 173:
-#line 1855 "awkgram.y" /* yacc.c:1646 */
+ case 178:
+#line 1908 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3959 "awkgram.c" /* yacc.c:1646 */
+#line 4055 "awkgram.c" /* yacc.c:1646 */
break;
- case 174:
-#line 1857 "awkgram.y" /* yacc.c:1646 */
+ case 179:
+#line 1910 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3965 "awkgram.c" /* yacc.c:1646 */
+#line 4061 "awkgram.c" /* yacc.c:1646 */
break;
- case 175:
-#line 1862 "awkgram.y" /* yacc.c:1646 */
+ case 180:
+#line 1915 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3971 "awkgram.c" /* yacc.c:1646 */
+#line 4067 "awkgram.c" /* yacc.c:1646 */
break;
- case 176:
-#line 1864 "awkgram.y" /* yacc.c:1646 */
+ case 181:
+#line 1917 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3977 "awkgram.c" /* yacc.c:1646 */
+#line 4073 "awkgram.c" /* yacc.c:1646 */
break;
- case 177:
-#line 1869 "awkgram.y" /* yacc.c:1646 */
+ case 182:
+#line 1922 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3983 "awkgram.c" /* yacc.c:1646 */
+#line 4079 "awkgram.c" /* yacc.c:1646 */
break;
- case 178:
-#line 1871 "awkgram.y" /* yacc.c:1646 */
+ case 183:
+#line 1924 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 3991 "awkgram.c" /* yacc.c:1646 */
+#line 4087 "awkgram.c" /* yacc.c:1646 */
break;
- case 179:
-#line 1878 "awkgram.y" /* yacc.c:1646 */
+ case 184:
+#line 1931 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = (yyvsp[0])->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated expressions */
@@ -4005,11 +4101,11 @@ regular_print:
sub_counter++; /* count # of dimensions */
(yyval) = (yyvsp[0]);
}
-#line 4009 "awkgram.c" /* yacc.c:1646 */
+#line 4105 "awkgram.c" /* yacc.c:1646 */
break;
- case 180:
-#line 1895 "awkgram.y" /* yacc.c:1646 */
+ case 185:
+#line 1948 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *t = (yyvsp[-1]);
if ((yyvsp[-1]) == NULL) {
@@ -4023,31 +4119,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 4123 "awkgram.c" /* yacc.c:1646 */
break;
- case 181:
-#line 1912 "awkgram.y" /* yacc.c:1646 */
+ case 186:
+#line 1965 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 4033 "awkgram.c" /* yacc.c:1646 */
+#line 4129 "awkgram.c" /* yacc.c:1646 */
break;
- case 182:
-#line 1914 "awkgram.y" /* yacc.c:1646 */
+ case 187:
+#line 1967 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 4041 "awkgram.c" /* yacc.c:1646 */
+#line 4137 "awkgram.c" /* yacc.c:1646 */
break;
- case 183:
-#line 1921 "awkgram.y" /* yacc.c:1646 */
+ case 188:
+#line 1974 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 4047 "awkgram.c" /* yacc.c:1646 */
+#line 4143 "awkgram.c" /* yacc.c:1646 */
break;
- case 184:
-#line 1926 "awkgram.y" /* yacc.c:1646 */
+ case 189:
+#line 1979 "awkgram.y" /* yacc.c:1646 */
{
char *var_name = (yyvsp[0])->lextok;
@@ -4055,22 +4151,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 4155 "awkgram.c" /* yacc.c:1646 */
break;
- case 185:
-#line 1934 "awkgram.y" /* yacc.c:1646 */
+ case 190:
+#line 1987 "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 4166 "awkgram.c" /* yacc.c:1646 */
break;
- case 186:
-#line 1944 "awkgram.y" /* yacc.c:1646 */
+ case 191:
+#line 1997 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = (yyvsp[0])->nexti;
if (ip->opcode == Op_push
@@ -4082,73 +4178,73 @@ regular_print:
} else
(yyval) = (yyvsp[0]);
}
-#line 4086 "awkgram.c" /* yacc.c:1646 */
+#line 4182 "awkgram.c" /* yacc.c:1646 */
break;
- case 187:
-#line 1956 "awkgram.y" /* yacc.c:1646 */
+ case 192:
+#line 2009 "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 4192 "awkgram.c" /* yacc.c:1646 */
break;
- case 188:
-#line 1965 "awkgram.y" /* yacc.c:1646 */
+ case 193:
+#line 2018 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postincrement;
}
-#line 4104 "awkgram.c" /* yacc.c:1646 */
+#line 4200 "awkgram.c" /* yacc.c:1646 */
break;
- case 189:
-#line 1969 "awkgram.y" /* yacc.c:1646 */
+ case 194:
+#line 2022 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postdecrement;
}
-#line 4112 "awkgram.c" /* yacc.c:1646 */
+#line 4208 "awkgram.c" /* yacc.c:1646 */
break;
- case 190:
-#line 1972 "awkgram.y" /* yacc.c:1646 */
+ case 195:
+#line 2025 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 4118 "awkgram.c" /* yacc.c:1646 */
+#line 4214 "awkgram.c" /* yacc.c:1646 */
break;
- case 192:
-#line 1980 "awkgram.y" /* yacc.c:1646 */
+ case 197:
+#line 2033 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4124 "awkgram.c" /* yacc.c:1646 */
+#line 4220 "awkgram.c" /* yacc.c:1646 */
break;
- case 193:
-#line 1984 "awkgram.y" /* yacc.c:1646 */
+ case 198:
+#line 2037 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4130 "awkgram.c" /* yacc.c:1646 */
+#line 4226 "awkgram.c" /* yacc.c:1646 */
break;
- case 196:
-#line 1993 "awkgram.y" /* yacc.c:1646 */
+ case 201:
+#line 2046 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4136 "awkgram.c" /* yacc.c:1646 */
+#line 4232 "awkgram.c" /* yacc.c:1646 */
break;
- case 197:
-#line 1997 "awkgram.y" /* yacc.c:1646 */
+ case 202:
+#line 2050 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); yyerrok; }
-#line 4142 "awkgram.c" /* yacc.c:1646 */
+#line 4238 "awkgram.c" /* yacc.c:1646 */
break;
- case 198:
-#line 2001 "awkgram.y" /* yacc.c:1646 */
+ case 203:
+#line 2054 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4148 "awkgram.c" /* yacc.c:1646 */
+#line 4244 "awkgram.c" /* yacc.c:1646 */
break;
-#line 4152 "awkgram.c" /* yacc.c:1646 */
+#line 4248 "awkgram.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -4376,7 +4472,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 2003 "awkgram.y" /* yacc.c:1906 */
+#line 2056 "awkgram.y" /* yacc.c:1906 */
struct token {
@@ -5712,6 +5808,7 @@ yylex(void)
bool inhex = false;
bool intlstr = false;
AWKNUM d;
+ bool collecting_typed_regexp = false;
#define GET_INSTRUCTION(op) bcalloc(op, 1, sourceline)
@@ -5747,6 +5844,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 +5931,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 +5995,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 +7059,8 @@ valinfo(NODE *n, Func_print print_func, FILE *fp)
{
if (n == Nnull_string)
print_func(fp, "uninitialized scalar\n");
+ else if ((n->flags & REGEX) != 0)
+ print_func(fp, "@/%.*s/\n", n->stlen, n->stptr);
else if ((n->flags & STRING) != 0) {
pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', false);
print_func(fp, "\n");
diff --git a/awkgram.y b/awkgram.y
index e05269ec..3a9c9296 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -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,35 @@ regexp
}
;
+typed_regexp
+ : TYPED_REGEXP
+ {
+ NODE *n, *exp, *n2;
+ 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_regex, exp);
+ if (n == NULL) {
+ unref(exp);
+ YYABORT;
+ }
+
+ n2 = make_string(re, len);
+ n2->typed_re = n;
+ n2->numbr = 0;
+ n2->flags |= NUMCUR|STRCUR|REGEX;
+ n2->flags &= ~(STRING|NUMBER);
+
+ $$ = $1;
+ $$->opcode = Op_push_re;
+ $$->memory = n2;
+ }
+
a_slash
: '/'
{ bcfree($1); }
@@ -1252,6 +1281,12 @@ case_value
$1->opcode = Op_push;
$$ = $1;
}
+ | typed_regexp
+ {
+ assert(($1->memory->flags & REGEX) == REGEX);
+ $1->opcode = Op_push_re;
+ $$ = $1;
+ }
;
print
@@ -1436,6 +1471,7 @@ fcall_expression_list
fcall_exp
: exp { $$ = $1; }
+ | typed_regexp { $$ = list_create($1); }
;
/* Expressions, not including the comma operator. */
@@ -1447,10 +1483,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->flags & REGEX) != 0);
+ /* RHS is @/.../ */
+ $2->memory = $3->memory;
+ bcfree($3);
+ $$ = list_append($1, $2);
+ }
| exp MATCHOP exp
{
if ($1->lasti->opcode == Op_match_rec)
@@ -3335,6 +3388,7 @@ yylex(void)
bool inhex = false;
bool intlstr = false;
AWKNUM d;
+ bool collecting_typed_regexp = false;
#define GET_INSTRUCTION(op) bcalloc(op, 1, sourceline)
@@ -3370,6 +3424,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 +3511,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 +3575,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 +4639,8 @@ valinfo(NODE *n, Func_print print_func, FILE *fp)
{
if (n == Nnull_string)
print_func(fp, "uninitialized scalar\n");
+ else if ((n->flags & REGEX) != 0)
+ print_func(fp, "@/%.*s/\n", n->stlen, n->stptr);
else if ((n->flags & STRING) != 0) {
pp_string_fp(print_func, fp, n->stptr, n->stlen, '"', false);
print_func(fp, "\n");
diff --git a/builtin.c b/builtin.c
index 9a45e10f..5d7c3764 100644
--- a/builtin.c
+++ b/builtin.c
@@ -3202,7 +3202,10 @@ call_sub(const char *name, int nargs)
* push replace
* push $0
*/
- regex = make_regnode(Node_regex, regex);
+ if ((regex->flags & REGEX) != 0)
+ regex = regex->typed_re;
+ else
+ regex = make_regnode(Node_regex, regex);
PUSH(regex);
PUSH(replace);
lhs = r_get_field(zero, (Func_ptr *) 0, true);
@@ -3226,7 +3229,10 @@ call_sub(const char *name, int nargs)
* nargs++
* }
*/
- regex = make_regnode(Node_regex, regex);
+ if ((regex->flags & REGEX) != 0)
+ regex = regex->typed_re;
+ else
+ regex = make_regnode(Node_regex, regex);
PUSH(regex);
PUSH(replace);
PUSH(glob_flag);
@@ -3263,7 +3269,11 @@ call_match(int nargs)
/* Don't need to pop the string just to push it back ... */
- regex = make_regnode(Node_regex, regex);
+ if ((regex->flags & REGEX) != 0)
+ regex = regex->typed_re;
+ else
+ regex = make_regnode(Node_regex, regex);
+
PUSH(regex);
if (array)
@@ -3291,7 +3301,10 @@ call_split_func(const char *name, int nargs)
if (nargs >= 3) {
regex = POP_STRING();
- regex = make_regnode(Node_regex, regex);
+ if ((regex->flags & REGEX) != 0)
+ regex = regex->typed_re;
+ else
+ regex = make_regnode(Node_regex, regex);
} else {
if (name[0] == 's') {
regex = make_regnode(Node_regex, FS_node->var_value);
@@ -3976,7 +3989,7 @@ do_typeof(int nargs)
break;
case Node_val:
case Node_var:
- switch (fixtype(arg)->flags & (STRING|NUMBER|USER_INPUT)) {
+ switch (fixtype(arg)->flags & (STRING|NUMBER|USER_INPUT|REGEX)) {
case STRING:
res = "string";
break;
@@ -3986,6 +3999,9 @@ do_typeof(int nargs)
case NUMBER|USER_INPUT:
res = "strnum";
break;
+ case REGEX:
+ res = "regexp";
+ break;
case NUMBER|STRING:
if (arg == Nnull_string) {
res = "unassigned";
diff --git a/debug.c b/debug.c
index 9568c0a1..faf4f89d 100644
--- a/debug.c
+++ b/debug.c
@@ -1790,6 +1790,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_val && (symbol->flags & REGEX) != 0) {
+ w->cur_value = dupnode(symbol);
} /* else
can't happen */
}
@@ -3703,7 +3705,10 @@ print_memory(NODE *m, NODE *func, Func_print print_func, FILE *fp)
print_func(fp, "%g", m->numbr);
} else if ((m->flags & STRING) != 0)
pp_string_fp(print_func, fp, m->stptr, m->stlen, '"', false);
- else
+ else if ((m->flags & REGEX) != 0) {
+ print_func(fp, "@");
+ pp_string_fp(print_func, fp, m->stptr, m->stlen, '/', false);
+ } else
print_func(fp, "-?-");
print_func(fp, " [%s]", flags2str(m->flags));
break;
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 07c82d59..c948bcda 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,10 @@
+2016-11-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Finish off discussion of strongly typed regexp
+ constants and put it in the right place in the manual. A few other
+ minor fixes.
+ * wordlist: Updated.
+
2016-11-18 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in (Variable Typing): Rework and improve discussion
@@ -74,6 +81,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.
diff --git a/doc/gawk.1 b/doc/gawk.1
index 22b41f34..a1a2a52c 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -3235,6 +3235,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 412edf51..3bb2f352 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -175,7 +175,6 @@ in (a) below. A copy of the license is included in the section entitled
* Computed Regexps:: Using Dynamic Regexps.
* GNU Regexp Operators:: Operators specific to GNU software.
* Case-sensitivity:: How to do case-insensitive matching.
-* Strong Regexp Constants:: Strongly typed regexp constants.
* Regexp Summary:: Regular expressions summary.
* Records:: Controlling how data is split into
records.
@@ -258,6 +257,9 @@ in (a) below. A copy of the license is included in the section entitled
* Nondecimal-numbers:: What are octal and hex numbers.
* Regexp Constants:: Regular Expression constants.
* Using Constant Regexps:: When and how to use a regexp constant.
+* Standard Regexp Constants:: Regexp constants in standard
+ 'awk'.
+* Strong Regexp Constants:: Strongly typed regexp constants.
* Variables:: Variables give names to values for
later use.
* Using Variables:: Using variables in your programs.
@@ -560,7 +562,8 @@ in (a) below. A copy of the license is included in the section entitled
* Array Functions:: Functions for working with arrays.
* Flattening Arrays:: How to flatten arrays.
* Creating Arrays:: How to create and populate arrays.
-* Redirection API:: How to access and manipulate redirections.
+* Redirection API:: How to access and manipulate
+ redirections.
* Extension API Variables:: Variables provided by the API.
* Extension Versioning:: API Version information.
* Extension API Informational Variables:: Variables providing information about
@@ -624,10 +627,11 @@ in (a) below. A copy of the license is included in the section entitled
* Configuration Philosophy:: How it's all supposed to work.
* Non-Unix Installation:: Installation on Other Operating
Systems.
-* PC Installation:: Installing and Compiling 'gawk' on
- Microsoft Windows.
+* PC Installation:: Installing and Compiling
+ 'gawk' on Microsoft Windows.
* PC Binary Installation:: Installing a prepared distribution.
-* PC Compiling:: Compiling 'gawk' for Windows32.
+* PC Compiling:: Compiling 'gawk' for
+ Windows32.
* PC Using:: Running 'gawk' on Windows32.
* Cygwin:: Building and running 'gawk'
for Cygwin.
@@ -3327,7 +3331,6 @@ you specify more complicated classes of strings.
* Computed Regexps:: Using Dynamic Regexps.
* GNU Regexp Operators:: Operators specific to GNU software.
* Case-sensitivity:: How to do case-insensitive matching.
-* Strong Regexp Constants:: Strongly typed regexp constants.
* Regexp Summary:: Regular expressions summary.

@@ -4042,7 +4045,7 @@ No options
default.

-File: gawk.info, Node: Case-sensitivity, Next: Strong Regexp Constants, Prev: GNU Regexp Operators, Up: Regexp
+File: gawk.info, Node: Case-sensitivity, Next: Regexp Summary, Prev: GNU Regexp Operators, Up: Regexp
3.8 Case Sensitivity in Matching
================================
@@ -4116,29 +4119,10 @@ and we don't recommend it.
that 'gawk' does the right thing.

-File: gawk.info, Node: Strong Regexp Constants, Next: Regexp Summary, Prev: Case-sensitivity, Up: Regexp
-
-3.9 Strongly Typed Regexp Constants
-===================================
-
-This minor node describes a 'gawk'-specific feature.
-
- Regexp constants ('/.../') hold a strange position in the 'awk'
-language. In most contexts, they act like an expression: '$0 ~ /.../'.
-In other contexts, they denote only a regexp to be matched. In no case
-are they really a "first class citizen" of the language. That is, you
-cannot define a scalar variable whose type is "regexp" in the same sense
-that you can define a variable to be a number or a string:
-
- num = 42 Numeric variable
- str = "hi" String variable
- re = /foo/ Wrong! re is the result of $0 ~ /foo/
-
-
-File: gawk.info, Node: Regexp Summary, Prev: Strong Regexp Constants, Up: Regexp
+File: gawk.info, Node: Regexp Summary, Prev: Case-sensitivity, Up: Regexp
-3.10 Summary
-============
+3.9 Summary
+===========
* Regular expressions describe sets of strings to be matched. In
'awk', regular expression constants are written enclosed between
@@ -7486,9 +7470,9 @@ octal (base 8) and hexadecimal (base 16). In octal, the numbers go 0,
1 times 10 plus 1, so '11' in octal is 1 times 8 plus 1. This equals 9
in decimal. In hexadecimal, there are 16 digits. Because the everyday
decimal number system only has ten digits ('0'-'9'), the letters 'a'
-through 'f' are used to represent the rest. (Case in the letters is
-usually irrelevant; hexadecimal 'a' and 'A' have the same value.) Thus,
-'11' in hexadecimal is 1 times 16 plus 1, which equals 17 in decimal.
+through 'f' represent the rest. (Case in the letters is usually
+irrelevant; hexadecimal 'a' and 'A' have the same value.) Thus, '11' in
+hexadecimal is 1 times 16 plus 1, which equals 17 in decimal.
Just by looking at plain '11', you can't tell what base it's in. So,
in C, C++, and other languages derived from C, there is a special
@@ -7565,6 +7549,23 @@ File: gawk.info, Node: Using Constant Regexps, Next: Variables, Prev: Constan
6.1.2 Using Regular Expression Constants
----------------------------------------
+Regular expression constants consist of text describing a regular
+expression enclosed in slashes (such as '/the +answer/'). This minor
+node describes how such constants work in POSIX 'awk' and 'gawk', and
+then goes on to describe "strongly typed regexp constants", which are a
+'gawk' extension.
+
+* Menu:
+
+* Standard Regexp Constants:: Regexp constants in standard 'awk'.
+* Strong Regexp Constants:: Strongly typed regexp constants.
+
+
+File: gawk.info, Node: Standard Regexp Constants, Next: Strong Regexp Constants, Up: Using Constant Regexps
+
+6.1.2.1 Standard Regular Expression Constants
+.............................................
+
When used on the righthand side of the '~' or '!~' operators, a regexp
constant merely stands for the regexp that is to be matched. However,
regexp constants (such as '/foo/') may be used like simple expressions.
@@ -7639,6 +7640,73 @@ function, because passing a truth value in this way is probably not what
was intended.

+File: gawk.info, Node: Strong Regexp Constants, Prev: Standard Regexp Constants, Up: Using Constant Regexps
+
+6.1.2.2 Strongly Typed Regexp Constants
+.......................................
+
+This minor node describes a 'gawk'-specific feature.
+
+ As we saw in the previous minor node, regexp constants ('/.../') hold
+a strange position in the 'awk' language. In most contexts, they act
+like an expression: '$0 ~ /.../'. In other contexts, they denote only a
+regexp to be matched. In no case are they really a "first class
+citizen" of the language. That is, you cannot define a scalar variable
+whose type is "regexp" in the same sense that you can define a variable
+to be a number or a string:
+
+ num = 42 Numeric variable
+ str = "hi" String variable
+ re = /foo/ Wrong! re is the result of $0 ~ /foo/
+
+ For a number of more advanced use cases, 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 everywhere 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::)
+and on to 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: Variables, Next: Conversion, Prev: Using Constant Regexps, Up: Values
6.1.3 Variables
@@ -8418,6 +8486,8 @@ Scalar objects in 'awk' (variables, array elements, and fields) are
_dynamically_ typed. This means their type can change as the program
runs, from "untyped" before any use,(1) to string or number, and then
from string to number or number to string, as the program progresses.
+('gawk' also provides regexp-typed scalars, but let's ignore that for
+now; *note Strong Regexp Constants::.)
You can't do much with untyped variables, other than tell that they
are untyped. The following program tests 'a' against '""' and '0'; the
@@ -13688,6 +13758,10 @@ contexts.
'"array"'
X is an array.
+ '"regexp"'
+ X is a strongly typed regexp (*note Strong Regexp
+ Constants::).
+
'"number"'
X is a number.
@@ -13735,7 +13809,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
@@ -23360,7 +23435,8 @@ API in detail.
* Symbol Table Access:: Functions for accessing global
variables.
* Array Manipulation:: Functions for working with arrays.
-* Redirection API:: How to access and manipulate redirections.
+* Redirection API:: How to access and manipulate
+ redirections.
* Extension API Variables:: Variables provided by the API.
* Extension API Boilerplate:: Boilerplate code for using the API.
@@ -33032,11 +33108,11 @@ Index
* dark corner, OFMT variable: OFMT. (line 27)
* dark corner, regexp as second argument to index(): String Functions.
(line 164)
-* dark corner, regexp constants: Using Constant Regexps.
+* dark corner, regexp constants: Standard Regexp Constants.
(line 6)
* dark corner, regexp constants, /= operator and: Assignment Ops.
(line 149)
-* dark corner, regexp constants, as arguments to user-defined functions: Using Constant Regexps.
+* dark corner, regexp constants, as arguments to user-defined functions: Standard Regexp Constants.
(line 43)
* dark corner, split() function: String Functions. (line 361)
* dark corner, strings, storing: gawk split records. (line 82)
@@ -33243,7 +33319,7 @@ Index
* differences in awk and gawk, read timeouts: Read Timeout. (line 6)
* differences in awk and gawk, record separators: awk split records.
(line 124)
-* differences in awk and gawk, regexp constants: Using Constant Regexps.
+* differences in awk and gawk, regexp constants: Standard Regexp Constants.
(line 43)
* differences in awk and gawk, regular expressions: Case-sensitivity.
(line 26)
@@ -33745,7 +33821,7 @@ Index
* gawk, PROCINFO array in: Auto-set. (line 148)
* gawk, PROCINFO array in <1>: Time Functions. (line 47)
* gawk, PROCINFO array in <2>: Two-way I/O. (line 114)
-* gawk, regexp constants and: Using Constant Regexps.
+* gawk, regexp constants and: Standard Regexp Constants.
(line 28)
* gawk, regular expressions, case sensitivity: Case-sensitivity.
(line 26)
@@ -33778,7 +33854,7 @@ Index
* General Public License (GPL): Glossary. (line 396)
* General Public License, See GPL: Manual History. (line 11)
* generate time values: Time Functions. (line 25)
-* gensub: Using Constant Regexps.
+* gensub: Standard Regexp Constants.
(line 43)
* gensub <1>: String Functions. (line 89)
* gensub() function (gawk), escape processing: Gory Details. (line 6)
@@ -33858,7 +33934,7 @@ Index
* group file: Group Functions. (line 6)
* group ID of gawk user: Auto-set. (line 170)
* groups, information about: Group Functions. (line 6)
-* gsub: Using Constant Regexps.
+* gsub: Standard Regexp Constants.
(line 43)
* gsub <1>: String Functions. (line 139)
* gsub() function, arguments of: String Functions. (line 463)
@@ -34260,7 +34336,7 @@ Index
* numeric constants: Scalar Constants. (line 6)
* numeric functions: Numeric Functions. (line 6)
* numeric, output format: OFMT. (line 6)
-* numeric, strings: Variable Typing. (line 65)
+* numeric, strings: Variable Typing. (line 67)
* o debugger command (alias for option): Debugger Info. (line 57)
* obsolete features: Obsolete. (line 6)
* octal numbers: Nondecimal-numbers. (line 6)
@@ -34456,7 +34532,7 @@ Index
* POSIX awk, GNU long options and: Options. (line 15)
* POSIX awk, interval expressions in: Regexp Operators. (line 135)
* POSIX awk, next/nextfile statements and: Next Statement. (line 44)
-* POSIX awk, numeric strings and: Variable Typing. (line 65)
+* POSIX awk, numeric strings and: Variable Typing. (line 67)
* POSIX awk, OFMT variable and: OFMT. (line 27)
* POSIX awk, OFMT variable and <1>: Strings And Numbers. (line 56)
* POSIX awk, period (.), using: Regexp Operators. (line 51)
@@ -34627,7 +34703,7 @@ Index
(line 103)
* regexp constants, /=.../, /= operator and: Assignment Ops. (line 149)
* regexp constants, as patterns: Expression Patterns. (line 34)
-* regexp constants, in gawk: Using Constant Regexps.
+* regexp constants, in gawk: Standard Regexp Constants.
(line 28)
* regexp constants, slashes vs. quotes: Computed Regexps. (line 30)
* regexp constants, vs. string constants: Computed Regexps. (line 40)
@@ -34966,11 +35042,11 @@ Index
* strings, merging arrays into: Join Function. (line 6)
* strings, null: Regexp Field Splitting.
(line 43)
-* strings, numeric: Variable Typing. (line 65)
+* strings, numeric: Variable Typing. (line 67)
* strtonum: String Functions. (line 391)
* strtonum() function (gawk), --non-decimal-data option and: Nondecimal Data.
(line 35)
-* sub: Using Constant Regexps.
+* sub: Standard Regexp Constants.
(line 43)
* sub <1>: String Functions. (line 409)
* sub() function, arguments of: String Functions. (line 463)
@@ -35244,572 +35320,573 @@ Index

Tag Table:
Node: Top1200
-Node: Foreword342530
-Node: Foreword446972
-Node: Preface48504
-Ref: Preface-Footnote-151363
-Ref: Preface-Footnote-251470
-Ref: Preface-Footnote-351704
-Node: History51846
-Node: Names54198
-Ref: Names-Footnote-155292
-Node: This Manual55439
-Ref: This Manual-Footnote-161924
-Node: Conventions62024
-Node: Manual History64378
-Ref: Manual History-Footnote-167373
-Ref: Manual History-Footnote-267414
-Node: How To Contribute67488
-Node: Acknowledgments68617
-Node: Getting Started73503
-Node: Running gawk75942
-Node: One-shot77132
-Node: Read Terminal78395
-Node: Long80388
-Node: Executable Scripts81901
-Ref: Executable Scripts-Footnote-184696
-Node: Comments84799
-Node: Quoting87283
-Node: DOS Quoting92800
-Node: Sample Data Files93475
-Node: Very Simple96070
-Node: Two Rules100972
-Node: More Complex102857
-Node: Statements/Lines105723
-Ref: Statements/Lines-Footnote-1110182
-Node: Other Features110447
-Node: When111383
-Ref: When-Footnote-1113137
-Node: Intro Summary113202
-Node: Invoking Gawk114086
-Node: Command Line115600
-Node: Options116398
-Ref: Options-Footnote-1132497
-Ref: Options-Footnote-2132727
-Node: Other Arguments132752
-Node: Naming Standard Input135699
-Node: Environment Variables136792
-Node: AWKPATH Variable137350
-Ref: AWKPATH Variable-Footnote-1140761
-Ref: AWKPATH Variable-Footnote-2140795
-Node: AWKLIBPATH Variable141056
-Node: Other Environment Variables142313
-Node: Exit Status146134
-Node: Include Files146811
-Node: Loading Shared Libraries150406
-Node: Obsolete151834
-Node: Undocumented152526
-Node: Invoking Summary152823
-Node: Regexp154483
-Node: Regexp Usage156002
-Node: Escape Sequences158039
-Node: Regexp Operators164271
-Ref: Regexp Operators-Footnote-1171687
-Ref: Regexp Operators-Footnote-2171834
-Node: Bracket Expressions171932
-Ref: table-char-classes174408
-Node: Leftmost Longest177545
-Node: Computed Regexps178848
-Node: GNU Regexp Operators182275
-Node: Case-sensitivity185954
-Ref: Case-sensitivity-Footnote-1188850
-Ref: Case-sensitivity-Footnote-2189085
-Node: Strong Regexp Constants189193
-Node: Regexp Summary189982
-Node: Reading Files191457
-Node: Records193620
-Node: awk split records194353
-Node: gawk split records199284
-Ref: gawk split records-Footnote-1203824
-Node: Fields203861
-Node: Nonconstant Fields206602
-Ref: Nonconstant Fields-Footnote-1208838
-Node: Changing Fields209042
-Node: Field Separators214970
-Node: Default Field Splitting217668
-Node: Regexp Field Splitting218786
-Node: Single Character Fields222139
-Node: Command Line Field Separator223199
-Node: Full Line Fields226417
-Ref: Full Line Fields-Footnote-1227939
-Ref: Full Line Fields-Footnote-2227985
-Node: Field Splitting Summary228086
-Node: Constant Size230160
-Node: Splitting By Content234738
-Ref: Splitting By Content-Footnote-1238709
-Node: Multiple Line238872
-Ref: Multiple Line-Footnote-1244754
-Node: Getline244933
-Node: Plain Getline247400
-Node: Getline/Variable250039
-Node: Getline/File251188
-Node: Getline/Variable/File252574
-Ref: Getline/Variable/File-Footnote-1254177
-Node: Getline/Pipe254265
-Node: Getline/Variable/Pipe256970
-Node: Getline/Coprocess258103
-Node: Getline/Variable/Coprocess259368
-Node: Getline Notes260108
-Node: Getline Summary262903
-Ref: table-getline-variants263325
-Node: Read Timeout264073
-Ref: Read Timeout-Footnote-1267979
-Node: Retrying Input268037
-Node: Command-line directories269236
-Node: Input Summary270142
-Node: Input Exercises273314
-Node: Printing274042
-Node: Print275876
-Node: Print Examples277333
-Node: Output Separators280113
-Node: OFMT282130
-Node: Printf283486
-Node: Basic Printf284271
-Node: Control Letters285845
-Node: Format Modifiers289833
-Node: Printf Examples295848
-Node: Redirection298334
-Node: Special FD305175
-Ref: Special FD-Footnote-1308343
-Node: Special Files308417
-Node: Other Inherited Files309034
-Node: Special Network310035
-Node: Special Caveats310895
-Node: Close Files And Pipes311844
-Ref: table-close-pipe-return-values318751
-Ref: Close Files And Pipes-Footnote-1319534
-Ref: Close Files And Pipes-Footnote-2319682
-Node: Nonfatal319834
-Node: Output Summary322159
-Node: Output Exercises323381
-Node: Expressions324060
-Node: Values325248
-Node: Constants325926
-Node: Scalar Constants326617
-Ref: Scalar Constants-Footnote-1327481
-Node: Nondecimal-numbers327731
-Node: Regexp Constants330744
-Node: Using Constant Regexps331270
-Node: Variables334433
-Node: Using Variables335090
-Node: Assignment Options337000
-Node: Conversion338873
-Node: Strings And Numbers339397
-Ref: Strings And Numbers-Footnote-1342460
-Node: Locale influences conversions342569
-Ref: table-locale-affects345327
-Node: All Operators345945
-Node: Arithmetic Ops346574
-Node: Concatenation349080
-Ref: Concatenation-Footnote-1351927
-Node: Assignment Ops352034
-Ref: table-assign-ops357025
-Node: Increment Ops358338
-Node: Truth Values and Conditions361798
-Node: Truth Values362872
-Node: Typing and Comparison363920
-Node: Variable Typing364740
-Ref: Variable Typing-Footnote-1371094
-Ref: Variable Typing-Footnote-2371166
-Node: Comparison Operators371243
-Ref: table-relational-ops371662
-Node: POSIX String Comparison375157
-Ref: POSIX String Comparison-Footnote-1376852
-Ref: POSIX String Comparison-Footnote-2376991
-Node: Boolean Ops377075
-Ref: Boolean Ops-Footnote-1381557
-Node: Conditional Exp381649
-Node: Function Calls383385
-Node: Precedence387262
-Node: Locales390921
-Node: Expressions Summary392553
-Node: Patterns and Actions395126
-Node: Pattern Overview396246
-Node: Regexp Patterns397923
-Node: Expression Patterns398465
-Node: Ranges402246
-Node: BEGIN/END405354
-Node: Using BEGIN/END406115
-Ref: Using BEGIN/END-Footnote-1408851
-Node: I/O And BEGIN/END408957
-Node: BEGINFILE/ENDFILE411271
-Node: Empty414178
-Node: Using Shell Variables414495
-Node: Action Overview416769
-Node: Statements419094
-Node: If Statement420942
-Node: While Statement422437
-Node: Do Statement424465
-Node: For Statement425613
-Node: Switch Statement428771
-Node: Break Statement431157
-Node: Continue Statement433249
-Node: Next Statement435076
-Node: Nextfile Statement437459
-Node: Exit Statement440111
-Node: Built-in Variables442514
-Node: User-modified443647
-Node: Auto-set451233
-Ref: Auto-set-Footnote-1465886
-Ref: Auto-set-Footnote-2466092
-Node: ARGC and ARGV466148
-Node: Pattern Action Summary470361
-Node: Arrays472791
-Node: Array Basics474120
-Node: Array Intro474964
-Ref: figure-array-elements476939
-Ref: Array Intro-Footnote-1479643
-Node: Reference to Elements479771
-Node: Assigning Elements482235
-Node: Array Example482726
-Node: Scanning an Array484485
-Node: Controlling Scanning487507
-Ref: Controlling Scanning-Footnote-1492906
-Node: Numeric Array Subscripts493222
-Node: Uninitialized Subscripts495406
-Node: Delete497025
-Ref: Delete-Footnote-1499777
-Node: Multidimensional499834
-Node: Multiscanning502929
-Node: Arrays of Arrays504520
-Node: Arrays Summary509287
-Node: Functions511380
-Node: Built-in512418
-Node: Calling Built-in513499
-Node: Numeric Functions515495
-Ref: Numeric Functions-Footnote-1520328
-Ref: Numeric Functions-Footnote-2520685
-Ref: Numeric Functions-Footnote-3520733
-Node: String Functions521005
-Ref: String Functions-Footnote-1544509
-Ref: String Functions-Footnote-2544637
-Ref: String Functions-Footnote-3544885
-Node: Gory Details544972
-Ref: table-sub-escapes546763
-Ref: table-sub-proposed548282
-Ref: table-posix-sub549645
-Ref: table-gensub-escapes551186
-Ref: Gory Details-Footnote-1552009
-Node: I/O Functions552163
-Ref: table-system-return-values558745
-Ref: I/O Functions-Footnote-1560725
-Ref: I/O Functions-Footnote-2560873
-Node: Time Functions560993
-Ref: Time Functions-Footnote-1571515
-Ref: Time Functions-Footnote-2571583
-Ref: Time Functions-Footnote-3571741
-Ref: Time Functions-Footnote-4571852
-Ref: Time Functions-Footnote-5571964
-Ref: Time Functions-Footnote-6572191
-Node: Bitwise Functions572457
-Ref: table-bitwise-ops573051
-Ref: Bitwise Functions-Footnote-1579077
-Ref: Bitwise Functions-Footnote-2579250
-Node: Type Functions579441
-Node: I18N Functions581988
-Node: User-defined583639
-Node: Definition Syntax584444
-Ref: Definition Syntax-Footnote-1590131
-Node: Function Example590202
-Ref: Function Example-Footnote-1593124
-Node: Function Caveats593146
-Node: Calling A Function593664
-Node: Variable Scope594622
-Node: Pass By Value/Reference597616
-Node: Return Statement601115
-Node: Dynamic Typing604094
-Node: Indirect Calls605024
-Ref: Indirect Calls-Footnote-1615275
-Node: Functions Summary615403
-Node: Library Functions618108
-Ref: Library Functions-Footnote-1621715
-Ref: Library Functions-Footnote-2621858
-Node: Library Names622029
-Ref: Library Names-Footnote-1625489
-Ref: Library Names-Footnote-2625712
-Node: General Functions625798
-Node: Strtonum Function626901
-Node: Assert Function629923
-Node: Round Function633249
-Node: Cliff Random Function634790
-Node: Ordinal Functions635806
-Ref: Ordinal Functions-Footnote-1638869
-Ref: Ordinal Functions-Footnote-2639121
-Node: Join Function639331
-Ref: Join Function-Footnote-1641101
-Node: Getlocaltime Function641301
-Node: Readfile Function645043
-Node: Shell Quoting647015
-Node: Data File Management648416
-Node: Filetrans Function649048
-Node: Rewind Function653144
-Node: File Checking655050
-Ref: File Checking-Footnote-1656384
-Node: Empty Files656585
-Node: Ignoring Assigns658564
-Node: Getopt Function660114
-Ref: Getopt Function-Footnote-1671583
-Node: Passwd Functions671783
-Ref: Passwd Functions-Footnote-1680622
-Node: Group Functions680710
-Ref: Group Functions-Footnote-1688608
-Node: Walking Arrays688815
-Node: Library Functions Summary691823
-Node: Library Exercises693229
-Node: Sample Programs693694
-Node: Running Examples694464
-Node: Clones695192
-Node: Cut Program696416
-Node: Egrep Program706345
-Ref: Egrep Program-Footnote-1713857
-Node: Id Program713967
-Node: Split Program717647
-Ref: Split Program-Footnote-1721106
-Node: Tee Program721235
-Node: Uniq Program724025
-Node: Wc Program731451
-Ref: Wc Program-Footnote-1735706
-Node: Miscellaneous Programs735800
-Node: Dupword Program737013
-Node: Alarm Program739043
-Node: Translate Program743898
-Ref: Translate Program-Footnote-1748463
-Node: Labels Program748733
-Ref: Labels Program-Footnote-1752084
-Node: Word Sorting752168
-Node: History Sorting756240
-Node: Extract Program758075
-Node: Simple Sed765604
-Node: Igawk Program768678
-Ref: Igawk Program-Footnote-1783009
-Ref: Igawk Program-Footnote-2783211
-Ref: Igawk Program-Footnote-3783333
-Node: Anagram Program783448
-Node: Signature Program786510
-Node: Programs Summary787757
-Node: Programs Exercises788971
-Ref: Programs Exercises-Footnote-1793100
-Node: Advanced Features793191
-Node: Nondecimal Data795181
-Node: Array Sorting796772
-Node: Controlling Array Traversal797472
-Ref: Controlling Array Traversal-Footnote-1805839
-Node: Array Sorting Functions805957
-Ref: Array Sorting Functions-Footnote-1811048
-Node: Two-way I/O811244
-Ref: Two-way I/O-Footnote-1817794
-Ref: Two-way I/O-Footnote-2817981
-Node: TCP/IP Networking818063
-Node: Profiling821181
-Ref: Profiling-Footnote-1829674
-Node: Advanced Features Summary829997
-Node: Internationalization831841
-Node: I18N and L10N833321
-Node: Explaining gettext834008
-Ref: Explaining gettext-Footnote-1839900
-Ref: Explaining gettext-Footnote-2840085
-Node: Programmer i18n840250
-Ref: Programmer i18n-Footnote-1845199
-Node: Translator i18n845248
-Node: String Extraction846042
-Ref: String Extraction-Footnote-1847174
-Node: Printf Ordering847260
-Ref: Printf Ordering-Footnote-1850046
-Node: I18N Portability850110
-Ref: I18N Portability-Footnote-1852566
-Node: I18N Example852629
-Ref: I18N Example-Footnote-1855435
-Node: Gawk I18N855508
-Node: I18N Summary856153
-Node: Debugger857494
-Node: Debugging858516
-Node: Debugging Concepts858957
-Node: Debugging Terms860766
-Node: Awk Debugging863341
-Node: Sample Debugging Session864247
-Node: Debugger Invocation864781
-Node: Finding The Bug866167
-Node: List of Debugger Commands872645
-Node: Breakpoint Control873978
-Node: Debugger Execution Control877672
-Node: Viewing And Changing Data881034
-Node: Execution Stack884408
-Node: Debugger Info886045
-Node: Miscellaneous Debugger Commands890116
-Node: Readline Support895204
-Node: Limitations896100
-Node: Debugging Summary898209
-Node: Arbitrary Precision Arithmetic899488
-Node: Computer Arithmetic900904
-Ref: table-numeric-ranges904495
-Ref: Computer Arithmetic-Footnote-1905217
-Node: Math Definitions905274
-Ref: table-ieee-formats908588
-Ref: Math Definitions-Footnote-1909191
-Node: MPFR features909296
-Node: FP Math Caution911013
-Ref: FP Math Caution-Footnote-1912085
-Node: Inexactness of computations912454
-Node: Inexact representation913414
-Node: Comparing FP Values914774
-Node: Errors accumulate915856
-Node: Getting Accuracy917289
-Node: Try To Round919999
-Node: Setting precision920898
-Ref: table-predefined-precision-strings921595
-Node: Setting the rounding mode923425
-Ref: table-gawk-rounding-modes923799
-Ref: Setting the rounding mode-Footnote-1927207
-Node: Arbitrary Precision Integers927386
-Ref: Arbitrary Precision Integers-Footnote-1932303
-Node: POSIX Floating Point Problems932452
-Ref: POSIX Floating Point Problems-Footnote-1936334
-Node: Floating point summary936372
-Node: Dynamic Extensions938562
-Node: Extension Intro940115
-Node: Plugin License941381
-Node: Extension Mechanism Outline942178
-Ref: figure-load-extension942617
-Ref: figure-register-new-function944182
-Ref: figure-call-new-function945274
-Node: Extension API Description947336
-Node: Extension API Functions Introduction948868
-Node: General Data Types954179
-Ref: General Data Types-Footnote-1960134
-Node: Memory Allocation Functions960433
-Ref: Memory Allocation Functions-Footnote-1963278
-Node: Constructor Functions963377
-Node: Registration Functions965122
-Node: Extension Functions965807
-Node: Exit Callback Functions968430
-Node: Extension Version String969680
-Node: Input Parsers970343
-Node: Output Wrappers980225
-Node: Two-way processors984737
-Node: Printing Messages987002
-Ref: Printing Messages-Footnote-1988173
-Node: Updating ERRNO988326
-Node: Requesting Values989065
-Ref: table-value-types-returned989802
-Node: Accessing Parameters990685
-Node: Symbol Table Access991920
-Node: Symbol table by name992432
-Node: Symbol table by cookie994453
-Ref: Symbol table by cookie-Footnote-1998605
-Node: Cached values998669
-Ref: Cached values-Footnote-11002176
-Node: Array Manipulation1002267
-Ref: Array Manipulation-Footnote-11003358
-Node: Array Data Types1003395
-Ref: Array Data Types-Footnote-11006053
-Node: Array Functions1006145
-Node: Flattening Arrays1010003
-Node: Creating Arrays1016911
-Node: Redirection API1021680
-Node: Extension API Variables1024511
-Node: Extension Versioning1025144
-Ref: gawk-api-version1025581
-Node: Extension API Informational Variables1027337
-Node: Extension API Boilerplate1028401
-Node: Finding Extensions1032215
-Node: Extension Example1032774
-Node: Internal File Description1033572
-Node: Internal File Ops1037652
-Ref: Internal File Ops-Footnote-11049414
-Node: Using Internal File Ops1049554
-Ref: Using Internal File Ops-Footnote-11051937
-Node: Extension Samples1052211
-Node: Extension Sample File Functions1053740
-Node: Extension Sample Fnmatch1061389
-Node: Extension Sample Fork1062876
-Node: Extension Sample Inplace1064094
-Node: Extension Sample Ord1067304
-Node: Extension Sample Readdir1068140
-Ref: table-readdir-file-types1069029
-Node: Extension Sample Revout1069834
-Node: Extension Sample Rev2way1070423
-Node: Extension Sample Read write array1071163
-Node: Extension Sample Readfile1073105
-Node: Extension Sample Time1074200
-Node: Extension Sample API Tests1075548
-Node: gawkextlib1076040
-Node: Extension summary1078487
-Node: Extension Exercises1082189
-Node: Language History1083687
-Node: V7/SVR3.11085343
-Node: SVR41087495
-Node: POSIX1088929
-Node: BTL1090308
-Node: POSIX/GNU1091037
-Node: Feature History1096899
-Node: Common Extensions1111269
-Node: Ranges and Locales1112552
-Ref: Ranges and Locales-Footnote-11117168
-Ref: Ranges and Locales-Footnote-21117195
-Ref: Ranges and Locales-Footnote-31117430
-Node: Contributors1117651
-Node: History summary1123211
-Node: Installation1124591
-Node: Gawk Distribution1125535
-Node: Getting1126019
-Node: Extracting1126980
-Node: Distribution contents1128618
-Node: Unix Installation1134703
-Node: Quick Installation1135385
-Node: Shell Startup Files1137799
-Node: Additional Configuration Options1138877
-Node: Configuration Philosophy1140682
-Node: Non-Unix Installation1143051
-Node: PC Installation1143511
-Node: PC Binary Installation1144349
-Node: PC Compiling1144784
-Node: PC Using1145901
-Node: Cygwin1148946
-Node: MSYS1149716
-Node: VMS Installation1150217
-Node: VMS Compilation1151008
-Ref: VMS Compilation-Footnote-11152237
-Node: VMS Dynamic Extensions1152295
-Node: VMS Installation Details1153980
-Node: VMS Running1156233
-Node: VMS GNV1160512
-Node: VMS Old Gawk1161247
-Node: Bugs1161718
-Node: Bug address1162381
-Node: Usenet1164778
-Node: Maintainers1165553
-Node: Other Versions1166929
-Node: Installation summary1173513
-Node: Notes1174548
-Node: Compatibility Mode1175413
-Node: Additions1176195
-Node: Accessing The Source1177120
-Node: Adding Code1178555
-Node: New Ports1184774
-Node: Derived Files1189262
-Ref: Derived Files-Footnote-11194747
-Ref: Derived Files-Footnote-21194782
-Ref: Derived Files-Footnote-31195380
-Node: Future Extensions1195494
-Node: Implementation Limitations1196152
-Node: Extension Design1197335
-Node: Old Extension Problems1198489
-Ref: Old Extension Problems-Footnote-11200007
-Node: Extension New Mechanism Goals1200064
-Ref: Extension New Mechanism Goals-Footnote-11203428
-Node: Extension Other Design Decisions1203617
-Node: Extension Future Growth1205730
-Node: Old Extension Mechanism1206566
-Node: Notes summary1208329
-Node: Basic Concepts1209511
-Node: Basic High Level1210192
-Ref: figure-general-flow1210474
-Ref: figure-process-flow1211159
-Ref: Basic High Level-Footnote-11214460
-Node: Basic Data Typing1214645
-Node: Glossary1217973
-Node: Copying1249920
-Node: GNU Free Documentation License1287459
-Node: Index1312577
+Node: Foreword342726
+Node: Foreword447168
+Node: Preface48700
+Ref: Preface-Footnote-151559
+Ref: Preface-Footnote-251666
+Ref: Preface-Footnote-351900
+Node: History52042
+Node: Names54394
+Ref: Names-Footnote-155488
+Node: This Manual55635
+Ref: This Manual-Footnote-162120
+Node: Conventions62220
+Node: Manual History64574
+Ref: Manual History-Footnote-167569
+Ref: Manual History-Footnote-267610
+Node: How To Contribute67684
+Node: Acknowledgments68813
+Node: Getting Started73699
+Node: Running gawk76138
+Node: One-shot77328
+Node: Read Terminal78591
+Node: Long80584
+Node: Executable Scripts82097
+Ref: Executable Scripts-Footnote-184892
+Node: Comments84995
+Node: Quoting87479
+Node: DOS Quoting92996
+Node: Sample Data Files93671
+Node: Very Simple96266
+Node: Two Rules101168
+Node: More Complex103053
+Node: Statements/Lines105919
+Ref: Statements/Lines-Footnote-1110378
+Node: Other Features110643
+Node: When111579
+Ref: When-Footnote-1113333
+Node: Intro Summary113398
+Node: Invoking Gawk114282
+Node: Command Line115796
+Node: Options116594
+Ref: Options-Footnote-1132693
+Ref: Options-Footnote-2132923
+Node: Other Arguments132948
+Node: Naming Standard Input135895
+Node: Environment Variables136988
+Node: AWKPATH Variable137546
+Ref: AWKPATH Variable-Footnote-1140957
+Ref: AWKPATH Variable-Footnote-2140991
+Node: AWKLIBPATH Variable141252
+Node: Other Environment Variables142509
+Node: Exit Status146330
+Node: Include Files147007
+Node: Loading Shared Libraries150602
+Node: Obsolete152030
+Node: Undocumented152722
+Node: Invoking Summary153019
+Node: Regexp154679
+Node: Regexp Usage156133
+Node: Escape Sequences158170
+Node: Regexp Operators164402
+Ref: Regexp Operators-Footnote-1171818
+Ref: Regexp Operators-Footnote-2171965
+Node: Bracket Expressions172063
+Ref: table-char-classes174539
+Node: Leftmost Longest177676
+Node: Computed Regexps178979
+Node: GNU Regexp Operators182406
+Node: Case-sensitivity186085
+Ref: Case-sensitivity-Footnote-1188972
+Ref: Case-sensitivity-Footnote-2189207
+Node: Regexp Summary189315
+Node: Reading Files190781
+Node: Records192944
+Node: awk split records193677
+Node: gawk split records198608
+Ref: gawk split records-Footnote-1203148
+Node: Fields203185
+Node: Nonconstant Fields205926
+Ref: Nonconstant Fields-Footnote-1208162
+Node: Changing Fields208366
+Node: Field Separators214294
+Node: Default Field Splitting216992
+Node: Regexp Field Splitting218110
+Node: Single Character Fields221463
+Node: Command Line Field Separator222523
+Node: Full Line Fields225741
+Ref: Full Line Fields-Footnote-1227263
+Ref: Full Line Fields-Footnote-2227309
+Node: Field Splitting Summary227410
+Node: Constant Size229484
+Node: Splitting By Content234062
+Ref: Splitting By Content-Footnote-1238033
+Node: Multiple Line238196
+Ref: Multiple Line-Footnote-1244078
+Node: Getline244257
+Node: Plain Getline246724
+Node: Getline/Variable249363
+Node: Getline/File250512
+Node: Getline/Variable/File251898
+Ref: Getline/Variable/File-Footnote-1253501
+Node: Getline/Pipe253589
+Node: Getline/Variable/Pipe256294
+Node: Getline/Coprocess257427
+Node: Getline/Variable/Coprocess258692
+Node: Getline Notes259432
+Node: Getline Summary262227
+Ref: table-getline-variants262649
+Node: Read Timeout263397
+Ref: Read Timeout-Footnote-1267303
+Node: Retrying Input267361
+Node: Command-line directories268560
+Node: Input Summary269466
+Node: Input Exercises272638
+Node: Printing273366
+Node: Print275200
+Node: Print Examples276657
+Node: Output Separators279437
+Node: OFMT281454
+Node: Printf282810
+Node: Basic Printf283595
+Node: Control Letters285169
+Node: Format Modifiers289157
+Node: Printf Examples295172
+Node: Redirection297658
+Node: Special FD304499
+Ref: Special FD-Footnote-1307667
+Node: Special Files307741
+Node: Other Inherited Files308358
+Node: Special Network309359
+Node: Special Caveats310219
+Node: Close Files And Pipes311168
+Ref: table-close-pipe-return-values318075
+Ref: Close Files And Pipes-Footnote-1318858
+Ref: Close Files And Pipes-Footnote-2319006
+Node: Nonfatal319158
+Node: Output Summary321483
+Node: Output Exercises322705
+Node: Expressions323384
+Node: Values324572
+Node: Constants325250
+Node: Scalar Constants325941
+Ref: Scalar Constants-Footnote-1326805
+Node: Nondecimal-numbers327055
+Node: Regexp Constants330056
+Node: Using Constant Regexps330582
+Node: Standard Regexp Constants331204
+Node: Strong Regexp Constants334392
+Node: Variables337350
+Node: Using Variables338007
+Node: Assignment Options339917
+Node: Conversion341790
+Node: Strings And Numbers342314
+Ref: Strings And Numbers-Footnote-1345377
+Node: Locale influences conversions345486
+Ref: table-locale-affects348244
+Node: All Operators348862
+Node: Arithmetic Ops349491
+Node: Concatenation351997
+Ref: Concatenation-Footnote-1354844
+Node: Assignment Ops354951
+Ref: table-assign-ops359942
+Node: Increment Ops361255
+Node: Truth Values and Conditions364715
+Node: Truth Values365789
+Node: Typing and Comparison366837
+Node: Variable Typing367657
+Ref: Variable Typing-Footnote-1374120
+Ref: Variable Typing-Footnote-2374192
+Node: Comparison Operators374269
+Ref: table-relational-ops374688
+Node: POSIX String Comparison378183
+Ref: POSIX String Comparison-Footnote-1379878
+Ref: POSIX String Comparison-Footnote-2380017
+Node: Boolean Ops380101
+Ref: Boolean Ops-Footnote-1384583
+Node: Conditional Exp384675
+Node: Function Calls386411
+Node: Precedence390288
+Node: Locales393947
+Node: Expressions Summary395579
+Node: Patterns and Actions398152
+Node: Pattern Overview399272
+Node: Regexp Patterns400949
+Node: Expression Patterns401491
+Node: Ranges405272
+Node: BEGIN/END408380
+Node: Using BEGIN/END409141
+Ref: Using BEGIN/END-Footnote-1411877
+Node: I/O And BEGIN/END411983
+Node: BEGINFILE/ENDFILE414297
+Node: Empty417204
+Node: Using Shell Variables417521
+Node: Action Overview419795
+Node: Statements422120
+Node: If Statement423968
+Node: While Statement425463
+Node: Do Statement427491
+Node: For Statement428639
+Node: Switch Statement431797
+Node: Break Statement434183
+Node: Continue Statement436275
+Node: Next Statement438102
+Node: Nextfile Statement440485
+Node: Exit Statement443137
+Node: Built-in Variables445540
+Node: User-modified446673
+Node: Auto-set454259
+Ref: Auto-set-Footnote-1468912
+Ref: Auto-set-Footnote-2469118
+Node: ARGC and ARGV469174
+Node: Pattern Action Summary473387
+Node: Arrays475817
+Node: Array Basics477146
+Node: Array Intro477990
+Ref: figure-array-elements479965
+Ref: Array Intro-Footnote-1482669
+Node: Reference to Elements482797
+Node: Assigning Elements485261
+Node: Array Example485752
+Node: Scanning an Array487511
+Node: Controlling Scanning490533
+Ref: Controlling Scanning-Footnote-1495932
+Node: Numeric Array Subscripts496248
+Node: Uninitialized Subscripts498432
+Node: Delete500051
+Ref: Delete-Footnote-1502803
+Node: Multidimensional502860
+Node: Multiscanning505955
+Node: Arrays of Arrays507546
+Node: Arrays Summary512313
+Node: Functions514406
+Node: Built-in515444
+Node: Calling Built-in516525
+Node: Numeric Functions518521
+Ref: Numeric Functions-Footnote-1523354
+Ref: Numeric Functions-Footnote-2523711
+Ref: Numeric Functions-Footnote-3523759
+Node: String Functions524031
+Ref: String Functions-Footnote-1547535
+Ref: String Functions-Footnote-2547663
+Ref: String Functions-Footnote-3547911
+Node: Gory Details547998
+Ref: table-sub-escapes549789
+Ref: table-sub-proposed551308
+Ref: table-posix-sub552671
+Ref: table-gensub-escapes554212
+Ref: Gory Details-Footnote-1555035
+Node: I/O Functions555189
+Ref: table-system-return-values561771
+Ref: I/O Functions-Footnote-1563751
+Ref: I/O Functions-Footnote-2563899
+Node: Time Functions564019
+Ref: Time Functions-Footnote-1574541
+Ref: Time Functions-Footnote-2574609
+Ref: Time Functions-Footnote-3574767
+Ref: Time Functions-Footnote-4574878
+Ref: Time Functions-Footnote-5574990
+Ref: Time Functions-Footnote-6575217
+Node: Bitwise Functions575483
+Ref: table-bitwise-ops576077
+Ref: Bitwise Functions-Footnote-1582103
+Ref: Bitwise Functions-Footnote-2582276
+Node: Type Functions582467
+Node: I18N Functions585143
+Node: User-defined586794
+Node: Definition Syntax587599
+Ref: Definition Syntax-Footnote-1593286
+Node: Function Example593357
+Ref: Function Example-Footnote-1596279
+Node: Function Caveats596301
+Node: Calling A Function596819
+Node: Variable Scope597777
+Node: Pass By Value/Reference600771
+Node: Return Statement604270
+Node: Dynamic Typing607249
+Node: Indirect Calls608179
+Ref: Indirect Calls-Footnote-1618430
+Node: Functions Summary618558
+Node: Library Functions621263
+Ref: Library Functions-Footnote-1624870
+Ref: Library Functions-Footnote-2625013
+Node: Library Names625184
+Ref: Library Names-Footnote-1628644
+Ref: Library Names-Footnote-2628867
+Node: General Functions628953
+Node: Strtonum Function630056
+Node: Assert Function633078
+Node: Round Function636404
+Node: Cliff Random Function637945
+Node: Ordinal Functions638961
+Ref: Ordinal Functions-Footnote-1642024
+Ref: Ordinal Functions-Footnote-2642276
+Node: Join Function642486
+Ref: Join Function-Footnote-1644256
+Node: Getlocaltime Function644456
+Node: Readfile Function648198
+Node: Shell Quoting650170
+Node: Data File Management651571
+Node: Filetrans Function652203
+Node: Rewind Function656299
+Node: File Checking658205
+Ref: File Checking-Footnote-1659539
+Node: Empty Files659740
+Node: Ignoring Assigns661719
+Node: Getopt Function663269
+Ref: Getopt Function-Footnote-1674738
+Node: Passwd Functions674938
+Ref: Passwd Functions-Footnote-1683777
+Node: Group Functions683865
+Ref: Group Functions-Footnote-1691763
+Node: Walking Arrays691970
+Node: Library Functions Summary694978
+Node: Library Exercises696384
+Node: Sample Programs696849
+Node: Running Examples697619
+Node: Clones698347
+Node: Cut Program699571
+Node: Egrep Program709500
+Ref: Egrep Program-Footnote-1717012
+Node: Id Program717122
+Node: Split Program720802
+Ref: Split Program-Footnote-1724261
+Node: Tee Program724390
+Node: Uniq Program727180
+Node: Wc Program734606
+Ref: Wc Program-Footnote-1738861
+Node: Miscellaneous Programs738955
+Node: Dupword Program740168
+Node: Alarm Program742198
+Node: Translate Program747053
+Ref: Translate Program-Footnote-1751618
+Node: Labels Program751888
+Ref: Labels Program-Footnote-1755239
+Node: Word Sorting755323
+Node: History Sorting759395
+Node: Extract Program761230
+Node: Simple Sed768759
+Node: Igawk Program771833
+Ref: Igawk Program-Footnote-1786164
+Ref: Igawk Program-Footnote-2786366
+Ref: Igawk Program-Footnote-3786488
+Node: Anagram Program786603
+Node: Signature Program789665
+Node: Programs Summary790912
+Node: Programs Exercises792126
+Ref: Programs Exercises-Footnote-1796255
+Node: Advanced Features796346
+Node: Nondecimal Data798336
+Node: Array Sorting799927
+Node: Controlling Array Traversal800627
+Ref: Controlling Array Traversal-Footnote-1808994
+Node: Array Sorting Functions809112
+Ref: Array Sorting Functions-Footnote-1814203
+Node: Two-way I/O814399
+Ref: Two-way I/O-Footnote-1820949
+Ref: Two-way I/O-Footnote-2821136
+Node: TCP/IP Networking821218
+Node: Profiling824336
+Ref: Profiling-Footnote-1832829
+Node: Advanced Features Summary833152
+Node: Internationalization834996
+Node: I18N and L10N836476
+Node: Explaining gettext837163
+Ref: Explaining gettext-Footnote-1843055
+Ref: Explaining gettext-Footnote-2843240
+Node: Programmer i18n843405
+Ref: Programmer i18n-Footnote-1848354
+Node: Translator i18n848403
+Node: String Extraction849197
+Ref: String Extraction-Footnote-1850329
+Node: Printf Ordering850415
+Ref: Printf Ordering-Footnote-1853201
+Node: I18N Portability853265
+Ref: I18N Portability-Footnote-1855721
+Node: I18N Example855784
+Ref: I18N Example-Footnote-1858590
+Node: Gawk I18N858663
+Node: I18N Summary859308
+Node: Debugger860649
+Node: Debugging861671
+Node: Debugging Concepts862112
+Node: Debugging Terms863921
+Node: Awk Debugging866496
+Node: Sample Debugging Session867402
+Node: Debugger Invocation867936
+Node: Finding The Bug869322
+Node: List of Debugger Commands875800
+Node: Breakpoint Control877133
+Node: Debugger Execution Control880827
+Node: Viewing And Changing Data884189
+Node: Execution Stack887563
+Node: Debugger Info889200
+Node: Miscellaneous Debugger Commands893271
+Node: Readline Support898359
+Node: Limitations899255
+Node: Debugging Summary901364
+Node: Arbitrary Precision Arithmetic902643
+Node: Computer Arithmetic904059
+Ref: table-numeric-ranges907650
+Ref: Computer Arithmetic-Footnote-1908372
+Node: Math Definitions908429
+Ref: table-ieee-formats911743
+Ref: Math Definitions-Footnote-1912346
+Node: MPFR features912451
+Node: FP Math Caution914168
+Ref: FP Math Caution-Footnote-1915240
+Node: Inexactness of computations915609
+Node: Inexact representation916569
+Node: Comparing FP Values917929
+Node: Errors accumulate919011
+Node: Getting Accuracy920444
+Node: Try To Round923154
+Node: Setting precision924053
+Ref: table-predefined-precision-strings924750
+Node: Setting the rounding mode926580
+Ref: table-gawk-rounding-modes926954
+Ref: Setting the rounding mode-Footnote-1930362
+Node: Arbitrary Precision Integers930541
+Ref: Arbitrary Precision Integers-Footnote-1935458
+Node: POSIX Floating Point Problems935607
+Ref: POSIX Floating Point Problems-Footnote-1939489
+Node: Floating point summary939527
+Node: Dynamic Extensions941717
+Node: Extension Intro943270
+Node: Plugin License944536
+Node: Extension Mechanism Outline945333
+Ref: figure-load-extension945772
+Ref: figure-register-new-function947337
+Ref: figure-call-new-function948429
+Node: Extension API Description950491
+Node: Extension API Functions Introduction952064
+Node: General Data Types957375
+Ref: General Data Types-Footnote-1963330
+Node: Memory Allocation Functions963629
+Ref: Memory Allocation Functions-Footnote-1966474
+Node: Constructor Functions966573
+Node: Registration Functions968318
+Node: Extension Functions969003
+Node: Exit Callback Functions971626
+Node: Extension Version String972876
+Node: Input Parsers973539
+Node: Output Wrappers983421
+Node: Two-way processors987933
+Node: Printing Messages990198
+Ref: Printing Messages-Footnote-1991369
+Node: Updating ERRNO991522
+Node: Requesting Values992261
+Ref: table-value-types-returned992998
+Node: Accessing Parameters993881
+Node: Symbol Table Access995116
+Node: Symbol table by name995628
+Node: Symbol table by cookie997649
+Ref: Symbol table by cookie-Footnote-11001801
+Node: Cached values1001865
+Ref: Cached values-Footnote-11005372
+Node: Array Manipulation1005463
+Ref: Array Manipulation-Footnote-11006554
+Node: Array Data Types1006591
+Ref: Array Data Types-Footnote-11009249
+Node: Array Functions1009341
+Node: Flattening Arrays1013199
+Node: Creating Arrays1020107
+Node: Redirection API1024876
+Node: Extension API Variables1027707
+Node: Extension Versioning1028340
+Ref: gawk-api-version1028777
+Node: Extension API Informational Variables1030533
+Node: Extension API Boilerplate1031597
+Node: Finding Extensions1035411
+Node: Extension Example1035970
+Node: Internal File Description1036768
+Node: Internal File Ops1040848
+Ref: Internal File Ops-Footnote-11052610
+Node: Using Internal File Ops1052750
+Ref: Using Internal File Ops-Footnote-11055133
+Node: Extension Samples1055407
+Node: Extension Sample File Functions1056936
+Node: Extension Sample Fnmatch1064585
+Node: Extension Sample Fork1066072
+Node: Extension Sample Inplace1067290
+Node: Extension Sample Ord1070500
+Node: Extension Sample Readdir1071336
+Ref: table-readdir-file-types1072225
+Node: Extension Sample Revout1073030
+Node: Extension Sample Rev2way1073619
+Node: Extension Sample Read write array1074359
+Node: Extension Sample Readfile1076301
+Node: Extension Sample Time1077396
+Node: Extension Sample API Tests1078744
+Node: gawkextlib1079236
+Node: Extension summary1081683
+Node: Extension Exercises1085385
+Node: Language History1086883
+Node: V7/SVR3.11088539
+Node: SVR41090691
+Node: POSIX1092125
+Node: BTL1093504
+Node: POSIX/GNU1094233
+Node: Feature History1100095
+Node: Common Extensions1114465
+Node: Ranges and Locales1115748
+Ref: Ranges and Locales-Footnote-11120364
+Ref: Ranges and Locales-Footnote-21120391
+Ref: Ranges and Locales-Footnote-31120626
+Node: Contributors1120847
+Node: History summary1126407
+Node: Installation1127787
+Node: Gawk Distribution1128731
+Node: Getting1129215
+Node: Extracting1130176
+Node: Distribution contents1131814
+Node: Unix Installation1137899
+Node: Quick Installation1138581
+Node: Shell Startup Files1140995
+Node: Additional Configuration Options1142073
+Node: Configuration Philosophy1143878
+Node: Non-Unix Installation1146247
+Node: PC Installation1146707
+Node: PC Binary Installation1147545
+Node: PC Compiling1147980
+Node: PC Using1149097
+Node: Cygwin1152142
+Node: MSYS1152912
+Node: VMS Installation1153413
+Node: VMS Compilation1154204
+Ref: VMS Compilation-Footnote-11155433
+Node: VMS Dynamic Extensions1155491
+Node: VMS Installation Details1157176
+Node: VMS Running1159429
+Node: VMS GNV1163708
+Node: VMS Old Gawk1164443
+Node: Bugs1164914
+Node: Bug address1165577
+Node: Usenet1167974
+Node: Maintainers1168749
+Node: Other Versions1170125
+Node: Installation summary1176709
+Node: Notes1177744
+Node: Compatibility Mode1178609
+Node: Additions1179391
+Node: Accessing The Source1180316
+Node: Adding Code1181751
+Node: New Ports1187970
+Node: Derived Files1192458
+Ref: Derived Files-Footnote-11197943
+Ref: Derived Files-Footnote-21197978
+Ref: Derived Files-Footnote-31198576
+Node: Future Extensions1198690
+Node: Implementation Limitations1199348
+Node: Extension Design1200531
+Node: Old Extension Problems1201685
+Ref: Old Extension Problems-Footnote-11203203
+Node: Extension New Mechanism Goals1203260
+Ref: Extension New Mechanism Goals-Footnote-11206624
+Node: Extension Other Design Decisions1206813
+Node: Extension Future Growth1208926
+Node: Old Extension Mechanism1209762
+Node: Notes summary1211525
+Node: Basic Concepts1212707
+Node: Basic High Level1213388
+Ref: figure-general-flow1213670
+Ref: figure-process-flow1214355
+Ref: Basic High Level-Footnote-11217656
+Node: Basic Data Typing1217841
+Node: Glossary1221169
+Node: Copying1253116
+Node: GNU Free Documentation License1290655
+Node: Index1315773

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 2be7d8f1..5f3d6efa 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -539,7 +539,6 @@ particular records in a file and perform operations upon them.
* Computed Regexps:: Using Dynamic Regexps.
* GNU Regexp Operators:: Operators specific to GNU software.
* Case-sensitivity:: How to do case-insensitive matching.
-* Strong Regexp Constants:: Strongly typed regexp constants.
* Regexp Summary:: Regular expressions summary.
* Records:: Controlling how data is split into
records.
@@ -622,6 +621,9 @@ particular records in a file and perform operations upon them.
* Nondecimal-numbers:: What are octal and hex numbers.
* Regexp Constants:: Regular Expression constants.
* Using Constant Regexps:: When and how to use a regexp constant.
+* Standard Regexp Constants:: Regexp constants in standard
+ @command{awk}.
+* Strong Regexp Constants:: Strongly typed regexp constants.
* Variables:: Variables give names to values for
later use.
* Using Variables:: Using variables in your programs.
@@ -924,7 +926,8 @@ particular records in a file and perform operations upon them.
* Array Functions:: Functions for working with arrays.
* Flattening Arrays:: How to flatten arrays.
* Creating Arrays:: How to create and populate arrays.
-* Redirection API:: How to access and manipulate redirections.
+* Redirection API:: How to access and manipulate
+ redirections.
* Extension API Variables:: Variables provided by the API.
* Extension Versioning:: API Version information.
* Extension API Informational Variables:: Variables providing information about
@@ -988,10 +991,11 @@ particular records in a file and perform operations upon them.
* Configuration Philosophy:: How it's all supposed to work.
* Non-Unix Installation:: Installation on Other Operating
Systems.
-* PC Installation:: Installing and Compiling @command{gawk} on
- Microsoft Windows.
+* PC Installation:: Installing and Compiling
+ @command{gawk} on Microsoft Windows.
* PC Binary Installation:: Installing a prepared distribution.
-* PC Compiling:: Compiling @command{gawk} for Windows32.
+* PC Compiling:: Compiling @command{gawk} for
+ Windows32.
* PC Using:: Running @command{gawk} on Windows32.
* Cygwin:: Building and running @command{gawk}
for Cygwin.
@@ -5004,7 +5008,6 @@ regular expressions work, we present more complicated instances.
* Computed Regexps:: Using Dynamic Regexps.
* GNU Regexp Operators:: Operators specific to GNU software.
* Case-sensitivity:: How to do case-insensitive matching.
-* Strong Regexp Constants:: Strongly typed regexp constants.
* Regexp Summary:: Regular expressions summary.
@end menu
@@ -6265,25 +6268,6 @@ The value of @code{IGNORECASE} has no effect if @command{gawk} is in
compatibility mode (@pxref{Options}).
Case is always significant in compatibility mode.
-@node Strong Regexp Constants
-@section Strongly Typed Regexp Constants
-
-This @value{SECTION} describes a @command{gawk}-specific feature.
-
-Regexp constants (@code{/@dots{}/}) hold a strange position in the
-@command{awk} language. In most contexts, they act like an expression:
-@samp{$0 ~ /@dots{}/}. In other contexts, they denote only a regexp to
-be matched. In no case are they really a ``first class citizen'' of the
-language. That is, you cannot define a scalar variable whose type is
-``regexp'' in the same sense that you can define a variable to be a
-number or a string:
-
-@example
-num = 42 @ii{Numeric variable}
-str = "hi" @ii{String variable}
-re = /foo/ @ii{Wrong!} re @ii{is the result of} $0 ~ /foo/
-@end example
-
@node Regexp Summary
@section Summary
@@ -10794,7 +10778,7 @@ Just as @samp{11} in decimal is 1 times 10 plus 1, so
@samp{11} in octal is 1 times 8 plus 1. This equals 9 in decimal.
In hexadecimal, there are 16 digits. Because the everyday decimal
number system only has ten digits (@samp{0}--@samp{9}), the letters
-@samp{a} through @samp{f} are used to represent the rest.
+@samp{a} through @samp{f} represent the rest.
(Case in the letters is usually irrelevant; hexadecimal @samp{a} and @samp{A}
have the same value.)
Thus, @samp{11} in
@@ -10926,6 +10910,20 @@ but could be more complex expressions).
@node Using Constant Regexps
@subsection Using Regular Expression Constants
+Regular expression constants consist of text describing
+a regular expression enclosed in slashes (such as @code{/the +answer/}).
+This @value{SECTION} describes how such constants work in
+POSIX @command{awk} and @command{gawk}, and then goes on to describe
+@dfn{strongly typed regexp constants}, which are a @command{gawk} extension.
+
+@menu
+* Standard Regexp Constants:: Regexp constants in standard @command{awk}.
+* Strong Regexp Constants:: Strongly typed regexp constants.
+@end menu
+
+@node Standard Regexp Constants
+@subsubsection Standard Regular Expression Constants
+
@cindex dark corner, regexp constants
When used on the righthand side of the @samp{~} or @samp{!~}
operators, a regexp constant merely stands for the regexp that is to be
@@ -11033,6 +11031,90 @@ or not @code{$0} matches @code{/hi/}.
a parameter to a user-defined function, because passing a truth value in
this way is probably not what was intended.
+@node Strong Regexp Constants
+@subsubsection Strongly Typed Regexp Constants
+
+This @value{SECTION} describes a @command{gawk}-specific feature.
+
+As we saw in the previous @value{SECTION},
+regexp constants (@code{/@dots{}/}) hold a strange position in the
+@command{awk} language. In most contexts, they act like an expression:
+@samp{$0 ~ /@dots{}/}. In other contexts, they denote only a regexp to
+be matched. In no case are they really a ``first class citizen'' of the
+language. That is, you cannot define a scalar variable whose type is
+``regexp'' in the same sense that you can define a variable to be a
+number or a string:
+
+@example
+num = 42 @ii{Numeric variable}
+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,
+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 everywhere 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})
+and on to 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 Variables
@subsection Variables
@@ -12213,7 +12295,8 @@ are @emph{dynamically} typed. This means their type can change as the
program runs, from @dfn{untyped} before any use,@footnote{@command{gawk}
calls this @dfn{unassigned}, as the following example shows.} to string
or number, and then from string to number or number to string, as the
-program progresses.
+program progresses. (@command{gawk} also provides regexp-typed scalars,
+but let's ignore that for now; @pxref{Strong Regexp Constants}.)
You can't do much with untyped variables, other than tell that they
are untyped. The following program tests @code{a} against @code{""}
@@ -19727,6 +19810,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.
@@ -19784,7 +19870,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
@@ -32232,7 +32319,8 @@ This (rather large) @value{SECTION} describes the API in detail.
* Symbol Table Access:: Functions for accessing global
variables.
* Array Manipulation:: Functions for working with arrays.
-* Redirection API:: How to access and manipulate redirections.
+* Redirection API:: How to access and manipulate
+ redirections.
* Extension API Variables:: Variables provided by the API.
* Extension API Boilerplate:: Boilerplate code for using the API.
@end menu
@@ -32379,9 +32467,9 @@ and output from files.
@quotation NOTE
String values passed to an extension by @command{gawk} are always
-@sc{NUL}-terminated. Thus it is safe to pass such string values to
+@sc{nul}-terminated. Thus it is safe to pass such string values to
standard library and system routines. However, because
-@command{gawk} allows embedded @sc{NUL} characters in string data,
+@command{gawk} allows embedded @sc{nul} characters in string data,
you should check that @samp{strlen(@var{some_string})} matches
the length for that string passed to the extension before using
it as a regular C string.
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 76c3a9b2..857be3ab 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -534,7 +534,6 @@ particular records in a file and perform operations upon them.
* Computed Regexps:: Using Dynamic Regexps.
* GNU Regexp Operators:: Operators specific to GNU software.
* Case-sensitivity:: How to do case-insensitive matching.
-* Strong Regexp Constants:: Strongly typed regexp constants.
* Regexp Summary:: Regular expressions summary.
* Records:: Controlling how data is split into
records.
@@ -617,6 +616,9 @@ particular records in a file and perform operations upon them.
* Nondecimal-numbers:: What are octal and hex numbers.
* Regexp Constants:: Regular Expression constants.
* Using Constant Regexps:: When and how to use a regexp constant.
+* Standard Regexp Constants:: Regexp constants in standard
+ @command{awk}.
+* Strong Regexp Constants:: Strongly typed regexp constants.
* Variables:: Variables give names to values for
later use.
* Using Variables:: Using variables in your programs.
@@ -919,7 +921,8 @@ particular records in a file and perform operations upon them.
* Array Functions:: Functions for working with arrays.
* Flattening Arrays:: How to flatten arrays.
* Creating Arrays:: How to create and populate arrays.
-* Redirection API:: How to access and manipulate redirections.
+* Redirection API:: How to access and manipulate
+ redirections.
* Extension API Variables:: Variables provided by the API.
* Extension Versioning:: API Version information.
* Extension API Informational Variables:: Variables providing information about
@@ -983,10 +986,11 @@ particular records in a file and perform operations upon them.
* Configuration Philosophy:: How it's all supposed to work.
* Non-Unix Installation:: Installation on Other Operating
Systems.
-* PC Installation:: Installing and Compiling @command{gawk} on
- Microsoft Windows.
+* PC Installation:: Installing and Compiling
+ @command{gawk} on Microsoft Windows.
* PC Binary Installation:: Installing a prepared distribution.
-* PC Compiling:: Compiling @command{gawk} for Windows32.
+* PC Compiling:: Compiling @command{gawk} for
+ Windows32.
* PC Using:: Running @command{gawk} on Windows32.
* Cygwin:: Building and running @command{gawk}
for Cygwin.
@@ -4915,7 +4919,6 @@ regular expressions work, we present more complicated instances.
* Computed Regexps:: Using Dynamic Regexps.
* GNU Regexp Operators:: Operators specific to GNU software.
* Case-sensitivity:: How to do case-insensitive matching.
-* Strong Regexp Constants:: Strongly typed regexp constants.
* Regexp Summary:: Regular expressions summary.
@end menu
@@ -6049,25 +6052,6 @@ The value of @code{IGNORECASE} has no effect if @command{gawk} is in
compatibility mode (@pxref{Options}).
Case is always significant in compatibility mode.
-@node Strong Regexp Constants
-@section Strongly Typed Regexp Constants
-
-This @value{SECTION} describes a @command{gawk}-specific feature.
-
-Regexp constants (@code{/@dots{}/}) hold a strange position in the
-@command{awk} language. In most contexts, they act like an expression:
-@samp{$0 ~ /@dots{}/}. In other contexts, they denote only a regexp to
-be matched. In no case are they really a ``first class citizen'' of the
-language. That is, you cannot define a scalar variable whose type is
-``regexp'' in the same sense that you can define a variable to be a
-number or a string:
-
-@example
-num = 42 @ii{Numeric variable}
-str = "hi" @ii{String variable}
-re = /foo/ @ii{Wrong!} re @ii{is the result of} $0 ~ /foo/
-@end example
-
@node Regexp Summary
@section Summary
@@ -10281,7 +10265,7 @@ Just as @samp{11} in decimal is 1 times 10 plus 1, so
@samp{11} in octal is 1 times 8 plus 1. This equals 9 in decimal.
In hexadecimal, there are 16 digits. Because the everyday decimal
number system only has ten digits (@samp{0}--@samp{9}), the letters
-@samp{a} through @samp{f} are used to represent the rest.
+@samp{a} through @samp{f} represent the rest.
(Case in the letters is usually irrelevant; hexadecimal @samp{a} and @samp{A}
have the same value.)
Thus, @samp{11} in
@@ -10384,6 +10368,20 @@ but could be more complex expressions).
@node Using Constant Regexps
@subsection Using Regular Expression Constants
+Regular expression constants consist of text describing
+a regular expression enclosed in slashes (such as @code{/the +answer/}).
+This @value{SECTION} describes how such constants work in
+POSIX @command{awk} and @command{gawk}, and then goes on to describe
+@dfn{strongly typed regexp constants}, which are a @command{gawk} extension.
+
+@menu
+* Standard Regexp Constants:: Regexp constants in standard @command{awk}.
+* Strong Regexp Constants:: Strongly typed regexp constants.
+@end menu
+
+@node Standard Regexp Constants
+@subsubsection Standard Regular Expression Constants
+
@cindex dark corner, regexp constants
When used on the righthand side of the @samp{~} or @samp{!~}
operators, a regexp constant merely stands for the regexp that is to be
@@ -10491,6 +10489,90 @@ or not @code{$0} matches @code{/hi/}.
a parameter to a user-defined function, because passing a truth value in
this way is probably not what was intended.
+@node Strong Regexp Constants
+@subsubsection Strongly Typed Regexp Constants
+
+This @value{SECTION} describes a @command{gawk}-specific feature.
+
+As we saw in the previous @value{SECTION},
+regexp constants (@code{/@dots{}/}) hold a strange position in the
+@command{awk} language. In most contexts, they act like an expression:
+@samp{$0 ~ /@dots{}/}. In other contexts, they denote only a regexp to
+be matched. In no case are they really a ``first class citizen'' of the
+language. That is, you cannot define a scalar variable whose type is
+``regexp'' in the same sense that you can define a variable to be a
+number or a string:
+
+@example
+num = 42 @ii{Numeric variable}
+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,
+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 everywhere 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})
+and on to 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 Variables
@subsection Variables
@@ -11532,7 +11614,8 @@ are @emph{dynamically} typed. This means their type can change as the
program runs, from @dfn{untyped} before any use,@footnote{@command{gawk}
calls this @dfn{unassigned}, as the following example shows.} to string
or number, and then from string to number or number to string, as the
-program progresses.
+program progresses. (@command{gawk} also provides regexp-typed scalars,
+but let's ignore that for now; @pxref{Strong Regexp Constants}.)
You can't do much with untyped variables, other than tell that they
are untyped. The following program tests @code{a} against @code{""}
@@ -18771,6 +18854,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.
@@ -18828,7 +18914,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
@@ -31246,7 +31333,8 @@ This (rather large) @value{SECTION} describes the API in detail.
* Symbol Table Access:: Functions for accessing global
variables.
* Array Manipulation:: Functions for working with arrays.
-* Redirection API:: How to access and manipulate redirections.
+* Redirection API:: How to access and manipulate
+ redirections.
* Extension API Variables:: Variables provided by the API.
* Extension API Boilerplate:: Boilerplate code for using the API.
@end menu
@@ -31393,9 +31481,9 @@ and output from files.
@quotation NOTE
String values passed to an extension by @command{gawk} are always
-@sc{NUL}-terminated. Thus it is safe to pass such string values to
+@sc{nul}-terminated. Thus it is safe to pass such string values to
standard library and system routines. However, because
-@command{gawk} allows embedded @sc{NUL} characters in string data,
+@command{gawk} allows embedded @sc{nul} characters in string data,
you should check that @samp{strlen(@var{some_string})} matches
the length for that string passed to the extension before using
it as a regular C string.
diff --git a/doc/wordlist b/doc/wordlist
index 8c74d9d5..45fc5d8e 100644
--- a/doc/wordlist
+++ b/doc/wordlist
@@ -1703,6 +1703,7 @@ strerror
strftime
strlen
strnum
+strnums
strtod
strtonum
struct
diff --git a/eval.c b/eval.c
index 2d07a804..ab77016d 100644
--- a/eval.c
+++ b/eval.c
@@ -449,6 +449,7 @@ flags2str(int flagval)
{ HALFHAT, "HALFHAT" },
{ XARRAY, "XARRAY" },
{ NUMCONSTSTR, "NUMCONSTSTR" },
+ { REGEX, "REGEX" },
{ 0, NULL },
};
diff --git a/field.c b/field.c
index 2e5cc1d5..0799fb1b 100644
--- a/field.c
+++ b/field.c
@@ -952,6 +952,9 @@ do_split(int nargs)
return make_number((AWKNUM) 0);
}
+ if ((sep->flags & REGEX) != 0)
+ sep = sep->typed_re;
+
if ( (sep->re_flags & FS_DFLT) != 0
&& current_field_sep() == Using_FS
&& ! RS_is_null) {
@@ -1014,6 +1017,9 @@ do_patsplit(int nargs)
src = TOP_STRING();
+ if ((sep->flags & REGEX) != 0)
+ sep = sep->typed_re;
+
fpat = sep->re_exp;
if (fpat->stlen == 0)
fatal(_("patsplit: third argument must be non-null"));
diff --git a/interpret.h b/interpret.h
index 816a6efa..da8e0604 100644
--- a/interpret.h
+++ b/interpret.h
@@ -994,6 +994,9 @@ arrayfor:
r = POP_STRING();
unref(m->re_exp);
m->re_exp = r;
+ } else if (m->type == Node_val) {
+ assert((m->flags & REGEX) != 0);
+ UPREF(m);
}
PUSH(m);
break;
diff --git a/profile.c b/profile.c
index 80f68607..ebb7b7e6 100644
--- a/profile.c
+++ b/profile.c
@@ -32,7 +32,8 @@ static void parenthesize(int type, NODE *left, NODE *right);
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_string_or_typed_regex(const char *in_str, size_t len, int delim, bool typed_regex);
+static char *pp_typed_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,19 @@ cleanup:
break;
case Op_push_re:
- if (pc->memory->type != Node_regex)
+ if (pc->memory->type != Node_regex && (pc->memory->flags & REGEX) == 0)
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) {
+ NODE *re = pc->memory->re_exp;
+ str = pp_string(re->stptr, re->stlen, '/');
+ } else {
+ assert((pc->memory->flags & REGEX) != 0);
+ str = pp_typed_regex(pc->memory->stptr, pc->memory->stlen, '/');
+ }
pp_push(pc->opcode, str, CAN_FREE);
}
break;
@@ -668,6 +674,10 @@ cleanup:
txt = t2->pp_str;
str = pp_group3(txt, op2str(pc->opcode), restr);
pp_free(t2);
+ } else if (m->type == Node_val && (m->flags & REGEX) != 0) {
+ restr = pp_typed_regex(m->stptr, m->stlen, '/');
+ str = pp_group3(txt, op2str(pc->opcode), restr);
+ efree(restr);
} else {
NODE *re = m->re_exp;
restr = pp_string(re->stptr, re->stlen, '/');
@@ -1407,14 +1417,21 @@ parenthesize(int type, NODE *left, NODE *right)
char *
pp_string(const char *in_str, size_t len, int delim)
{
- return pp_string_or_strong_regex(in_str, len, delim, false);
+ return pp_string_or_typed_regex(in_str, len, delim, false);
}
+/* pp_typed_regex --- pretty format a hard regex constant */
-/* pp_string_or_strong_regex --- pretty format a string, regex, or hard regex constant */
+static char *
+pp_typed_regex(const char *in_str, size_t len, int delim)
+{
+ return pp_string_or_typed_regex(in_str, len, delim, true);
+}
+
+/* pp_string_or_typed_regex --- pretty format a string, regex, or typed regex constant */
char *
-pp_string_or_strong_regex(const char *in_str, size_t len, int delim, bool strong_regex)
+pp_string_or_typed_regex(const char *in_str, size_t len, int delim, bool typed_regex)
{
static char str_escapes[] = "\a\b\f\n\r\t\v\\";
static char str_printables[] = "abfnrtv\\";
@@ -1448,11 +1465,14 @@ pp_string_or_strong_regex(const char *in_str, size_t len, int delim, bool strong
} ofre -= (l)
/* initial size; 3 for delim + terminating null, 1 for @ */
- osiz = len + 3 + 1 + (strong_regex == true);
+ osiz = len + 3 + 1 + (typed_regex == true);
emalloc(obuf, char *, osiz, "pp_string");
obufout = obuf;
ofre = osiz - 1;
+ if (typed_regex)
+ *obufout++ = '@';
+
*obufout++ = delim;
for (; len > 0; len--, str++) {
chksize(2); /* make space for 2 chars */
diff --git a/re.c b/re.c
index fd3ef9ef..dcb06671 100644
--- a/re.c
+++ b/re.c
@@ -345,6 +345,9 @@ re_update(NODE *t)
{
NODE *t1;
+ if (t->type == Node_val && (t->flags & REGEX) != 0)
+ return t->typed_re->re_reg;
+
if ((t->re_flags & CASE) == IGNORECASE) {
/* regex was compiled with settings matching IGNORECASE */
if ((t->re_flags & CONSTANT) != 0) {
diff --git a/test/ChangeLog b/test/ChangeLog
index 586063e1..40988c56 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -43,6 +43,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 c48e8402..035e96ec 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1203,15 +1203,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 \
@@ -1233,7 +1229,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 415b36eb..d96343b0 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1459,15 +1459,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 \
@@ -1489,7 +1485,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
@@ -3834,21 +3830,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: $$? >>_$@
@@ -4299,6 +4280,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 ebdf6901..7a5acf50 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1032,21 +1032,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: $$? >>_$@
@@ -1497,6 +1482,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