diff options
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | awk.h | 3 | ||||
-rw-r--r-- | awkgram.c | 764 | ||||
-rw-r--r-- | awkgram.y | 46 | ||||
-rw-r--r-- | builtin.c | 2 | ||||
-rw-r--r-- | command.c | 6 | ||||
-rw-r--r-- | command.y | 6 | ||||
-rw-r--r-- | doc/ChangeLog | 5 | ||||
-rw-r--r-- | doc/gawk.info | 909 | ||||
-rw-r--r-- | doc/gawk.texi | 15 | ||||
-rw-r--r-- | doc/gawktexi.in | 15 | ||||
-rw-r--r-- | eval.c | 1 | ||||
-rw-r--r-- | ext.c | 30 | ||||
-rw-r--r-- | main.c | 4 | ||||
-rw-r--r-- | node.c | 4 |
16 files changed, 943 insertions, 886 deletions
@@ -1,3 +1,18 @@ +2014-09-15 Arnold D. Robbins <arnold@skeeve.com> + + Finish removing use of isalpha and isalnum. + + * awk.h (is_alpha, is_alnum, is_identchar): Add declarations. + * awkgram.y (yylex): Use is_alpha. + (is_alpha, is_alnum): New functions. + (is_identchar): Use is_alnum. + * builtin.c (r_format_tree): Use is_alpha, is_alnum. + * command.y (yylex): Use is_alpha, is_identchar. + * ext.c (is_letter): Use is_alpha. + (is_identifier_char): Removed; replaced uses with is_identchar. + * main.c (arg_assign): Use is_alpha, is_alnum. + * node.c (r_force_number): Use is_alpha. + 2014-09-14 Arnold D. Robbins <arnold@skeeve.com> * awkgram.y (is_identchar): Change from simple macro to function @@ -23,6 +23,10 @@ Changes from 4.1.1 to 4.1.2 5. Indirect function calls now work for both built-in and extension functions. +6. In non-English locales, it was accidentally possible to use "letters" + beside those of the English alphabet in identifiers. This has + been fixed. (isalpha and isalnum are NOT our friends.) + XX. A number of bugs have been fixed. See the ChangeLog. Changes from 4.1.0 to 4.1.1 @@ -1372,6 +1372,9 @@ extern void negate_num(NODE *n); typedef NODE *(*builtin_func_t)(int); /* function that implements a built-in */ extern builtin_func_t lookup_builtin(const char *name); extern void install_builtins(void); +extern bool is_alpha(int c); +extern bool is_alnum(int c); +extern bool is_identchar(int c); /* builtin.c */ extern double double_to_int(double d); extern NODE *do_exp(int nargs); @@ -195,9 +195,7 @@ extern double fmod(double x, double y); #define YYSTYPE INSTRUCTION * -static bool is_identchar(int c); - -#line 201 "awkgram.c" /* yacc.c:339 */ +#line 199 "awkgram.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -351,7 +349,7 @@ int yyparse (void); /* Copy the second part of user declarations. */ -#line 355 "awkgram.c" /* yacc.c:358 */ +#line 353 "awkgram.c" /* yacc.c:358 */ #ifdef short # undef short @@ -653,25 +651,25 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 200, 200, 202, 207, 208, 214, 226, 230, 241, - 247, 252, 260, 268, 270, 275, 283, 285, 291, 292, - 294, 320, 331, 342, 348, 357, 367, 369, 371, 377, - 382, 383, 387, 406, 405, 439, 441, 446, 447, 460, - 465, 466, 470, 472, 474, 481, 571, 613, 655, 768, - 775, 782, 792, 801, 810, 819, 830, 846, 845, 869, - 881, 881, 979, 979, 1012, 1042, 1048, 1049, 1055, 1056, - 1063, 1068, 1080, 1094, 1096, 1104, 1109, 1111, 1119, 1121, - 1130, 1131, 1139, 1144, 1144, 1155, 1159, 1167, 1168, 1171, - 1173, 1178, 1179, 1188, 1189, 1194, 1199, 1205, 1207, 1209, - 1216, 1217, 1223, 1224, 1229, 1231, 1236, 1238, 1246, 1251, - 1260, 1267, 1269, 1271, 1287, 1297, 1304, 1306, 1311, 1313, - 1315, 1323, 1325, 1330, 1332, 1337, 1339, 1341, 1391, 1393, - 1395, 1397, 1399, 1401, 1403, 1405, 1419, 1424, 1429, 1454, - 1460, 1462, 1464, 1466, 1468, 1470, 1475, 1479, 1511, 1513, - 1519, 1525, 1538, 1539, 1540, 1545, 1550, 1554, 1558, 1573, - 1586, 1591, 1627, 1645, 1646, 1652, 1653, 1658, 1660, 1667, - 1684, 1701, 1703, 1710, 1715, 1723, 1733, 1745, 1754, 1758, - 1762, 1766, 1770, 1774, 1777, 1779, 1783, 1787, 1791 + 0, 198, 198, 200, 205, 206, 212, 224, 228, 239, + 245, 250, 258, 266, 268, 273, 281, 283, 289, 290, + 292, 318, 329, 340, 346, 355, 365, 367, 369, 375, + 380, 381, 385, 404, 403, 437, 439, 444, 445, 458, + 463, 464, 468, 470, 472, 479, 569, 611, 653, 766, + 773, 780, 790, 799, 808, 817, 828, 844, 843, 867, + 879, 879, 977, 977, 1010, 1040, 1046, 1047, 1053, 1054, + 1061, 1066, 1078, 1092, 1094, 1102, 1107, 1109, 1117, 1119, + 1128, 1129, 1137, 1142, 1142, 1153, 1157, 1165, 1166, 1169, + 1171, 1176, 1177, 1186, 1187, 1192, 1197, 1203, 1205, 1207, + 1214, 1215, 1221, 1222, 1227, 1229, 1234, 1236, 1244, 1249, + 1258, 1265, 1267, 1269, 1285, 1295, 1302, 1304, 1309, 1311, + 1313, 1321, 1323, 1328, 1330, 1335, 1337, 1339, 1389, 1391, + 1393, 1395, 1397, 1399, 1401, 1403, 1417, 1422, 1427, 1452, + 1458, 1460, 1462, 1464, 1466, 1468, 1473, 1477, 1509, 1511, + 1517, 1523, 1536, 1537, 1538, 1543, 1548, 1552, 1556, 1571, + 1584, 1589, 1625, 1643, 1644, 1650, 1651, 1656, 1658, 1665, + 1682, 1699, 1701, 1708, 1713, 1721, 1731, 1743, 1752, 1756, + 1760, 1764, 1768, 1772, 1775, 1777, 1781, 1785, 1789 }; #endif @@ -1844,26 +1842,26 @@ yyreduce: switch (yyn) { case 3: -#line 203 "awkgram.y" /* yacc.c:1646 */ +#line 201 "awkgram.y" /* yacc.c:1646 */ { rule = 0; yyerrok; } -#line 1853 "awkgram.c" /* yacc.c:1646 */ +#line 1851 "awkgram.c" /* yacc.c:1646 */ break; case 5: -#line 209 "awkgram.y" /* yacc.c:1646 */ +#line 207 "awkgram.y" /* yacc.c:1646 */ { next_sourcefile(); if (sourcefile == srcfiles) process_deferred(); } -#line 1863 "awkgram.c" /* yacc.c:1646 */ +#line 1861 "awkgram.c" /* yacc.c:1646 */ break; case 6: -#line 215 "awkgram.y" /* yacc.c:1646 */ +#line 213 "awkgram.y" /* yacc.c:1646 */ { rule = 0; /* @@ -1872,19 +1870,19 @@ yyreduce: */ /* yyerrok; */ } -#line 1876 "awkgram.c" /* yacc.c:1646 */ +#line 1874 "awkgram.c" /* yacc.c:1646 */ break; case 7: -#line 227 "awkgram.y" /* yacc.c:1646 */ +#line 225 "awkgram.y" /* yacc.c:1646 */ { (void) append_rule((yyvsp[-1]), (yyvsp[0])); } -#line 1884 "awkgram.c" /* yacc.c:1646 */ +#line 1882 "awkgram.c" /* yacc.c:1646 */ break; case 8: -#line 231 "awkgram.y" /* yacc.c:1646 */ +#line 229 "awkgram.y" /* yacc.c:1646 */ { if (rule != Rule) { msg(_("%s blocks must have an action part"), ruletab[rule]); @@ -1895,39 +1893,39 @@ yyreduce: } else /* pattern rule with non-empty pattern */ (void) append_rule((yyvsp[-1]), NULL); } -#line 1899 "awkgram.c" /* yacc.c:1646 */ +#line 1897 "awkgram.c" /* yacc.c:1646 */ break; case 9: -#line 242 "awkgram.y" /* yacc.c:1646 */ +#line 240 "awkgram.y" /* yacc.c:1646 */ { in_function = NULL; (void) mk_function((yyvsp[-1]), (yyvsp[0])); yyerrok; } -#line 1909 "awkgram.c" /* yacc.c:1646 */ +#line 1907 "awkgram.c" /* yacc.c:1646 */ break; case 10: -#line 248 "awkgram.y" /* yacc.c:1646 */ +#line 246 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } -#line 1918 "awkgram.c" /* yacc.c:1646 */ +#line 1916 "awkgram.c" /* yacc.c:1646 */ break; case 11: -#line 253 "awkgram.y" /* yacc.c:1646 */ +#line 251 "awkgram.y" /* yacc.c:1646 */ { want_source = false; yyerrok; } -#line 1927 "awkgram.c" /* yacc.c:1646 */ +#line 1925 "awkgram.c" /* yacc.c:1646 */ break; case 12: -#line 261 "awkgram.y" /* yacc.c:1646 */ +#line 259 "awkgram.y" /* yacc.c:1646 */ { if (include_source((yyvsp[0])) < 0) YYABORT; @@ -1935,23 +1933,23 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1939 "awkgram.c" /* yacc.c:1646 */ +#line 1937 "awkgram.c" /* yacc.c:1646 */ break; case 13: -#line 269 "awkgram.y" /* yacc.c:1646 */ +#line 267 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1945 "awkgram.c" /* yacc.c:1646 */ +#line 1943 "awkgram.c" /* yacc.c:1646 */ break; case 14: -#line 271 "awkgram.y" /* yacc.c:1646 */ +#line 269 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1951 "awkgram.c" /* yacc.c:1646 */ +#line 1949 "awkgram.c" /* yacc.c:1646 */ break; case 15: -#line 276 "awkgram.y" /* yacc.c:1646 */ +#line 274 "awkgram.y" /* yacc.c:1646 */ { if (load_library((yyvsp[0])) < 0) YYABORT; @@ -1959,35 +1957,35 @@ yyreduce: bcfree((yyvsp[0])); (yyval) = NULL; } -#line 1963 "awkgram.c" /* yacc.c:1646 */ +#line 1961 "awkgram.c" /* yacc.c:1646 */ break; case 16: -#line 284 "awkgram.y" /* yacc.c:1646 */ +#line 282 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1969 "awkgram.c" /* yacc.c:1646 */ +#line 1967 "awkgram.c" /* yacc.c:1646 */ break; case 17: -#line 286 "awkgram.y" /* yacc.c:1646 */ +#line 284 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 1975 "awkgram.c" /* yacc.c:1646 */ +#line 1973 "awkgram.c" /* yacc.c:1646 */ break; case 18: -#line 291 "awkgram.y" /* yacc.c:1646 */ +#line 289 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; rule = Rule; } -#line 1981 "awkgram.c" /* yacc.c:1646 */ +#line 1979 "awkgram.c" /* yacc.c:1646 */ break; case 19: -#line 293 "awkgram.y" /* yacc.c:1646 */ +#line 291 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); rule = Rule; } -#line 1987 "awkgram.c" /* yacc.c:1646 */ +#line 1985 "awkgram.c" /* yacc.c:1646 */ break; case 20: -#line 295 "awkgram.y" /* yacc.c:1646 */ +#line 293 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *tp; @@ -2013,11 +2011,11 @@ yyreduce: (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp); rule = Rule; } -#line 2017 "awkgram.c" /* yacc.c:1646 */ +#line 2015 "awkgram.c" /* yacc.c:1646 */ break; case 21: -#line 321 "awkgram.y" /* yacc.c:1646 */ +#line 319 "awkgram.y" /* yacc.c:1646 */ { static int begin_seen = 0; if (do_lint_old && ++begin_seen == 2) @@ -2028,11 +2026,11 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2032 "awkgram.c" /* yacc.c:1646 */ +#line 2030 "awkgram.c" /* yacc.c:1646 */ break; case 22: -#line 332 "awkgram.y" /* yacc.c:1646 */ +#line 330 "awkgram.y" /* yacc.c:1646 */ { static int end_seen = 0; if (do_lint_old && ++end_seen == 2) @@ -2043,70 +2041,70 @@ yyreduce: (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2047 "awkgram.c" /* yacc.c:1646 */ +#line 2045 "awkgram.c" /* yacc.c:1646 */ break; case 23: -#line 343 "awkgram.y" /* yacc.c:1646 */ +#line 341 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->in_rule = rule = BEGINFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2057 "awkgram.c" /* yacc.c:1646 */ +#line 2055 "awkgram.c" /* yacc.c:1646 */ break; case 24: -#line 349 "awkgram.y" /* yacc.c:1646 */ +#line 347 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->in_rule = rule = ENDFILE; (yyvsp[0])->source_file = source; (yyval) = (yyvsp[0]); } -#line 2067 "awkgram.c" /* yacc.c:1646 */ +#line 2065 "awkgram.c" /* yacc.c:1646 */ break; case 25: -#line 358 "awkgram.y" /* yacc.c:1646 */ +#line 356 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-3]) == NULL) (yyval) = list_create(instruction(Op_no_op)); else (yyval) = (yyvsp[-3]); } -#line 2078 "awkgram.c" /* yacc.c:1646 */ +#line 2076 "awkgram.c" /* yacc.c:1646 */ break; case 26: -#line 368 "awkgram.y" /* yacc.c:1646 */ +#line 366 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2084 "awkgram.c" /* yacc.c:1646 */ +#line 2082 "awkgram.c" /* yacc.c:1646 */ break; case 27: -#line 370 "awkgram.y" /* yacc.c:1646 */ +#line 368 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2090 "awkgram.c" /* yacc.c:1646 */ +#line 2088 "awkgram.c" /* yacc.c:1646 */ break; case 28: -#line 372 "awkgram.y" /* yacc.c:1646 */ +#line 370 "awkgram.y" /* yacc.c:1646 */ { yyerror(_("`%s' is a built-in function, it cannot be redefined"), tokstart); YYABORT; } -#line 2100 "awkgram.c" /* yacc.c:1646 */ +#line 2098 "awkgram.c" /* yacc.c:1646 */ break; case 29: -#line 378 "awkgram.y" /* yacc.c:1646 */ +#line 376 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2106 "awkgram.c" /* yacc.c:1646 */ +#line 2104 "awkgram.c" /* yacc.c:1646 */ break; case 32: -#line 388 "awkgram.y" /* yacc.c:1646 */ +#line 386 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-5])->source_file = source; if (install_function((yyvsp[-4])->lextok, (yyvsp[-5]), (yyvsp[-2])) < 0) @@ -2117,17 +2115,17 @@ yyreduce: /* $4 already free'd in install_function */ (yyval) = (yyvsp[-5]); } -#line 2121 "awkgram.c" /* yacc.c:1646 */ +#line 2119 "awkgram.c" /* yacc.c:1646 */ break; case 33: -#line 406 "awkgram.y" /* yacc.c:1646 */ +#line 404 "awkgram.y" /* yacc.c:1646 */ { want_regexp = true; } -#line 2127 "awkgram.c" /* yacc.c:1646 */ +#line 2125 "awkgram.c" /* yacc.c:1646 */ break; case 34: -#line 408 "awkgram.y" /* yacc.c:1646 */ +#line 406 "awkgram.y" /* yacc.c:1646 */ { NODE *n, *exp; char *re; @@ -2156,23 +2154,23 @@ yyreduce: (yyval)->opcode = Op_match_rec; (yyval)->memory = n; } -#line 2160 "awkgram.c" /* yacc.c:1646 */ +#line 2158 "awkgram.c" /* yacc.c:1646 */ break; case 35: -#line 440 "awkgram.y" /* yacc.c:1646 */ +#line 438 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[0])); } -#line 2166 "awkgram.c" /* yacc.c:1646 */ +#line 2164 "awkgram.c" /* yacc.c:1646 */ break; case 37: -#line 446 "awkgram.y" /* yacc.c:1646 */ +#line 444 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2172 "awkgram.c" /* yacc.c:1646 */ +#line 2170 "awkgram.c" /* yacc.c:1646 */ break; case 38: -#line 448 "awkgram.y" /* yacc.c:1646 */ +#line 446 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0]) == NULL) (yyval) = (yyvsp[-1]); @@ -2185,40 +2183,40 @@ yyreduce: } yyerrok; } -#line 2189 "awkgram.c" /* yacc.c:1646 */ +#line 2187 "awkgram.c" /* yacc.c:1646 */ break; case 39: -#line 461 "awkgram.y" /* yacc.c:1646 */ +#line 459 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2195 "awkgram.c" /* yacc.c:1646 */ +#line 2193 "awkgram.c" /* yacc.c:1646 */ break; case 42: -#line 471 "awkgram.y" /* yacc.c:1646 */ +#line 469 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2201 "awkgram.c" /* yacc.c:1646 */ +#line 2199 "awkgram.c" /* yacc.c:1646 */ break; case 43: -#line 473 "awkgram.y" /* yacc.c:1646 */ +#line 471 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2207 "awkgram.c" /* yacc.c:1646 */ +#line 2205 "awkgram.c" /* yacc.c:1646 */ break; case 44: -#line 475 "awkgram.y" /* yacc.c:1646 */ +#line 473 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2218 "awkgram.c" /* yacc.c:1646 */ +#line 2216 "awkgram.c" /* yacc.c:1646 */ break; case 45: -#line 482 "awkgram.y" /* yacc.c:1646 */ +#line 480 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt; INSTRUCTION *ip, *nextc, *tbreak; @@ -2308,11 +2306,11 @@ yyreduce: break_allowed--; fix_break_continue(ip, tbreak, NULL); } -#line 2312 "awkgram.c" /* yacc.c:1646 */ +#line 2310 "awkgram.c" /* yacc.c:1646 */ break; case 46: -#line 572 "awkgram.y" /* yacc.c:1646 */ +#line 570 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2354,11 +2352,11 @@ yyreduce: continue_allowed--; fix_break_continue(ip, tbreak, tcont); } -#line 2358 "awkgram.c" /* yacc.c:1646 */ +#line 2356 "awkgram.c" /* yacc.c:1646 */ break; case 47: -#line 614 "awkgram.y" /* yacc.c:1646 */ +#line 612 "awkgram.y" /* yacc.c:1646 */ { /* * ----------------- @@ -2400,11 +2398,11 @@ yyreduce: } /* else $1 and $4 are NULLs */ } -#line 2404 "awkgram.c" /* yacc.c:1646 */ +#line 2402 "awkgram.c" /* yacc.c:1646 */ break; case 48: -#line 656 "awkgram.y" /* yacc.c:1646 */ +#line 654 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip; char *var_name = (yyvsp[-5])->lextok; @@ -2517,44 +2515,44 @@ regular_loop: break_allowed--; continue_allowed--; } -#line 2521 "awkgram.c" /* yacc.c:1646 */ +#line 2519 "awkgram.c" /* yacc.c:1646 */ break; case 49: -#line 769 "awkgram.y" /* yacc.c:1646 */ +#line 767 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2532 "awkgram.c" /* yacc.c:1646 */ +#line 2530 "awkgram.c" /* yacc.c:1646 */ break; case 50: -#line 776 "awkgram.y" /* yacc.c:1646 */ +#line 774 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0])); break_allowed--; continue_allowed--; } -#line 2543 "awkgram.c" /* yacc.c:1646 */ +#line 2541 "awkgram.c" /* yacc.c:1646 */ break; case 51: -#line 783 "awkgram.y" /* yacc.c:1646 */ +#line 781 "awkgram.y" /* yacc.c:1646 */ { if (do_pretty_print) (yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count)); else (yyval) = (yyvsp[0]); } -#line 2554 "awkgram.c" /* yacc.c:1646 */ +#line 2552 "awkgram.c" /* yacc.c:1646 */ break; case 52: -#line 793 "awkgram.y" /* yacc.c:1646 */ +#line 791 "awkgram.y" /* yacc.c:1646 */ { if (! break_allowed) error_ln((yyvsp[-1])->source_line, @@ -2563,11 +2561,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2567 "awkgram.c" /* yacc.c:1646 */ +#line 2565 "awkgram.c" /* yacc.c:1646 */ break; case 53: -#line 802 "awkgram.y" /* yacc.c:1646 */ +#line 800 "awkgram.y" /* yacc.c:1646 */ { if (! continue_allowed) error_ln((yyvsp[-1])->source_line, @@ -2576,11 +2574,11 @@ regular_loop: (yyval) = list_create((yyvsp[-1])); } -#line 2580 "awkgram.c" /* yacc.c:1646 */ +#line 2578 "awkgram.c" /* yacc.c:1646 */ break; case 54: -#line 811 "awkgram.y" /* yacc.c:1646 */ +#line 809 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule && rule != Rule) @@ -2589,11 +2587,11 @@ regular_loop: (yyvsp[-1])->target_jmp = ip_rec; (yyval) = list_create((yyvsp[-1])); } -#line 2593 "awkgram.c" /* yacc.c:1646 */ +#line 2591 "awkgram.c" /* yacc.c:1646 */ break; case 55: -#line 820 "awkgram.y" /* yacc.c:1646 */ +#line 818 "awkgram.y" /* yacc.c:1646 */ { /* if inside function (rule = 0), resolve context at run-time */ if (rule == BEGIN || rule == END || rule == ENDFILE) @@ -2604,11 +2602,11 @@ regular_loop: (yyvsp[-1])->target_endfile = ip_endfile; (yyval) = list_create((yyvsp[-1])); } -#line 2608 "awkgram.c" /* yacc.c:1646 */ +#line 2606 "awkgram.c" /* yacc.c:1646 */ break; case 56: -#line 831 "awkgram.y" /* yacc.c:1646 */ +#line 829 "awkgram.y" /* yacc.c:1646 */ { /* Initialize the two possible jump targets, the actual target * is resolved at run-time. @@ -2623,20 +2621,20 @@ regular_loop: } else (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); } -#line 2627 "awkgram.c" /* yacc.c:1646 */ +#line 2625 "awkgram.c" /* yacc.c:1646 */ break; case 57: -#line 846 "awkgram.y" /* yacc.c:1646 */ +#line 844 "awkgram.y" /* yacc.c:1646 */ { if (! in_function) yyerror(_("`return' used outside function context")); } -#line 2636 "awkgram.c" /* yacc.c:1646 */ +#line 2634 "awkgram.c" /* yacc.c:1646 */ break; case 58: -#line 849 "awkgram.y" /* yacc.c:1646 */ +#line 847 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) { (yyval) = list_create((yyvsp[-3])); @@ -2657,17 +2655,17 @@ regular_loop: (yyval) = list_append((yyvsp[-1]), (yyvsp[-3])); } } -#line 2661 "awkgram.c" /* yacc.c:1646 */ +#line 2659 "awkgram.c" /* yacc.c:1646 */ break; case 60: -#line 881 "awkgram.y" /* yacc.c:1646 */ +#line 879 "awkgram.y" /* yacc.c:1646 */ { in_print = true; in_parens = 0; } -#line 2667 "awkgram.c" /* yacc.c:1646 */ +#line 2665 "awkgram.c" /* yacc.c:1646 */ break; case 61: -#line 882 "awkgram.y" /* yacc.c:1646 */ +#line 880 "awkgram.y" /* yacc.c:1646 */ { /* * Optimization: plain `print' has no expression list, so $3 is null. @@ -2764,17 +2762,17 @@ regular_print: } } } -#line 2768 "awkgram.c" /* yacc.c:1646 */ +#line 2766 "awkgram.c" /* yacc.c:1646 */ break; case 62: -#line 979 "awkgram.y" /* yacc.c:1646 */ +#line 977 "awkgram.y" /* yacc.c:1646 */ { sub_counter = 0; } -#line 2774 "awkgram.c" /* yacc.c:1646 */ +#line 2772 "awkgram.c" /* yacc.c:1646 */ break; case 63: -#line 980 "awkgram.y" /* yacc.c:1646 */ +#line 978 "awkgram.y" /* yacc.c:1646 */ { char *arr = (yyvsp[-2])->lextok; @@ -2807,11 +2805,11 @@ regular_print: (yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3])); } } -#line 2811 "awkgram.c" /* yacc.c:1646 */ +#line 2809 "awkgram.c" /* yacc.c:1646 */ break; case 64: -#line 1017 "awkgram.y" /* yacc.c:1646 */ +#line 1015 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; char *arr = (yyvsp[-1])->lextok; @@ -2837,52 +2835,52 @@ regular_print: fatal(_("`delete' is not allowed with FUNCTAB")); } } -#line 2841 "awkgram.c" /* yacc.c:1646 */ +#line 2839 "awkgram.c" /* yacc.c:1646 */ break; case 65: -#line 1043 "awkgram.y" /* yacc.c:1646 */ +#line 1041 "awkgram.y" /* yacc.c:1646 */ { (yyval) = optimize_assignment((yyvsp[0])); } -#line 2847 "awkgram.c" /* yacc.c:1646 */ +#line 2845 "awkgram.c" /* yacc.c:1646 */ break; case 66: -#line 1048 "awkgram.y" /* yacc.c:1646 */ +#line 1046 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2853 "awkgram.c" /* yacc.c:1646 */ +#line 2851 "awkgram.c" /* yacc.c:1646 */ break; case 67: -#line 1050 "awkgram.y" /* yacc.c:1646 */ +#line 1048 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2859 "awkgram.c" /* yacc.c:1646 */ +#line 2857 "awkgram.c" /* yacc.c:1646 */ break; case 68: -#line 1055 "awkgram.y" /* yacc.c:1646 */ +#line 1053 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2865 "awkgram.c" /* yacc.c:1646 */ +#line 2863 "awkgram.c" /* yacc.c:1646 */ break; case 69: -#line 1057 "awkgram.y" /* yacc.c:1646 */ +#line 1055 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) == NULL) (yyval) = list_create((yyvsp[0])); else (yyval) = list_prepend((yyvsp[-1]), (yyvsp[0])); } -#line 2876 "awkgram.c" /* yacc.c:1646 */ +#line 2874 "awkgram.c" /* yacc.c:1646 */ break; case 70: -#line 1064 "awkgram.y" /* yacc.c:1646 */ +#line 1062 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 2882 "awkgram.c" /* yacc.c:1646 */ +#line 2880 "awkgram.c" /* yacc.c:1646 */ break; case 71: -#line 1069 "awkgram.y" /* yacc.c:1646 */ +#line 1067 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2894,11 +2892,11 @@ regular_print: bcfree((yyvsp[-2])); (yyval) = (yyvsp[-4]); } -#line 2898 "awkgram.c" /* yacc.c:1646 */ +#line 2896 "awkgram.c" /* yacc.c:1646 */ break; case 72: -#line 1081 "awkgram.y" /* yacc.c:1646 */ +#line 1079 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *casestmt = (yyvsp[0]); if ((yyvsp[0]) == NULL) @@ -2909,17 +2907,17 @@ regular_print: (yyvsp[-3])->case_stmt = casestmt; (yyval) = (yyvsp[-3]); } -#line 2913 "awkgram.c" /* yacc.c:1646 */ +#line 2911 "awkgram.c" /* yacc.c:1646 */ break; case 73: -#line 1095 "awkgram.y" /* yacc.c:1646 */ +#line 1093 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2919 "awkgram.c" /* yacc.c:1646 */ +#line 2917 "awkgram.c" /* yacc.c:1646 */ break; case 74: -#line 1097 "awkgram.y" /* yacc.c:1646 */ +#line 1095 "awkgram.y" /* yacc.c:1646 */ { NODE *n = (yyvsp[0])->memory; (void) force_number(n); @@ -2927,71 +2925,71 @@ regular_print: bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2931 "awkgram.c" /* yacc.c:1646 */ +#line 2929 "awkgram.c" /* yacc.c:1646 */ break; case 75: -#line 1105 "awkgram.y" /* yacc.c:1646 */ +#line 1103 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 2940 "awkgram.c" /* yacc.c:1646 */ +#line 2938 "awkgram.c" /* yacc.c:1646 */ break; case 76: -#line 1110 "awkgram.y" /* yacc.c:1646 */ +#line 1108 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2946 "awkgram.c" /* yacc.c:1646 */ +#line 2944 "awkgram.c" /* yacc.c:1646 */ break; case 77: -#line 1112 "awkgram.y" /* yacc.c:1646 */ +#line 1110 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_push_re; (yyval) = (yyvsp[0]); } -#line 2955 "awkgram.c" /* yacc.c:1646 */ +#line 2953 "awkgram.c" /* yacc.c:1646 */ break; case 78: -#line 1120 "awkgram.y" /* yacc.c:1646 */ +#line 1118 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2961 "awkgram.c" /* yacc.c:1646 */ +#line 2959 "awkgram.c" /* yacc.c:1646 */ break; case 79: -#line 1122 "awkgram.y" /* yacc.c:1646 */ +#line 1120 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2967 "awkgram.c" /* yacc.c:1646 */ +#line 2965 "awkgram.c" /* yacc.c:1646 */ break; case 81: -#line 1132 "awkgram.y" /* yacc.c:1646 */ +#line 1130 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2975 "awkgram.c" /* yacc.c:1646 */ +#line 2973 "awkgram.c" /* yacc.c:1646 */ break; case 82: -#line 1139 "awkgram.y" /* yacc.c:1646 */ +#line 1137 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; (yyval) = NULL; } -#line 2985 "awkgram.c" /* yacc.c:1646 */ +#line 2983 "awkgram.c" /* yacc.c:1646 */ break; case 83: -#line 1144 "awkgram.y" /* yacc.c:1646 */ +#line 1142 "awkgram.y" /* yacc.c:1646 */ { in_print = false; in_parens = 0; } -#line 2991 "awkgram.c" /* yacc.c:1646 */ +#line 2989 "awkgram.c" /* yacc.c:1646 */ break; case 84: -#line 1145 "awkgram.y" /* yacc.c:1646 */ +#line 1143 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->redir_type == redirect_twoway && (yyvsp[0])->lasti->opcode == Op_K_getline_redir @@ -2999,136 +2997,136 @@ regular_print: yyerror(_("multistage two-way pipelines don't work")); (yyval) = list_prepend((yyvsp[0]), (yyvsp[-2])); } -#line 3003 "awkgram.c" /* yacc.c:1646 */ +#line 3001 "awkgram.c" /* yacc.c:1646 */ break; case 85: -#line 1156 "awkgram.y" /* yacc.c:1646 */ +#line 1154 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL); } -#line 3011 "awkgram.c" /* yacc.c:1646 */ +#line 3009 "awkgram.c" /* yacc.c:1646 */ break; case 86: -#line 1161 "awkgram.y" /* yacc.c:1646 */ +#line 1159 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0])); } -#line 3019 "awkgram.c" /* yacc.c:1646 */ +#line 3017 "awkgram.c" /* yacc.c:1646 */ break; case 91: -#line 1178 "awkgram.y" /* yacc.c:1646 */ +#line 1176 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3025 "awkgram.c" /* yacc.c:1646 */ +#line 3023 "awkgram.c" /* yacc.c:1646 */ break; case 92: -#line 1180 "awkgram.y" /* yacc.c:1646 */ +#line 1178 "awkgram.y" /* yacc.c:1646 */ { bcfree((yyvsp[-1])); (yyval) = (yyvsp[0]); } -#line 3034 "awkgram.c" /* yacc.c:1646 */ +#line 3032 "awkgram.c" /* yacc.c:1646 */ break; case 93: -#line 1188 "awkgram.y" /* yacc.c:1646 */ +#line 1186 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3040 "awkgram.c" /* yacc.c:1646 */ +#line 3038 "awkgram.c" /* yacc.c:1646 */ break; case 94: -#line 1190 "awkgram.y" /* yacc.c:1646 */ +#line 1188 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]) ; } -#line 3046 "awkgram.c" /* yacc.c:1646 */ +#line 3044 "awkgram.c" /* yacc.c:1646 */ break; case 95: -#line 1195 "awkgram.y" /* yacc.c:1646 */ +#line 1193 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = 0; (yyval) = list_create((yyvsp[0])); } -#line 3055 "awkgram.c" /* yacc.c:1646 */ +#line 3053 "awkgram.c" /* yacc.c:1646 */ break; case 96: -#line 1200 "awkgram.y" /* yacc.c:1646 */ +#line 1198 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1; (yyval) = list_append((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3065 "awkgram.c" /* yacc.c:1646 */ +#line 3063 "awkgram.c" /* yacc.c:1646 */ break; case 97: -#line 1206 "awkgram.y" /* yacc.c:1646 */ +#line 1204 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3071 "awkgram.c" /* yacc.c:1646 */ +#line 3069 "awkgram.c" /* yacc.c:1646 */ break; case 98: -#line 1208 "awkgram.y" /* yacc.c:1646 */ +#line 1206 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3077 "awkgram.c" /* yacc.c:1646 */ +#line 3075 "awkgram.c" /* yacc.c:1646 */ break; case 99: -#line 1210 "awkgram.y" /* yacc.c:1646 */ +#line 1208 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } -#line 3083 "awkgram.c" /* yacc.c:1646 */ +#line 3081 "awkgram.c" /* yacc.c:1646 */ break; case 100: -#line 1216 "awkgram.y" /* yacc.c:1646 */ +#line 1214 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3089 "awkgram.c" /* yacc.c:1646 */ +#line 3087 "awkgram.c" /* yacc.c:1646 */ break; case 101: -#line 1218 "awkgram.y" /* yacc.c:1646 */ +#line 1216 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3095 "awkgram.c" /* yacc.c:1646 */ +#line 3093 "awkgram.c" /* yacc.c:1646 */ break; case 102: -#line 1223 "awkgram.y" /* yacc.c:1646 */ +#line 1221 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3101 "awkgram.c" /* yacc.c:1646 */ +#line 3099 "awkgram.c" /* yacc.c:1646 */ break; case 103: -#line 1225 "awkgram.y" /* yacc.c:1646 */ +#line 1223 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3107 "awkgram.c" /* yacc.c:1646 */ +#line 3105 "awkgram.c" /* yacc.c:1646 */ break; case 104: -#line 1230 "awkgram.y" /* yacc.c:1646 */ +#line 1228 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list(NULL, (yyvsp[0])); } -#line 3113 "awkgram.c" /* yacc.c:1646 */ +#line 3111 "awkgram.c" /* yacc.c:1646 */ break; case 105: -#line 1232 "awkgram.y" /* yacc.c:1646 */ +#line 1230 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); yyerrok; } -#line 3122 "awkgram.c" /* yacc.c:1646 */ +#line 3120 "awkgram.c" /* yacc.c:1646 */ break; case 106: -#line 1237 "awkgram.y" /* yacc.c:1646 */ +#line 1235 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3128 "awkgram.c" /* yacc.c:1646 */ +#line 3126 "awkgram.c" /* yacc.c:1646 */ break; case 107: -#line 1239 "awkgram.y" /* yacc.c:1646 */ +#line 1237 "awkgram.y" /* yacc.c:1646 */ { /* * Returning the expression list instead of NULL lets @@ -3136,52 +3134,52 @@ regular_print: */ (yyval) = (yyvsp[-1]); } -#line 3140 "awkgram.c" /* yacc.c:1646 */ +#line 3138 "awkgram.c" /* yacc.c:1646 */ break; case 108: -#line 1247 "awkgram.y" /* yacc.c:1646 */ +#line 1245 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0])); } -#line 3149 "awkgram.c" /* yacc.c:1646 */ +#line 3147 "awkgram.c" /* yacc.c:1646 */ break; case 109: -#line 1252 "awkgram.y" /* yacc.c:1646 */ +#line 1250 "awkgram.y" /* yacc.c:1646 */ { /* Ditto */ (yyval) = (yyvsp[-2]); } -#line 3158 "awkgram.c" /* yacc.c:1646 */ +#line 3156 "awkgram.c" /* yacc.c:1646 */ break; case 110: -#line 1261 "awkgram.y" /* yacc.c:1646 */ +#line 1259 "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 3169 "awkgram.c" /* yacc.c:1646 */ +#line 3167 "awkgram.c" /* yacc.c:1646 */ break; case 111: -#line 1268 "awkgram.y" /* yacc.c:1646 */ +#line 1266 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3175 "awkgram.c" /* yacc.c:1646 */ +#line 3173 "awkgram.c" /* yacc.c:1646 */ break; case 112: -#line 1270 "awkgram.y" /* yacc.c:1646 */ +#line 1268 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3181 "awkgram.c" /* yacc.c:1646 */ +#line 3179 "awkgram.c" /* yacc.c:1646 */ break; case 113: -#line 1272 "awkgram.y" /* yacc.c:1646 */ +#line 1270 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[-2])->lasti->opcode == Op_match_rec) warning_ln((yyvsp[-1])->source_line, @@ -3197,11 +3195,11 @@ regular_print: (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } } -#line 3201 "awkgram.c" /* yacc.c:1646 */ +#line 3199 "awkgram.c" /* yacc.c:1646 */ break; case 114: -#line 1288 "awkgram.y" /* yacc.c:1646 */ +#line 1286 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) warning_ln((yyvsp[-1])->source_line, @@ -3211,91 +3209,91 @@ regular_print: (yyvsp[-1])->expr_count = 1; (yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1])); } -#line 3215 "awkgram.c" /* yacc.c:1646 */ +#line 3213 "awkgram.c" /* yacc.c:1646 */ break; case 115: -#line 1298 "awkgram.y" /* yacc.c:1646 */ +#line 1296 "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 3226 "awkgram.c" /* yacc.c:1646 */ +#line 3224 "awkgram.c" /* yacc.c:1646 */ break; case 116: -#line 1305 "awkgram.y" /* yacc.c:1646 */ +#line 1303 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); } -#line 3232 "awkgram.c" /* yacc.c:1646 */ +#line 3230 "awkgram.c" /* yacc.c:1646 */ break; case 117: -#line 1307 "awkgram.y" /* yacc.c:1646 */ +#line 1305 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3238 "awkgram.c" /* yacc.c:1646 */ +#line 3236 "awkgram.c" /* yacc.c:1646 */ break; case 118: -#line 1312 "awkgram.y" /* yacc.c:1646 */ +#line 1310 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3244 "awkgram.c" /* yacc.c:1646 */ +#line 3242 "awkgram.c" /* yacc.c:1646 */ break; case 119: -#line 1314 "awkgram.y" /* yacc.c:1646 */ +#line 1312 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3250 "awkgram.c" /* yacc.c:1646 */ +#line 3248 "awkgram.c" /* yacc.c:1646 */ break; case 120: -#line 1316 "awkgram.y" /* yacc.c:1646 */ +#line 1314 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_assign_quotient; (yyval) = (yyvsp[0]); } -#line 3259 "awkgram.c" /* yacc.c:1646 */ +#line 3257 "awkgram.c" /* yacc.c:1646 */ break; case 121: -#line 1324 "awkgram.y" /* yacc.c:1646 */ +#line 1322 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3265 "awkgram.c" /* yacc.c:1646 */ +#line 3263 "awkgram.c" /* yacc.c:1646 */ break; case 122: -#line 1326 "awkgram.y" /* yacc.c:1646 */ +#line 1324 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3271 "awkgram.c" /* yacc.c:1646 */ +#line 3269 "awkgram.c" /* yacc.c:1646 */ break; case 123: -#line 1331 "awkgram.y" /* yacc.c:1646 */ +#line 1329 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3277 "awkgram.c" /* yacc.c:1646 */ +#line 3275 "awkgram.c" /* yacc.c:1646 */ break; case 124: -#line 1333 "awkgram.y" /* yacc.c:1646 */ +#line 1331 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3283 "awkgram.c" /* yacc.c:1646 */ +#line 3281 "awkgram.c" /* yacc.c:1646 */ break; case 125: -#line 1338 "awkgram.y" /* yacc.c:1646 */ +#line 1336 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3289 "awkgram.c" /* yacc.c:1646 */ +#line 3287 "awkgram.c" /* yacc.c:1646 */ break; case 126: -#line 1340 "awkgram.y" /* yacc.c:1646 */ +#line 1338 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3295 "awkgram.c" /* yacc.c:1646 */ +#line 3293 "awkgram.c" /* yacc.c:1646 */ break; case 127: -#line 1342 "awkgram.y" /* yacc.c:1646 */ +#line 1340 "awkgram.y" /* yacc.c:1646 */ { int count = 2; bool is_simple_var = false; @@ -3342,47 +3340,47 @@ regular_print: max_args = count; } } -#line 3346 "awkgram.c" /* yacc.c:1646 */ +#line 3344 "awkgram.c" /* yacc.c:1646 */ break; case 129: -#line 1394 "awkgram.y" /* yacc.c:1646 */ +#line 1392 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3352 "awkgram.c" /* yacc.c:1646 */ +#line 3350 "awkgram.c" /* yacc.c:1646 */ break; case 130: -#line 1396 "awkgram.y" /* yacc.c:1646 */ +#line 1394 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3358 "awkgram.c" /* yacc.c:1646 */ +#line 3356 "awkgram.c" /* yacc.c:1646 */ break; case 131: -#line 1398 "awkgram.y" /* yacc.c:1646 */ +#line 1396 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3364 "awkgram.c" /* yacc.c:1646 */ +#line 3362 "awkgram.c" /* yacc.c:1646 */ break; case 132: -#line 1400 "awkgram.y" /* yacc.c:1646 */ +#line 1398 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3370 "awkgram.c" /* yacc.c:1646 */ +#line 3368 "awkgram.c" /* yacc.c:1646 */ break; case 133: -#line 1402 "awkgram.y" /* yacc.c:1646 */ +#line 1400 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3376 "awkgram.c" /* yacc.c:1646 */ +#line 3374 "awkgram.c" /* yacc.c:1646 */ break; case 134: -#line 1404 "awkgram.y" /* yacc.c:1646 */ +#line 1402 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3382 "awkgram.c" /* yacc.c:1646 */ +#line 3380 "awkgram.c" /* yacc.c:1646 */ break; case 135: -#line 1406 "awkgram.y" /* yacc.c:1646 */ +#line 1404 "awkgram.y" /* yacc.c:1646 */ { /* * In BEGINFILE/ENDFILE, allow `getline [var] < file' @@ -3396,29 +3394,29 @@ regular_print: _("non-redirected `getline' undefined inside END action")); (yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input); } -#line 3400 "awkgram.c" /* yacc.c:1646 */ +#line 3398 "awkgram.c" /* yacc.c:1646 */ break; case 136: -#line 1420 "awkgram.y" /* yacc.c:1646 */ +#line 1418 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3409 "awkgram.c" /* yacc.c:1646 */ +#line 3407 "awkgram.c" /* yacc.c:1646 */ break; case 137: -#line 1425 "awkgram.y" /* yacc.c:1646 */ +#line 1423 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; (yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3418 "awkgram.c" /* yacc.c:1646 */ +#line 3416 "awkgram.c" /* yacc.c:1646 */ break; case 138: -#line 1430 "awkgram.y" /* yacc.c:1646 */ +#line 1428 "awkgram.y" /* yacc.c:1646 */ { if (do_lint_old) { warning_ln((yyvsp[-1])->source_line, @@ -3438,64 +3436,64 @@ regular_print: (yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1])); } } -#line 3442 "awkgram.c" /* yacc.c:1646 */ +#line 3440 "awkgram.c" /* yacc.c:1646 */ break; case 139: -#line 1455 "awkgram.y" /* yacc.c:1646 */ +#line 1453 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type); bcfree((yyvsp[-2])); } -#line 3451 "awkgram.c" /* yacc.c:1646 */ +#line 3449 "awkgram.c" /* yacc.c:1646 */ break; case 140: -#line 1461 "awkgram.y" /* yacc.c:1646 */ +#line 1459 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3457 "awkgram.c" /* yacc.c:1646 */ +#line 3455 "awkgram.c" /* yacc.c:1646 */ break; case 141: -#line 1463 "awkgram.y" /* yacc.c:1646 */ +#line 1461 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3463 "awkgram.c" /* yacc.c:1646 */ +#line 3461 "awkgram.c" /* yacc.c:1646 */ break; case 142: -#line 1465 "awkgram.y" /* yacc.c:1646 */ +#line 1463 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3469 "awkgram.c" /* yacc.c:1646 */ +#line 3467 "awkgram.c" /* yacc.c:1646 */ break; case 143: -#line 1467 "awkgram.y" /* yacc.c:1646 */ +#line 1465 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3475 "awkgram.c" /* yacc.c:1646 */ +#line 3473 "awkgram.c" /* yacc.c:1646 */ break; case 144: -#line 1469 "awkgram.y" /* yacc.c:1646 */ +#line 1467 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3481 "awkgram.c" /* yacc.c:1646 */ +#line 3479 "awkgram.c" /* yacc.c:1646 */ break; case 145: -#line 1471 "awkgram.y" /* yacc.c:1646 */ +#line 1469 "awkgram.y" /* yacc.c:1646 */ { (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); } -#line 3487 "awkgram.c" /* yacc.c:1646 */ +#line 3485 "awkgram.c" /* yacc.c:1646 */ break; case 146: -#line 1476 "awkgram.y" /* yacc.c:1646 */ +#line 1474 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3495 "awkgram.c" /* yacc.c:1646 */ +#line 3493 "awkgram.c" /* yacc.c:1646 */ break; case 147: -#line 1480 "awkgram.y" /* yacc.c:1646 */ +#line 1478 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->opcode == Op_match_rec) { (yyvsp[0])->opcode = Op_nomatch; @@ -3527,37 +3525,37 @@ regular_print: } } } -#line 3531 "awkgram.c" /* yacc.c:1646 */ +#line 3529 "awkgram.c" /* yacc.c:1646 */ break; case 148: -#line 1512 "awkgram.y" /* yacc.c:1646 */ +#line 1510 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3537 "awkgram.c" /* yacc.c:1646 */ +#line 3535 "awkgram.c" /* yacc.c:1646 */ break; case 149: -#line 1514 "awkgram.y" /* yacc.c:1646 */ +#line 1512 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3547 "awkgram.c" /* yacc.c:1646 */ +#line 3545 "awkgram.c" /* yacc.c:1646 */ break; case 150: -#line 1520 "awkgram.y" /* yacc.c:1646 */ +#line 1518 "awkgram.y" /* yacc.c:1646 */ { (yyval) = snode((yyvsp[-1]), (yyvsp[-3])); if ((yyval) == NULL) YYABORT; } -#line 3557 "awkgram.c" /* yacc.c:1646 */ +#line 3555 "awkgram.c" /* yacc.c:1646 */ break; case 151: -#line 1526 "awkgram.y" /* yacc.c:1646 */ +#line 1524 "awkgram.y" /* yacc.c:1646 */ { static bool warned = false; @@ -3570,45 +3568,45 @@ regular_print: if ((yyval) == NULL) YYABORT; } -#line 3574 "awkgram.c" /* yacc.c:1646 */ +#line 3572 "awkgram.c" /* yacc.c:1646 */ break; case 154: -#line 1541 "awkgram.y" /* yacc.c:1646 */ +#line 1539 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_preincrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3583 "awkgram.c" /* yacc.c:1646 */ +#line 3581 "awkgram.c" /* yacc.c:1646 */ break; case 155: -#line 1546 "awkgram.y" /* yacc.c:1646 */ +#line 1544 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[-1])->opcode = Op_predecrement; (yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1])); } -#line 3592 "awkgram.c" /* yacc.c:1646 */ +#line 3590 "awkgram.c" /* yacc.c:1646 */ break; case 156: -#line 1551 "awkgram.y" /* yacc.c:1646 */ +#line 1549 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3600 "awkgram.c" /* yacc.c:1646 */ +#line 3598 "awkgram.c" /* yacc.c:1646 */ break; case 157: -#line 1555 "awkgram.y" /* yacc.c:1646 */ +#line 1553 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_create((yyvsp[0])); } -#line 3608 "awkgram.c" /* yacc.c:1646 */ +#line 3606 "awkgram.c" /* yacc.c:1646 */ break; case 158: -#line 1559 "awkgram.y" /* yacc.c:1646 */ +#line 1557 "awkgram.y" /* yacc.c:1646 */ { if ((yyvsp[0])->lasti->opcode == Op_push_i && ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0 @@ -3623,11 +3621,11 @@ regular_print: (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } } -#line 3627 "awkgram.c" /* yacc.c:1646 */ +#line 3625 "awkgram.c" /* yacc.c:1646 */ break; case 159: -#line 1574 "awkgram.y" /* yacc.c:1646 */ +#line 1572 "awkgram.y" /* yacc.c:1646 */ { /* * was: $$ = $2 @@ -3637,20 +3635,20 @@ regular_print: (yyvsp[-1])->memory = make_number(0.0); (yyval) = list_append((yyvsp[0]), (yyvsp[-1])); } -#line 3641 "awkgram.c" /* yacc.c:1646 */ +#line 3639 "awkgram.c" /* yacc.c:1646 */ break; case 160: -#line 1587 "awkgram.y" /* yacc.c:1646 */ +#line 1585 "awkgram.y" /* yacc.c:1646 */ { func_use((yyvsp[0])->lasti->func_name, FUNC_USE); (yyval) = (yyvsp[0]); } -#line 3650 "awkgram.c" /* yacc.c:1646 */ +#line 3648 "awkgram.c" /* yacc.c:1646 */ break; case 161: -#line 1592 "awkgram.y" /* yacc.c:1646 */ +#line 1590 "awkgram.y" /* yacc.c:1646 */ { /* indirect function call */ INSTRUCTION *f, *t; @@ -3683,11 +3681,11 @@ regular_print: (yyval) = list_prepend((yyvsp[0]), t); } -#line 3687 "awkgram.c" /* yacc.c:1646 */ +#line 3685 "awkgram.c" /* yacc.c:1646 */ break; case 162: -#line 1628 "awkgram.y" /* yacc.c:1646 */ +#line 1626 "awkgram.y" /* yacc.c:1646 */ { param_sanity((yyvsp[-1])); (yyvsp[-3])->opcode = Op_func_call; @@ -3701,49 +3699,49 @@ regular_print: (yyval) = list_append(t, (yyvsp[-3])); } } -#line 3705 "awkgram.c" /* yacc.c:1646 */ +#line 3703 "awkgram.c" /* yacc.c:1646 */ break; case 163: -#line 1645 "awkgram.y" /* yacc.c:1646 */ +#line 1643 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3711 "awkgram.c" /* yacc.c:1646 */ +#line 3709 "awkgram.c" /* yacc.c:1646 */ break; case 164: -#line 1647 "awkgram.y" /* yacc.c:1646 */ +#line 1645 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3717 "awkgram.c" /* yacc.c:1646 */ +#line 3715 "awkgram.c" /* yacc.c:1646 */ break; case 165: -#line 1652 "awkgram.y" /* yacc.c:1646 */ +#line 1650 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3723 "awkgram.c" /* yacc.c:1646 */ +#line 3721 "awkgram.c" /* yacc.c:1646 */ break; case 166: -#line 1654 "awkgram.y" /* yacc.c:1646 */ +#line 1652 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3729 "awkgram.c" /* yacc.c:1646 */ +#line 3727 "awkgram.c" /* yacc.c:1646 */ break; case 167: -#line 1659 "awkgram.y" /* yacc.c:1646 */ +#line 1657 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3735 "awkgram.c" /* yacc.c:1646 */ +#line 3733 "awkgram.c" /* yacc.c:1646 */ break; case 168: -#line 1661 "awkgram.y" /* yacc.c:1646 */ +#line 1659 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3743 "awkgram.c" /* yacc.c:1646 */ +#line 3741 "awkgram.c" /* yacc.c:1646 */ break; case 169: -#line 1668 "awkgram.y" /* yacc.c:1646 */ +#line 1666 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->lasti; int count = ip->sub_count; /* # of SUBSEP-seperated expressions */ @@ -3757,11 +3755,11 @@ regular_print: sub_counter++; /* count # of dimensions */ (yyval) = (yyvsp[0]); } -#line 3761 "awkgram.c" /* yacc.c:1646 */ +#line 3759 "awkgram.c" /* yacc.c:1646 */ break; case 170: -#line 1685 "awkgram.y" /* yacc.c:1646 */ +#line 1683 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *t = (yyvsp[-1]); if ((yyvsp[-1]) == NULL) { @@ -3775,31 +3773,31 @@ regular_print: (yyvsp[0])->sub_count = count_expressions(&t, false); (yyval) = list_append(t, (yyvsp[0])); } -#line 3779 "awkgram.c" /* yacc.c:1646 */ +#line 3777 "awkgram.c" /* yacc.c:1646 */ break; case 171: -#line 1702 "awkgram.y" /* yacc.c:1646 */ +#line 1700 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 3785 "awkgram.c" /* yacc.c:1646 */ +#line 3783 "awkgram.c" /* yacc.c:1646 */ break; case 172: -#line 1704 "awkgram.y" /* yacc.c:1646 */ +#line 1702 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_merge((yyvsp[-1]), (yyvsp[0])); } -#line 3793 "awkgram.c" /* yacc.c:1646 */ +#line 3791 "awkgram.c" /* yacc.c:1646 */ break; case 173: -#line 1711 "awkgram.y" /* yacc.c:1646 */ +#line 1709 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 3799 "awkgram.c" /* yacc.c:1646 */ +#line 3797 "awkgram.c" /* yacc.c:1646 */ break; case 174: -#line 1716 "awkgram.y" /* yacc.c:1646 */ +#line 1714 "awkgram.y" /* yacc.c:1646 */ { char *var_name = (yyvsp[0])->lextok; @@ -3807,22 +3805,22 @@ regular_print: (yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new); (yyval) = list_create((yyvsp[0])); } -#line 3811 "awkgram.c" /* yacc.c:1646 */ +#line 3809 "awkgram.c" /* yacc.c:1646 */ break; case 175: -#line 1724 "awkgram.y" /* yacc.c:1646 */ +#line 1722 "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 3822 "awkgram.c" /* yacc.c:1646 */ +#line 3820 "awkgram.c" /* yacc.c:1646 */ break; case 176: -#line 1734 "awkgram.y" /* yacc.c:1646 */ +#line 1732 "awkgram.y" /* yacc.c:1646 */ { INSTRUCTION *ip = (yyvsp[0])->nexti; if (ip->opcode == Op_push @@ -3834,73 +3832,73 @@ regular_print: } else (yyval) = (yyvsp[0]); } -#line 3838 "awkgram.c" /* yacc.c:1646 */ +#line 3836 "awkgram.c" /* yacc.c:1646 */ break; case 177: -#line 1746 "awkgram.y" /* yacc.c:1646 */ +#line 1744 "awkgram.y" /* yacc.c:1646 */ { (yyval) = list_append((yyvsp[-1]), (yyvsp[-2])); if ((yyvsp[0]) != NULL) mk_assignment((yyvsp[-1]), NULL, (yyvsp[0])); } -#line 3848 "awkgram.c" /* yacc.c:1646 */ +#line 3846 "awkgram.c" /* yacc.c:1646 */ break; case 178: -#line 1755 "awkgram.y" /* yacc.c:1646 */ +#line 1753 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postincrement; } -#line 3856 "awkgram.c" /* yacc.c:1646 */ +#line 3854 "awkgram.c" /* yacc.c:1646 */ break; case 179: -#line 1759 "awkgram.y" /* yacc.c:1646 */ +#line 1757 "awkgram.y" /* yacc.c:1646 */ { (yyvsp[0])->opcode = Op_postdecrement; } -#line 3864 "awkgram.c" /* yacc.c:1646 */ +#line 3862 "awkgram.c" /* yacc.c:1646 */ break; case 180: -#line 1762 "awkgram.y" /* yacc.c:1646 */ +#line 1760 "awkgram.y" /* yacc.c:1646 */ { (yyval) = NULL; } -#line 3870 "awkgram.c" /* yacc.c:1646 */ +#line 3868 "awkgram.c" /* yacc.c:1646 */ break; case 182: -#line 1770 "awkgram.y" /* yacc.c:1646 */ +#line 1768 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3876 "awkgram.c" /* yacc.c:1646 */ +#line 3874 "awkgram.c" /* yacc.c:1646 */ break; case 183: -#line 1774 "awkgram.y" /* yacc.c:1646 */ +#line 1772 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3882 "awkgram.c" /* yacc.c:1646 */ +#line 3880 "awkgram.c" /* yacc.c:1646 */ break; case 186: -#line 1783 "awkgram.y" /* yacc.c:1646 */ +#line 1781 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3888 "awkgram.c" /* yacc.c:1646 */ +#line 3886 "awkgram.c" /* yacc.c:1646 */ break; case 187: -#line 1787 "awkgram.y" /* yacc.c:1646 */ +#line 1785 "awkgram.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); yyerrok; } -#line 3894 "awkgram.c" /* yacc.c:1646 */ +#line 3892 "awkgram.c" /* yacc.c:1646 */ break; case 188: -#line 1791 "awkgram.y" /* yacc.c:1646 */ +#line 1789 "awkgram.y" /* yacc.c:1646 */ { yyerrok; } -#line 3900 "awkgram.c" /* yacc.c:1646 */ +#line 3898 "awkgram.c" /* yacc.c:1646 */ break; -#line 3904 "awkgram.c" /* yacc.c:1646 */ +#line 3902 "awkgram.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4128,7 +4126,7 @@ yyreturn: #endif return yyresult; } -#line 1793 "awkgram.y" /* yacc.c:1906 */ +#line 1791 "awkgram.y" /* yacc.c:1906 */ struct token { @@ -5975,7 +5973,7 @@ retry: } } - if (c != '_' && ! isalpha(c)) { + if (c != '_' && ! is_alpha(c)) { yyerror(_("invalid char '%c' in expression"), c); return lasttok = LEX_EOF; } @@ -8078,20 +8076,20 @@ install_builtins(void) } } -/* is_identchar --- return true if c can be in an identifier */ - /* - * 9/2014: This can't be: - * - * #define is_identchar(c) (isalnum(c) || (c) == '_') - * - * because in non-C locales, character codes outside the set of - * ASCII letters and digits pass the test. BLEAH. + * 9/2014: Gawk cannot use <ctype.h> isalpha or isalnum when + * parsing the program since that can let through non-English + * letters. So, we supply our own. !@#$%^&*()-ing locales! */ -static bool -is_identchar(int c) +/* is_alpha --- return true if c is an English letter */ + +bool +is_alpha(int c) { +#ifdef I_DONT_KNOW_WHAT_IM_DOING + return isalpha(c); +#else /* ! I_DONT_KNOW_WHAT_IM_DOING */ switch (c) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': @@ -8103,10 +8101,26 @@ is_identchar(int c) case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': - case '0': case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': - case '_': return true; } return false; +#endif /* ! I_DONT_KNOW_WHAT_IM_DOING */ +} + +/* is_alnum --- return true for alphanumeric, English only letters */ + +bool +is_alnum(int c) +{ + /* digit test is good for EBCDIC too. so there. */ + return (is_alpha(c) || ('0' <= c && c <= '9')); +} + + +/* is_identchar --- return true if c can be in an identifier */ + +bool +is_identchar(int c) +{ + return (is_alnum(c) || c == '_'); } @@ -154,8 +154,6 @@ static inline INSTRUCTION *list_merge(INSTRUCTION *l1, INSTRUCTION *l2); extern double fmod(double x, double y); #define YYSTYPE INSTRUCTION * - -static bool is_identchar(int c); %} %token FUNC_CALL NAME REGEXP FILENAME @@ -3636,7 +3634,7 @@ retry: } } - if (c != '_' && ! isalpha(c)) { + if (c != '_' && ! is_alpha(c)) { yyerror(_("invalid char '%c' in expression"), c); return lasttok = LEX_EOF; } @@ -5739,20 +5737,20 @@ install_builtins(void) } } -/* is_identchar --- return true if c can be in an identifier */ - /* - * 9/2014: This can't be: - * - * #define is_identchar(c) (isalnum(c) || (c) == '_') - * - * because in non-C locales, character codes outside the set of - * ASCII letters and digits pass the test. BLEAH. + * 9/2014: Gawk cannot use <ctype.h> isalpha or isalnum when + * parsing the program since that can let through non-English + * letters. So, we supply our own. !@#$%^&*()-ing locales! */ -static bool -is_identchar(int c) +/* is_alpha --- return true if c is an English letter */ + +bool +is_alpha(int c) { +#ifdef I_DONT_KNOW_WHAT_IM_DOING + return isalpha(c); +#else /* ! I_DONT_KNOW_WHAT_IM_DOING */ switch (c) { case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': @@ -5764,10 +5762,26 @@ is_identchar(int c) case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': - case '0': case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': - case '_': return true; } return false; +#endif /* ! I_DONT_KNOW_WHAT_IM_DOING */ +} + +/* is_alnum --- return true for alphanumeric, English only letters */ + +bool +is_alnum(int c) +{ + /* digit test is good for EBCDIC too. so there. */ + return (is_alpha(c) || ('0' <= c && c <= '9')); +} + + +/* is_identchar --- return true if c can be in an identifier */ + +bool +is_identchar(int c) +{ + return (is_alnum(c) || c == '_'); } @@ -1569,7 +1569,7 @@ mpf1: s0 = s1; break; default: - if (do_lint && isalpha(cs1)) + if (do_lint && is_alpha(cs1)) lintwarn(_("ignoring unknown format specifier character `%c': no argument converted"), cs1); break; } @@ -2863,7 +2863,7 @@ again: } while (c != '\0' && c != ' ' && c != '\t') { - if (! isalpha(c) && ! in_eval) { + if (! is_alpha(c) && ! in_eval) { yyerror(_("invalid character in command")); return '\n'; } @@ -3031,12 +3031,12 @@ err: || c == ',' || c == '=') return *lexptr++; - if (c != '_' && ! isalpha(c)) { + if (c != '_' && ! is_alpha(c)) { yyerror(_("invalid character")); return '\n'; } - while (isalnum(c) || c == '_') + while (is_identchar(c)) c = *++lexptr; toklen = lexptr - tokstart; @@ -1112,7 +1112,7 @@ again: } while (c != '\0' && c != ' ' && c != '\t') { - if (! isalpha(c) && ! in_eval) { + if (! is_alpha(c) && ! in_eval) { yyerror(_("invalid character in command")); return '\n'; } @@ -1280,12 +1280,12 @@ err: || c == ',' || c == '=') return *lexptr++; - if (c != '_' && ! isalpha(c)) { + if (c != '_' && ! is_alpha(c)) { yyerror(_("invalid character")); return '\n'; } - while (isalnum(c) || c == '_') + while (is_identchar(c)) c = *++lexptr; toklen = lexptr - tokstart; diff --git a/doc/ChangeLog b/doc/ChangeLog index 1a1b54f7..8386515d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2014-09-15 Arnold D. Robbins <arnold@skeeve.com> + + * gawktexi.in: Document that identifiers must use the English + letters. + 2014-09-14 Arnold D. Robbins <arnold@skeeve.com> * gawktexi.in: More edits during review, minor addition. diff --git a/doc/gawk.info b/doc/gawk.info index bd9ddbab..d94ea8bf 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -7437,8 +7437,11 @@ File: gawk.info, Node: Using Variables, Next: Assignment Options, Up: Variabl Variables let you give names to values and refer to them later. Variables have already been used in many of the examples. The name of a variable must be a sequence of letters, digits, or underscores, and -it may not begin with a digit. Case is significant in variable names; -`a' and `A' are distinct variables. +it may not begin with a digit. Here, a "letter" is any one of the 52 +upper- and lowercase English letters. Other characters that may be +defined as letters in non-English locales are not valid in variable +names. Case is significant in variable names; `a' and `A' are distinct +variables. A variable name is a valid expression by itself; it represents the variable's current value. Variables are given new values with @@ -10299,8 +10302,11 @@ Options::), they are not special. `PROCINFO["identifiers"]' A subarray, indexed by the names of all identifiers used in - the text of the AWK program. For each identifier, the value - of the element is one of the following: + the text of the AWK program. An "identifier" is simply the + name of a variable (be it scalar or array), built-in + function, user-defined function, or extension function. For + each identifier, the value of the element is one of the + following: `"array"' The identifier is an array. @@ -13300,9 +13306,10 @@ starting to execute any of it. Here, NAME is the name of the function to define. A valid function name is like a valid variable name: a sequence of letters, digits, and -underscores that doesn't start with a digit. Within a single `awk' -program, any particular name can only be used as a variable, array, or -function. +underscores that doesn't start with a digit. Here too, only the 52 +upper- and lowercase English letters may be used in a function name. +Within a single `awk' program, any particular name can only be used as +a variable, array, or function. PARAMETER-LIST is an optional list of the function's arguments and local variable names, separated by commas. When the function is called, @@ -31733,7 +31740,7 @@ Index * common extensions, \x escape sequence: Escape Sequences. (line 61) * common extensions, BINMODE variable: PC Using. (line 33) * common extensions, delete to delete entire arrays: Delete. (line 39) -* common extensions, func keyword: Definition Syntax. (line 92) +* common extensions, func keyword: Definition Syntax. (line 93) * common extensions, length() applied to an array: String Functions. (line 197) * common extensions, RS as a regexp: gawk split records. (line 6) @@ -31845,7 +31852,7 @@ Index (line 46) * dark corner, FILENAME variable <1>: Auto-set. (line 90) * dark corner, FILENAME variable: Getline Notes. (line 19) -* dark corner, FNR/NR variables: Auto-set. (line 305) +* dark corner, FNR/NR variables: Auto-set. (line 308) * dark corner, format-control characters: Control Letters. (line 18) * dark corner, FS as null string: Single Character Fields. (line 20) @@ -32069,7 +32076,7 @@ Index (line 26) * differences in awk and gawk, RS/RT variables: gawk split records. (line 58) -* differences in awk and gawk, RT variable: Auto-set. (line 261) +* differences in awk and gawk, RT variable: Auto-set. (line 264) * differences in awk and gawk, single-character fields: Single Character Fields. (line 6) * differences in awk and gawk, split() function: String Functions. @@ -32077,7 +32084,7 @@ Index * differences in awk and gawk, strings: Scalar Constants. (line 20) * differences in awk and gawk, strings, storing: gawk split records. (line 77) -* differences in awk and gawk, SYMTAB variable: Auto-set. (line 265) +* differences in awk and gawk, SYMTAB variable: Auto-set. (line 268) * differences in awk and gawk, TEXTDOMAIN variable: User-modified. (line 152) * differences in awk and gawk, trunc-mod operation: Arithmetic Ops. @@ -32232,7 +32239,7 @@ Index (line 6) * extension API version: Extension Versioning. (line 6) -* extension API, version number: Auto-set. (line 228) +* extension API, version number: Auto-set. (line 231) * extension example: Extension Example. (line 6) * extension registration: Registration Functions. (line 6) @@ -32251,7 +32258,7 @@ Index * extensions, common, BINMODE variable: PC Using. (line 33) * extensions, common, delete to delete entire arrays: Delete. (line 39) * extensions, common, fflush() function: I/O Functions. (line 43) -* extensions, common, func keyword: Definition Syntax. (line 92) +* extensions, common, func keyword: Definition Syntax. (line 93) * extensions, common, length() applied to an array: String Functions. (line 197) * extensions, common, RS as a regexp: gawk split records. (line 6) @@ -32384,7 +32391,7 @@ Index (line 12) * FNR variable <1>: Auto-set. (line 99) * FNR variable: Records. (line 6) -* FNR variable, changing: Auto-set. (line 305) +* FNR variable, changing: Auto-set. (line 308) * for statement: For Statement. (line 6) * for statement, looping over arrays: Scanning an Array. (line 20) * fork() extension function: Extension Sample Fork. @@ -32470,7 +32477,7 @@ Index (line 6) * functions, names of <1>: Definition Syntax. (line 23) * functions, names of: Arrays. (line 18) -* functions, recursive: Definition Syntax. (line 82) +* functions, recursive: Definition Syntax. (line 83) * functions, string-translation: I18N Functions. (line 6) * functions, undefined: Pass By Value/Reference. (line 71) @@ -32485,7 +32492,7 @@ Index * G-d: Acknowledgments. (line 92) * Garfinkle, Scott: Contributors. (line 34) * gawk program, dynamic profiling: Profiling. (line 179) -* gawk version: Auto-set. (line 203) +* gawk version: Auto-set. (line 206) * gawk, ARGIND variable in: Other Arguments. (line 12) * gawk, awk and <1>: This Manual. (line 14) * gawk, awk and: Preface. (line 21) @@ -32562,14 +32569,14 @@ Index * gawk, regular expressions, operators: GNU Regexp Operators. (line 6) * gawk, regular expressions, precedence: Regexp Operators. (line 161) -* gawk, RT variable in <1>: Auto-set. (line 261) +* gawk, RT variable in <1>: Auto-set. (line 264) * gawk, RT variable in <2>: Multiple Line. (line 129) * gawk, RT variable in: awk split records. (line 124) * gawk, See Also awk: Preface. (line 34) * gawk, source code, obtaining: Getting. (line 6) * gawk, splitting fields and: Constant Size. (line 88) * gawk, string-translation functions: I18N Functions. (line 6) -* gawk, SYMTAB array in: Auto-set. (line 265) +* gawk, SYMTAB array in: Auto-set. (line 268) * gawk, TEXTDOMAIN variable in: User-modified. (line 152) * gawk, timestamps: Time Functions. (line 6) * gawk, uses for: Preface. (line 34) @@ -32655,7 +32662,7 @@ Index * Grigera, Juan: Contributors. (line 57) * group database, reading: Group Functions. (line 6) * group file: Group Functions. (line 6) -* group ID of gawk user: Auto-set. (line 176) +* group ID of gawk user: Auto-set. (line 179) * groups, information about: Group Functions. (line 6) * gsub <1>: String Functions. (line 139) * gsub: Using Constant Regexps. @@ -32949,7 +32956,7 @@ Index * mawk utility <3>: Concatenation. (line 36) * mawk utility <4>: Getline/Pipe. (line 62) * mawk utility: Escape Sequences. (line 130) -* maximum precision supported by MPFR library: Auto-set. (line 217) +* maximum precision supported by MPFR library: Auto-set. (line 220) * McIlroy, Doug: Glossary. (line 149) * McPhee, Patrick: Contributors. (line 100) * message object files: Explaining gettext. (line 42) @@ -32962,7 +32969,7 @@ Index * messages from extensions: Printing Messages. (line 6) * metacharacters in regular expressions: Regexp Operators. (line 6) * metacharacters, escape sequences for: Escape Sequences. (line 136) -* minimum precision supported by MPFR library: Auto-set. (line 220) +* minimum precision supported by MPFR library: Auto-set. (line 223) * mktime: Time Functions. (line 25) * modifiers, in format specifiers: Format Modifiers. (line 6) * monetary information, localization: Explaining gettext. (line 104) @@ -33024,7 +33031,7 @@ Index * not Boolean-logic operator: Boolean Ops. (line 6) * NR variable <1>: Auto-set. (line 124) * NR variable: Records. (line 6) -* NR variable, changing: Auto-set. (line 305) +* NR variable, changing: Auto-set. (line 308) * null strings <1>: Basic Data Typing. (line 26) * null strings <2>: Truth Values. (line 6) * null strings <3>: Regexp Field Splitting. @@ -33138,7 +33145,7 @@ Index * p debugger command (alias for print): Viewing And Changing Data. (line 36) * Papadopoulos, Panos: Contributors. (line 128) -* parent process ID of gawk process: Auto-set. (line 185) +* parent process ID of gawk process: Auto-set. (line 188) * parentheses (), in a profile: Profiling. (line 146) * parentheses (), regexp operator: Regexp Operators. (line 81) * password file: Passwd Functions. (line 16) @@ -33194,7 +33201,7 @@ Index (line 65) * portability, deleting array elements: Delete. (line 56) * portability, example programs: Library Functions. (line 42) -* portability, functions, defining: Definition Syntax. (line 108) +* portability, functions, defining: Definition Syntax. (line 109) * portability, gawk: New Ports. (line 6) * portability, gettext library and: Explaining gettext. (line 11) * portability, internationalization and: I18N Portability. (line 6) @@ -33240,7 +33247,7 @@ Index (line 40) * POSIX awk, field separators and: Fields. (line 6) * POSIX awk, FS variable and: User-modified. (line 60) -* POSIX awk, function keyword in: Definition Syntax. (line 92) +* POSIX awk, function keyword in: Definition Syntax. (line 93) * POSIX awk, functions and, gsub()/sub(): Gory Details. (line 90) * POSIX awk, functions and, length(): String Functions. (line 176) * POSIX awk, GNU long options and: Options. (line 15) @@ -33301,8 +33308,8 @@ Index * printing, unduplicated lines of text: Uniq Program. (line 6) * printing, user information: Id Program. (line 6) * private variables: Library Names. (line 11) -* process group idIDof gawk process: Auto-set. (line 179) -* process ID of gawk process: Auto-set. (line 182) +* process group idIDof gawk process: Auto-set. (line 182) +* process ID of gawk process: Auto-set. (line 185) * processes, two-way communications with: Two-way I/O. (line 6) * processing data: Basic High Level. (line 6) * PROCINFO array <1>: Passwd Functions. (line 6) @@ -33313,7 +33320,7 @@ Index * PROCINFO array, and user and group ID numbers: Id Program. (line 15) * PROCINFO array, testing the field splitting: Passwd Functions. (line 161) -* PROCINFO array, uses: Auto-set. (line 238) +* PROCINFO array, uses: Auto-set. (line 241) * PROCINFO, values of sorted_in: Controlling Scanning. (line 26) * profiling awk programs: Profiling. (line 6) @@ -33329,7 +33336,7 @@ Index * programming conventions, functions, calling: Calling Built-in. (line 10) * programming conventions, functions, writing: Definition Syntax. - (line 64) + (line 65) * programming conventions, gawk extensions: Internal File Ops. (line 45) * programming conventions, private variable names: Library Names. @@ -33399,7 +33406,7 @@ Index * records, splitting input into: Records. (line 6) * records, terminating: awk split records. (line 124) * records, treating files as: gawk split records. (line 92) -* recursive functions: Definition Syntax. (line 82) +* recursive functions: Definition Syntax. (line 83) * redirect gawk output, in debugger: Debugger Info. (line 72) * redirection of input: Getline/File. (line 6) * redirection of output: Redirection. (line 6) @@ -33477,7 +33484,7 @@ Index * right shift: Bitwise Functions. (line 52) * right shift, bitwise: Bitwise Functions. (line 32) * Ritchie, Dennis: Basic Data Typing. (line 54) -* RLENGTH variable: Auto-set. (line 248) +* RLENGTH variable: Auto-set. (line 251) * RLENGTH variable, match() function and: String Functions. (line 224) * Robbins, Arnold <1>: Future Extensions. (line 6) * Robbins, Arnold <2>: Bugs. (line 32) @@ -33503,9 +33510,9 @@ Index * RS variable: awk split records. (line 12) * RS variable, multiline records and: Multiple Line. (line 17) * rshift: Bitwise Functions. (line 52) -* RSTART variable: Auto-set. (line 254) +* RSTART variable: Auto-set. (line 257) * RSTART variable, match() function and: String Functions. (line 224) -* RT variable <1>: Auto-set. (line 261) +* RT variable <1>: Auto-set. (line 264) * RT variable <2>: Multiple Line. (line 129) * RT variable: awk split records. (line 124) * Rubin, Paul <1>: Contributors. (line 15) @@ -33525,7 +33532,7 @@ Index * scanning arrays: Scanning an Array. (line 6) * scanning multidimensional arrays: Multiscanning. (line 11) * Schorr, Andrew <1>: Contributors. (line 133) -* Schorr, Andrew <2>: Auto-set. (line 288) +* Schorr, Andrew <2>: Auto-set. (line 291) * Schorr, Andrew: Acknowledgments. (line 60) * Schreiber, Bert: Acknowledgments. (line 38) * Schreiber, Rita: Acknowledgments. (line 38) @@ -33569,7 +33576,7 @@ Index * set directory of message catalogs: I18N Functions. (line 12) * set watchpoint: Viewing And Changing Data. (line 67) -* shadowing of variable values: Definition Syntax. (line 70) +* shadowing of variable values: Definition Syntax. (line 71) * shell quoting, rules for: Quoting. (line 6) * shells, piping commands into: Redirection. (line 142) * shells, quoting: Using Shell Variables. @@ -33609,7 +33616,7 @@ Index (line 116) * sidebar, Changing FS Does Not Affect the Fields: Field Splitting Summary. (line 38) -* sidebar, Changing NR and FNR: Auto-set. (line 303) +* sidebar, Changing NR and FNR: Auto-set. (line 306) * sidebar, Controlling Output Buffering with system(): I/O Functions. (line 138) * sidebar, Escape Sequences for Metacharacters: Escape Sequences. @@ -33772,9 +33779,9 @@ Index * substr: String Functions. (line 479) * substring: String Functions. (line 479) * Sumner, Andrew: Other Versions. (line 64) -* supplementary groups of gawk process: Auto-set. (line 233) +* supplementary groups of gawk process: Auto-set. (line 236) * switch statement: Switch Statement. (line 6) -* SYMTAB array: Auto-set. (line 265) +* SYMTAB array: Auto-set. (line 268) * syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops. (line 148) * system: I/O Functions. (line 75) @@ -33927,7 +33934,7 @@ Index * variables: Other Features. (line 6) * variables, assigning on command line: Assignment Options. (line 6) * variables, built-in <1>: Built-in Variables. (line 6) -* variables, built-in: Using Variables. (line 20) +* variables, built-in: Using Variables. (line 23) * variables, built-in, -v option, setting with: Options. (line 40) * variables, built-in, conveying information: Auto-set. (line 6) * variables, flag: Boolean Ops. (line 67) @@ -33940,22 +33947,22 @@ Index * variables, getline command into, using: Getline/Variable. (line 6) * variables, global, for library functions: Library Names. (line 11) * variables, global, printing list of: Options. (line 93) -* variables, initializing: Using Variables. (line 20) +* variables, initializing: Using Variables. (line 23) * variables, local to a function: Variable Scope. (line 6) * variables, names of: Arrays. (line 18) * variables, private: Library Names. (line 11) * variables, setting: Options. (line 32) -* variables, shadowing: Definition Syntax. (line 70) +* variables, shadowing: Definition Syntax. (line 71) * variables, types of: Assignment Ops. (line 40) * variables, types of, comparison expressions and: Typing and Comparison. (line 9) * variables, uninitialized, as array subscripts: Uninitialized Subscripts. (line 6) * variables, user-defined: Variables. (line 6) -* version of gawk: Auto-set. (line 203) -* version of gawk extension API: Auto-set. (line 228) -* version of GNU MP library: Auto-set. (line 214) -* version of GNU MPFR library: Auto-set. (line 210) +* version of gawk: Auto-set. (line 206) +* version of gawk extension API: Auto-set. (line 231) +* version of GNU MP library: Auto-set. (line 217) +* version of GNU MPFR library: Auto-set. (line 213) * vertical bar (|): Regexp Operators. (line 70) * vertical bar (|), | operator (I/O) <1>: Precedence. (line 65) * vertical bar (|), | operator (I/O): Getline/Pipe. (line 9) @@ -34184,411 +34191,411 @@ Node: Regexp Constants318867 Node: Using Constant Regexps319392 Node: Variables322464 Node: Using Variables323119 -Node: Assignment Options324843 -Node: Conversion326718 -Node: Strings And Numbers327242 -Ref: Strings And Numbers-Footnote-1330304 -Node: Locale influences conversions330413 -Ref: table-locale-affects333130 -Node: All Operators333718 -Node: Arithmetic Ops334348 -Node: Concatenation336853 -Ref: Concatenation-Footnote-1339672 -Node: Assignment Ops339778 -Ref: table-assign-ops344761 -Node: Increment Ops346064 -Node: Truth Values and Conditions349502 -Node: Truth Values350585 -Node: Typing and Comparison351634 -Node: Variable Typing352427 -Node: Comparison Operators356079 -Ref: table-relational-ops356489 -Node: POSIX String Comparison360039 -Ref: POSIX String Comparison-Footnote-1361123 -Node: Boolean Ops361261 -Ref: Boolean Ops-Footnote-1365600 -Node: Conditional Exp365691 -Node: Function Calls367418 -Node: Precedence371298 -Node: Locales374967 -Node: Expressions Summary376598 -Node: Patterns and Actions379139 -Node: Pattern Overview380255 -Node: Regexp Patterns381932 -Node: Expression Patterns382475 -Node: Ranges386255 -Node: BEGIN/END389361 -Node: Using BEGIN/END390123 -Ref: Using BEGIN/END-Footnote-1392859 -Node: I/O And BEGIN/END392965 -Node: BEGINFILE/ENDFILE395236 -Node: Empty398167 -Node: Using Shell Variables398484 -Node: Action Overview400767 -Node: Statements403094 -Node: If Statement404942 -Node: While Statement406440 -Node: Do Statement408484 -Node: For Statement409640 -Node: Switch Statement412792 -Node: Break Statement415180 -Node: Continue Statement417221 -Node: Next Statement419046 -Node: Nextfile Statement421416 -Node: Exit Statement424073 -Node: Built-in Variables426477 -Node: User-modified427604 -Ref: User-modified-Footnote-1435293 -Node: Auto-set435355 -Ref: Auto-set-Footnote-1448037 -Ref: Auto-set-Footnote-2448242 -Node: ARGC and ARGV448298 -Node: Pattern Action Summary452202 -Node: Arrays454425 -Node: Array Basics455974 -Node: Array Intro456800 -Ref: figure-array-elements458773 -Ref: Array Intro-Footnote-1461297 -Node: Reference to Elements461425 -Node: Assigning Elements463875 -Node: Array Example464366 -Node: Scanning an Array466098 -Node: Controlling Scanning469099 -Ref: Controlling Scanning-Footnote-1474272 -Node: Delete474588 -Ref: Delete-Footnote-1477339 -Node: Numeric Array Subscripts477396 -Node: Uninitialized Subscripts479579 -Node: Multidimensional481206 -Node: Multiscanning484319 -Node: Arrays of Arrays485908 -Node: Arrays Summary490571 -Node: Functions492676 -Node: Built-in493549 -Node: Calling Built-in494627 -Node: Numeric Functions496615 -Ref: Numeric Functions-Footnote-1500649 -Ref: Numeric Functions-Footnote-2501006 -Ref: Numeric Functions-Footnote-3501054 -Node: String Functions501323 -Ref: String Functions-Footnote-1524320 -Ref: String Functions-Footnote-2524449 -Ref: String Functions-Footnote-3524697 -Node: Gory Details524784 -Ref: table-sub-escapes526557 -Ref: table-sub-proposed528077 -Ref: table-posix-sub529441 -Ref: table-gensub-escapes530981 -Ref: Gory Details-Footnote-1532157 -Node: I/O Functions532308 -Ref: I/O Functions-Footnote-1539418 -Node: Time Functions539565 -Ref: Time Functions-Footnote-1550029 -Ref: Time Functions-Footnote-2550097 -Ref: Time Functions-Footnote-3550255 -Ref: Time Functions-Footnote-4550366 -Ref: Time Functions-Footnote-5550478 -Ref: Time Functions-Footnote-6550705 -Node: Bitwise Functions550971 -Ref: table-bitwise-ops551533 -Ref: Bitwise Functions-Footnote-1555778 -Node: Type Functions555962 -Node: I18N Functions557104 -Node: User-defined558749 -Node: Definition Syntax559553 -Ref: Definition Syntax-Footnote-1564866 -Node: Function Example564935 -Ref: Function Example-Footnote-1567575 -Node: Function Caveats567597 -Node: Calling A Function568115 -Node: Variable Scope569070 -Node: Pass By Value/Reference572058 -Node: Return Statement575568 -Node: Dynamic Typing578552 -Node: Indirect Calls579481 -Ref: Indirect Calls-Footnote-1589197 -Node: Functions Summary589325 -Node: Library Functions591975 -Ref: Library Functions-Footnote-1595593 -Ref: Library Functions-Footnote-2595736 -Node: Library Names595907 -Ref: Library Names-Footnote-1599380 -Ref: Library Names-Footnote-2599600 -Node: General Functions599686 -Node: Strtonum Function600714 -Node: Assert Function603616 -Node: Round Function606942 -Node: Cliff Random Function608483 -Node: Ordinal Functions609499 -Ref: Ordinal Functions-Footnote-1612564 -Ref: Ordinal Functions-Footnote-2612816 -Node: Join Function613027 -Ref: Join Function-Footnote-1614798 -Node: Getlocaltime Function614998 -Node: Readfile Function618734 -Node: Data File Management620573 -Node: Filetrans Function621205 -Node: Rewind Function625274 -Node: File Checking626832 -Ref: File Checking-Footnote-1627964 -Node: Empty Files628165 -Node: Ignoring Assigns630144 -Node: Getopt Function631698 -Ref: Getopt Function-Footnote-1642962 -Node: Passwd Functions643165 -Ref: Passwd Functions-Footnote-1652144 -Node: Group Functions652232 -Ref: Group Functions-Footnote-1660163 -Node: Walking Arrays660376 -Node: Library Functions Summary661979 -Node: Library Exercises663367 -Node: Sample Programs664647 -Node: Running Examples665417 -Node: Clones666145 -Node: Cut Program667369 -Node: Egrep Program677227 -Ref: Egrep Program-Footnote-1684814 -Node: Id Program684924 -Node: Split Program688578 -Ref: Split Program-Footnote-1692116 -Node: Tee Program692244 -Node: Uniq Program695031 -Node: Wc Program702454 -Ref: Wc Program-Footnote-1706719 -Node: Miscellaneous Programs706811 -Node: Dupword Program708024 -Node: Alarm Program710055 -Node: Translate Program714859 -Ref: Translate Program-Footnote-1719432 -Ref: Translate Program-Footnote-2719702 -Node: Labels Program719841 -Ref: Labels Program-Footnote-1723202 -Node: Word Sorting723286 -Node: History Sorting727329 -Node: Extract Program729165 -Node: Simple Sed736701 -Node: Igawk Program739763 -Ref: Igawk Program-Footnote-1754067 -Ref: Igawk Program-Footnote-2754268 -Node: Anagram Program754406 -Node: Signature Program757474 -Node: Programs Summary758721 -Node: Programs Exercises759936 -Ref: Programs Exercises-Footnote-1764067 -Node: Advanced Features764158 -Node: Nondecimal Data766106 -Node: Array Sorting767683 -Node: Controlling Array Traversal768380 -Node: Array Sorting Functions776660 -Ref: Array Sorting Functions-Footnote-1780567 -Node: Two-way I/O780761 -Ref: Two-way I/O-Footnote-1785705 -Ref: Two-way I/O-Footnote-2785884 -Node: TCP/IP Networking785966 -Node: Profiling788811 -Node: Advanced Features Summary796353 -Node: Internationalization798217 -Node: I18N and L10N799697 -Node: Explaining gettext800383 -Ref: Explaining gettext-Footnote-1805409 -Ref: Explaining gettext-Footnote-2805593 -Node: Programmer i18n805758 -Ref: Programmer i18n-Footnote-1810552 -Node: Translator i18n810601 -Node: String Extraction811395 -Ref: String Extraction-Footnote-1812528 -Node: Printf Ordering812614 -Ref: Printf Ordering-Footnote-1815396 -Node: I18N Portability815460 -Ref: I18N Portability-Footnote-1817909 -Node: I18N Example817972 -Ref: I18N Example-Footnote-1820678 -Node: Gawk I18N820750 -Node: I18N Summary821388 -Node: Debugger822727 -Node: Debugging823749 -Node: Debugging Concepts824190 -Node: Debugging Terms826046 -Node: Awk Debugging828643 -Node: Sample Debugging Session829535 -Node: Debugger Invocation830055 -Node: Finding The Bug831391 -Node: List of Debugger Commands837870 -Node: Breakpoint Control839202 -Node: Debugger Execution Control842866 -Node: Viewing And Changing Data846226 -Node: Execution Stack849584 -Node: Debugger Info851097 -Node: Miscellaneous Debugger Commands855091 -Node: Readline Support860275 -Node: Limitations861167 -Node: Debugging Summary863440 -Node: Arbitrary Precision Arithmetic864608 -Node: Computer Arithmetic866095 -Ref: Computer Arithmetic-Footnote-1870482 -Node: Math Definitions870539 -Ref: table-ieee-formats873828 -Ref: Math Definitions-Footnote-1874368 -Node: MPFR features874471 -Node: FP Math Caution876088 -Ref: FP Math Caution-Footnote-1877138 -Node: Inexactness of computations877507 -Node: Inexact representation878455 -Node: Comparing FP Values879810 -Node: Errors accumulate880774 -Node: Getting Accuracy882207 -Node: Try To Round884866 -Node: Setting precision885765 -Ref: table-predefined-precision-strings886447 -Node: Setting the rounding mode888240 -Ref: table-gawk-rounding-modes888604 -Ref: Setting the rounding mode-Footnote-1892058 -Node: Arbitrary Precision Integers892237 -Ref: Arbitrary Precision Integers-Footnote-1895218 -Node: POSIX Floating Point Problems895367 -Ref: POSIX Floating Point Problems-Footnote-1899243 -Node: Floating point summary899281 -Node: Dynamic Extensions901485 -Node: Extension Intro903037 -Node: Plugin License904302 -Node: Extension Mechanism Outline904987 -Ref: figure-load-extension905411 -Ref: figure-load-new-function906896 -Ref: figure-call-new-function907898 -Node: Extension API Description909882 -Node: Extension API Functions Introduction911332 -Node: General Data Types916199 -Ref: General Data Types-Footnote-1921892 -Node: Requesting Values922191 -Ref: table-value-types-returned922928 -Node: Memory Allocation Functions923886 -Ref: Memory Allocation Functions-Footnote-1926633 -Node: Constructor Functions926729 -Node: Registration Functions928487 -Node: Extension Functions929172 -Node: Exit Callback Functions931474 -Node: Extension Version String932722 -Node: Input Parsers933372 -Node: Output Wrappers943186 -Node: Two-way processors947702 -Node: Printing Messages949906 -Ref: Printing Messages-Footnote-1950983 -Node: Updating `ERRNO'951135 -Node: Accessing Parameters951874 -Node: Symbol Table Access953104 -Node: Symbol table by name953618 -Node: Symbol table by cookie955594 -Ref: Symbol table by cookie-Footnote-1959727 -Node: Cached values959790 -Ref: Cached values-Footnote-1963294 -Node: Array Manipulation963385 -Ref: Array Manipulation-Footnote-1964483 -Node: Array Data Types964522 -Ref: Array Data Types-Footnote-1967225 -Node: Array Functions967317 -Node: Flattening Arrays971191 -Node: Creating Arrays978043 -Node: Extension API Variables982774 -Node: Extension Versioning983410 -Node: Extension API Informational Variables985311 -Node: Extension API Boilerplate986397 -Node: Finding Extensions990201 -Node: Extension Example990761 -Node: Internal File Description991491 -Node: Internal File Ops995582 -Ref: Internal File Ops-Footnote-11007014 -Node: Using Internal File Ops1007154 -Ref: Using Internal File Ops-Footnote-11009501 -Node: Extension Samples1009769 -Node: Extension Sample File Functions1011293 -Node: Extension Sample Fnmatch1018861 -Node: Extension Sample Fork1020343 -Node: Extension Sample Inplace1021556 -Node: Extension Sample Ord1023231 -Node: Extension Sample Readdir1024067 -Ref: table-readdir-file-types1024923 -Node: Extension Sample Revout1025722 -Node: Extension Sample Rev2way1026313 -Node: Extension Sample Read write array1027054 -Node: Extension Sample Readfile1028933 -Node: Extension Sample API Tests1030033 -Node: Extension Sample Time1030558 -Node: gawkextlib1031873 -Node: Extension summary1034686 -Node: Extension Exercises1038379 -Node: Language History1039101 -Node: V7/SVR3.11040744 -Node: SVR41043064 -Node: POSIX1044506 -Node: BTL1045892 -Node: POSIX/GNU1046626 -Node: Feature History1052342 -Node: Common Extensions1065433 -Node: Ranges and Locales1066745 -Ref: Ranges and Locales-Footnote-11071362 -Ref: Ranges and Locales-Footnote-21071389 -Ref: Ranges and Locales-Footnote-31071623 -Node: Contributors1071844 -Node: History summary1077269 -Node: Installation1078638 -Node: Gawk Distribution1079589 -Node: Getting1080073 -Node: Extracting1080897 -Node: Distribution contents1082539 -Node: Unix Installation1088256 -Node: Quick Installation1088873 -Node: Additional Configuration Options1091315 -Node: Configuration Philosophy1093053 -Node: Non-Unix Installation1095404 -Node: PC Installation1095862 -Node: PC Binary Installation1097173 -Node: PC Compiling1099021 -Ref: PC Compiling-Footnote-11102020 -Node: PC Testing1102125 -Node: PC Using1103301 -Node: Cygwin1107453 -Node: MSYS1108262 -Node: VMS Installation1108776 -Node: VMS Compilation1109572 -Ref: VMS Compilation-Footnote-11110794 -Node: VMS Dynamic Extensions1110852 -Node: VMS Installation Details1112225 -Node: VMS Running1114477 -Node: VMS GNV1117311 -Node: VMS Old Gawk1118034 -Node: Bugs1118504 -Node: Other Versions1122508 -Node: Installation summary1128735 -Node: Notes1129791 -Node: Compatibility Mode1130656 -Node: Additions1131438 -Node: Accessing The Source1132363 -Node: Adding Code1133799 -Node: New Ports1139977 -Node: Derived Files1144458 -Ref: Derived Files-Footnote-11149933 -Ref: Derived Files-Footnote-21149967 -Ref: Derived Files-Footnote-31150563 -Node: Future Extensions1150677 -Node: Implementation Limitations1151283 -Node: Extension Design1152531 -Node: Old Extension Problems1153685 -Ref: Old Extension Problems-Footnote-11155202 -Node: Extension New Mechanism Goals1155259 -Ref: Extension New Mechanism Goals-Footnote-11158619 -Node: Extension Other Design Decisions1158808 -Node: Extension Future Growth1160914 -Node: Old Extension Mechanism1161750 -Node: Notes summary1163512 -Node: Basic Concepts1164698 -Node: Basic High Level1165379 -Ref: figure-general-flow1165651 -Ref: figure-process-flow1166250 -Ref: Basic High Level-Footnote-11169479 -Node: Basic Data Typing1169664 -Node: Glossary1172992 -Node: Copying1198144 -Node: GNU Free Documentation License1235700 -Node: Index1260836 +Node: Assignment Options325025 +Node: Conversion326900 +Node: Strings And Numbers327424 +Ref: Strings And Numbers-Footnote-1330486 +Node: Locale influences conversions330595 +Ref: table-locale-affects333312 +Node: All Operators333900 +Node: Arithmetic Ops334530 +Node: Concatenation337035 +Ref: Concatenation-Footnote-1339854 +Node: Assignment Ops339960 +Ref: table-assign-ops344943 +Node: Increment Ops346246 +Node: Truth Values and Conditions349684 +Node: Truth Values350767 +Node: Typing and Comparison351816 +Node: Variable Typing352609 +Node: Comparison Operators356261 +Ref: table-relational-ops356671 +Node: POSIX String Comparison360221 +Ref: POSIX String Comparison-Footnote-1361305 +Node: Boolean Ops361443 +Ref: Boolean Ops-Footnote-1365782 +Node: Conditional Exp365873 +Node: Function Calls367600 +Node: Precedence371480 +Node: Locales375149 +Node: Expressions Summary376780 +Node: Patterns and Actions379321 +Node: Pattern Overview380437 +Node: Regexp Patterns382114 +Node: Expression Patterns382657 +Node: Ranges386437 +Node: BEGIN/END389543 +Node: Using BEGIN/END390305 +Ref: Using BEGIN/END-Footnote-1393041 +Node: I/O And BEGIN/END393147 +Node: BEGINFILE/ENDFILE395418 +Node: Empty398349 +Node: Using Shell Variables398666 +Node: Action Overview400949 +Node: Statements403276 +Node: If Statement405124 +Node: While Statement406622 +Node: Do Statement408666 +Node: For Statement409822 +Node: Switch Statement412974 +Node: Break Statement415362 +Node: Continue Statement417403 +Node: Next Statement419228 +Node: Nextfile Statement421598 +Node: Exit Statement424255 +Node: Built-in Variables426659 +Node: User-modified427786 +Ref: User-modified-Footnote-1435475 +Node: Auto-set435537 +Ref: Auto-set-Footnote-1448389 +Ref: Auto-set-Footnote-2448594 +Node: ARGC and ARGV448650 +Node: Pattern Action Summary452554 +Node: Arrays454777 +Node: Array Basics456326 +Node: Array Intro457152 +Ref: figure-array-elements459125 +Ref: Array Intro-Footnote-1461649 +Node: Reference to Elements461777 +Node: Assigning Elements464227 +Node: Array Example464718 +Node: Scanning an Array466450 +Node: Controlling Scanning469451 +Ref: Controlling Scanning-Footnote-1474624 +Node: Delete474940 +Ref: Delete-Footnote-1477691 +Node: Numeric Array Subscripts477748 +Node: Uninitialized Subscripts479931 +Node: Multidimensional481558 +Node: Multiscanning484671 +Node: Arrays of Arrays486260 +Node: Arrays Summary490923 +Node: Functions493028 +Node: Built-in493901 +Node: Calling Built-in494979 +Node: Numeric Functions496967 +Ref: Numeric Functions-Footnote-1501001 +Ref: Numeric Functions-Footnote-2501358 +Ref: Numeric Functions-Footnote-3501406 +Node: String Functions501675 +Ref: String Functions-Footnote-1524672 +Ref: String Functions-Footnote-2524801 +Ref: String Functions-Footnote-3525049 +Node: Gory Details525136 +Ref: table-sub-escapes526909 +Ref: table-sub-proposed528429 +Ref: table-posix-sub529793 +Ref: table-gensub-escapes531333 +Ref: Gory Details-Footnote-1532509 +Node: I/O Functions532660 +Ref: I/O Functions-Footnote-1539770 +Node: Time Functions539917 +Ref: Time Functions-Footnote-1550381 +Ref: Time Functions-Footnote-2550449 +Ref: Time Functions-Footnote-3550607 +Ref: Time Functions-Footnote-4550718 +Ref: Time Functions-Footnote-5550830 +Ref: Time Functions-Footnote-6551057 +Node: Bitwise Functions551323 +Ref: table-bitwise-ops551885 +Ref: Bitwise Functions-Footnote-1556130 +Node: Type Functions556314 +Node: I18N Functions557456 +Node: User-defined559101 +Node: Definition Syntax559905 +Ref: Definition Syntax-Footnote-1565309 +Node: Function Example565378 +Ref: Function Example-Footnote-1568018 +Node: Function Caveats568040 +Node: Calling A Function568558 +Node: Variable Scope569513 +Node: Pass By Value/Reference572501 +Node: Return Statement576011 +Node: Dynamic Typing578995 +Node: Indirect Calls579924 +Ref: Indirect Calls-Footnote-1589640 +Node: Functions Summary589768 +Node: Library Functions592418 +Ref: Library Functions-Footnote-1596036 +Ref: Library Functions-Footnote-2596179 +Node: Library Names596350 +Ref: Library Names-Footnote-1599823 +Ref: Library Names-Footnote-2600043 +Node: General Functions600129 +Node: Strtonum Function601157 +Node: Assert Function604059 +Node: Round Function607385 +Node: Cliff Random Function608926 +Node: Ordinal Functions609942 +Ref: Ordinal Functions-Footnote-1613007 +Ref: Ordinal Functions-Footnote-2613259 +Node: Join Function613470 +Ref: Join Function-Footnote-1615241 +Node: Getlocaltime Function615441 +Node: Readfile Function619177 +Node: Data File Management621016 +Node: Filetrans Function621648 +Node: Rewind Function625717 +Node: File Checking627275 +Ref: File Checking-Footnote-1628407 +Node: Empty Files628608 +Node: Ignoring Assigns630587 +Node: Getopt Function632141 +Ref: Getopt Function-Footnote-1643405 +Node: Passwd Functions643608 +Ref: Passwd Functions-Footnote-1652587 +Node: Group Functions652675 +Ref: Group Functions-Footnote-1660606 +Node: Walking Arrays660819 +Node: Library Functions Summary662422 +Node: Library Exercises663810 +Node: Sample Programs665090 +Node: Running Examples665860 +Node: Clones666588 +Node: Cut Program667812 +Node: Egrep Program677670 +Ref: Egrep Program-Footnote-1685257 +Node: Id Program685367 +Node: Split Program689021 +Ref: Split Program-Footnote-1692559 +Node: Tee Program692687 +Node: Uniq Program695474 +Node: Wc Program702897 +Ref: Wc Program-Footnote-1707162 +Node: Miscellaneous Programs707254 +Node: Dupword Program708467 +Node: Alarm Program710498 +Node: Translate Program715302 +Ref: Translate Program-Footnote-1719875 +Ref: Translate Program-Footnote-2720145 +Node: Labels Program720284 +Ref: Labels Program-Footnote-1723645 +Node: Word Sorting723729 +Node: History Sorting727772 +Node: Extract Program729608 +Node: Simple Sed737144 +Node: Igawk Program740206 +Ref: Igawk Program-Footnote-1754510 +Ref: Igawk Program-Footnote-2754711 +Node: Anagram Program754849 +Node: Signature Program757917 +Node: Programs Summary759164 +Node: Programs Exercises760379 +Ref: Programs Exercises-Footnote-1764510 +Node: Advanced Features764601 +Node: Nondecimal Data766549 +Node: Array Sorting768126 +Node: Controlling Array Traversal768823 +Node: Array Sorting Functions777103 +Ref: Array Sorting Functions-Footnote-1781010 +Node: Two-way I/O781204 +Ref: Two-way I/O-Footnote-1786148 +Ref: Two-way I/O-Footnote-2786327 +Node: TCP/IP Networking786409 +Node: Profiling789254 +Node: Advanced Features Summary796796 +Node: Internationalization798660 +Node: I18N and L10N800140 +Node: Explaining gettext800826 +Ref: Explaining gettext-Footnote-1805852 +Ref: Explaining gettext-Footnote-2806036 +Node: Programmer i18n806201 +Ref: Programmer i18n-Footnote-1810995 +Node: Translator i18n811044 +Node: String Extraction811838 +Ref: String Extraction-Footnote-1812971 +Node: Printf Ordering813057 +Ref: Printf Ordering-Footnote-1815839 +Node: I18N Portability815903 +Ref: I18N Portability-Footnote-1818352 +Node: I18N Example818415 +Ref: I18N Example-Footnote-1821121 +Node: Gawk I18N821193 +Node: I18N Summary821831 +Node: Debugger823170 +Node: Debugging824192 +Node: Debugging Concepts824633 +Node: Debugging Terms826489 +Node: Awk Debugging829086 +Node: Sample Debugging Session829978 +Node: Debugger Invocation830498 +Node: Finding The Bug831834 +Node: List of Debugger Commands838313 +Node: Breakpoint Control839645 +Node: Debugger Execution Control843309 +Node: Viewing And Changing Data846669 +Node: Execution Stack850027 +Node: Debugger Info851540 +Node: Miscellaneous Debugger Commands855534 +Node: Readline Support860718 +Node: Limitations861610 +Node: Debugging Summary863883 +Node: Arbitrary Precision Arithmetic865051 +Node: Computer Arithmetic866538 +Ref: Computer Arithmetic-Footnote-1870925 +Node: Math Definitions870982 +Ref: table-ieee-formats874271 +Ref: Math Definitions-Footnote-1874811 +Node: MPFR features874914 +Node: FP Math Caution876531 +Ref: FP Math Caution-Footnote-1877581 +Node: Inexactness of computations877950 +Node: Inexact representation878898 +Node: Comparing FP Values880253 +Node: Errors accumulate881217 +Node: Getting Accuracy882650 +Node: Try To Round885309 +Node: Setting precision886208 +Ref: table-predefined-precision-strings886890 +Node: Setting the rounding mode888683 +Ref: table-gawk-rounding-modes889047 +Ref: Setting the rounding mode-Footnote-1892501 +Node: Arbitrary Precision Integers892680 +Ref: Arbitrary Precision Integers-Footnote-1895661 +Node: POSIX Floating Point Problems895810 +Ref: POSIX Floating Point Problems-Footnote-1899686 +Node: Floating point summary899724 +Node: Dynamic Extensions901928 +Node: Extension Intro903480 +Node: Plugin License904745 +Node: Extension Mechanism Outline905430 +Ref: figure-load-extension905854 +Ref: figure-load-new-function907339 +Ref: figure-call-new-function908341 +Node: Extension API Description910325 +Node: Extension API Functions Introduction911775 +Node: General Data Types916642 +Ref: General Data Types-Footnote-1922335 +Node: Requesting Values922634 +Ref: table-value-types-returned923371 +Node: Memory Allocation Functions924329 +Ref: Memory Allocation Functions-Footnote-1927076 +Node: Constructor Functions927172 +Node: Registration Functions928930 +Node: Extension Functions929615 +Node: Exit Callback Functions931917 +Node: Extension Version String933165 +Node: Input Parsers933815 +Node: Output Wrappers943629 +Node: Two-way processors948145 +Node: Printing Messages950349 +Ref: Printing Messages-Footnote-1951426 +Node: Updating `ERRNO'951578 +Node: Accessing Parameters952317 +Node: Symbol Table Access953547 +Node: Symbol table by name954061 +Node: Symbol table by cookie956037 +Ref: Symbol table by cookie-Footnote-1960170 +Node: Cached values960233 +Ref: Cached values-Footnote-1963737 +Node: Array Manipulation963828 +Ref: Array Manipulation-Footnote-1964926 +Node: Array Data Types964965 +Ref: Array Data Types-Footnote-1967668 +Node: Array Functions967760 +Node: Flattening Arrays971634 +Node: Creating Arrays978486 +Node: Extension API Variables983217 +Node: Extension Versioning983853 +Node: Extension API Informational Variables985754 +Node: Extension API Boilerplate986840 +Node: Finding Extensions990644 +Node: Extension Example991204 +Node: Internal File Description991934 +Node: Internal File Ops996025 +Ref: Internal File Ops-Footnote-11007457 +Node: Using Internal File Ops1007597 +Ref: Using Internal File Ops-Footnote-11009944 +Node: Extension Samples1010212 +Node: Extension Sample File Functions1011736 +Node: Extension Sample Fnmatch1019304 +Node: Extension Sample Fork1020786 +Node: Extension Sample Inplace1021999 +Node: Extension Sample Ord1023674 +Node: Extension Sample Readdir1024510 +Ref: table-readdir-file-types1025366 +Node: Extension Sample Revout1026165 +Node: Extension Sample Rev2way1026756 +Node: Extension Sample Read write array1027497 +Node: Extension Sample Readfile1029376 +Node: Extension Sample API Tests1030476 +Node: Extension Sample Time1031001 +Node: gawkextlib1032316 +Node: Extension summary1035129 +Node: Extension Exercises1038822 +Node: Language History1039544 +Node: V7/SVR3.11041187 +Node: SVR41043507 +Node: POSIX1044949 +Node: BTL1046335 +Node: POSIX/GNU1047069 +Node: Feature History1052785 +Node: Common Extensions1065876 +Node: Ranges and Locales1067188 +Ref: Ranges and Locales-Footnote-11071805 +Ref: Ranges and Locales-Footnote-21071832 +Ref: Ranges and Locales-Footnote-31072066 +Node: Contributors1072287 +Node: History summary1077712 +Node: Installation1079081 +Node: Gawk Distribution1080032 +Node: Getting1080516 +Node: Extracting1081340 +Node: Distribution contents1082982 +Node: Unix Installation1088699 +Node: Quick Installation1089316 +Node: Additional Configuration Options1091758 +Node: Configuration Philosophy1093496 +Node: Non-Unix Installation1095847 +Node: PC Installation1096305 +Node: PC Binary Installation1097616 +Node: PC Compiling1099464 +Ref: PC Compiling-Footnote-11102463 +Node: PC Testing1102568 +Node: PC Using1103744 +Node: Cygwin1107896 +Node: MSYS1108705 +Node: VMS Installation1109219 +Node: VMS Compilation1110015 +Ref: VMS Compilation-Footnote-11111237 +Node: VMS Dynamic Extensions1111295 +Node: VMS Installation Details1112668 +Node: VMS Running1114920 +Node: VMS GNV1117754 +Node: VMS Old Gawk1118477 +Node: Bugs1118947 +Node: Other Versions1122951 +Node: Installation summary1129178 +Node: Notes1130234 +Node: Compatibility Mode1131099 +Node: Additions1131881 +Node: Accessing The Source1132806 +Node: Adding Code1134242 +Node: New Ports1140420 +Node: Derived Files1144901 +Ref: Derived Files-Footnote-11150376 +Ref: Derived Files-Footnote-21150410 +Ref: Derived Files-Footnote-31151006 +Node: Future Extensions1151120 +Node: Implementation Limitations1151726 +Node: Extension Design1152974 +Node: Old Extension Problems1154128 +Ref: Old Extension Problems-Footnote-11155645 +Node: Extension New Mechanism Goals1155702 +Ref: Extension New Mechanism Goals-Footnote-11159062 +Node: Extension Other Design Decisions1159251 +Node: Extension Future Growth1161357 +Node: Old Extension Mechanism1162193 +Node: Notes summary1163955 +Node: Basic Concepts1165141 +Node: Basic High Level1165822 +Ref: figure-general-flow1166094 +Ref: figure-process-flow1166693 +Ref: Basic High Level-Footnote-11169922 +Node: Basic Data Typing1170107 +Node: Glossary1173435 +Node: Copying1198587 +Node: GNU Free Documentation License1236143 +Node: Index1261279 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 4d54b53b..416d3c53 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -10717,7 +10717,11 @@ on the @command{awk} command line. Variables let you give names to values and refer to them later. Variables have already been used in many of the examples. The name of a variable must be a sequence of letters, digits, or underscores, and it may not begin -with a digit. Case is significant in variable names; @code{a} and @code{A} +with a digit. +Here, a @dfn{letter} is any one of the 52 upper- and lowercase +English letters. Other characters that may be defined as letters +in non-English locales are not valid in variable names. +Case is significant in variable names; @code{a} and @code{A} are distinct variables. A variable name is a valid expression by itself; it represents the @@ -14771,8 +14775,11 @@ or @code{"FPAT"} if field matching with @code{FPAT} is in effect. @item PROCINFO["identifiers"] @cindex program identifiers -A subarray, indexed by the names of all identifiers used in the -text of the AWK program. For each identifier, the value of the element is one of the following: +A subarray, indexed by the names of all identifiers used in the text of +the AWK program. An @dfn{identifier} is simply the name of a variable +(be it scalar or array), built-in function, user-defined function, or +extension function. For each identifier, the value of the element is +one of the following: @table @code @item "array" @@ -19174,6 +19181,8 @@ The definition of a function named @var{name} looks like this: Here, @var{name} is the name of the function to define. A valid function name is like a valid variable name: a sequence of letters, digits, and underscores that doesn't start with a digit. +Here too, only the 52 upper- and lowercase English letters may +be used in a function name. Within a single @command{awk} program, any particular name can only be used as a variable, array, or function. diff --git a/doc/gawktexi.in b/doc/gawktexi.in index e0a15f04..fac712e8 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -10190,7 +10190,11 @@ on the @command{awk} command line. Variables let you give names to values and refer to them later. Variables have already been used in many of the examples. The name of a variable must be a sequence of letters, digits, or underscores, and it may not begin -with a digit. Case is significant in variable names; @code{a} and @code{A} +with a digit. +Here, a @dfn{letter} is any one of the 52 upper- and lowercase +English letters. Other characters that may be defined as letters +in non-English locales are not valid in variable names. +Case is significant in variable names; @code{a} and @code{A} are distinct variables. A variable name is a valid expression by itself; it represents the @@ -14105,8 +14109,11 @@ or @code{"FPAT"} if field matching with @code{FPAT} is in effect. @item PROCINFO["identifiers"] @cindex program identifiers -A subarray, indexed by the names of all identifiers used in the -text of the AWK program. For each identifier, the value of the element is one of the following: +A subarray, indexed by the names of all identifiers used in the text of +the AWK program. An @dfn{identifier} is simply the name of a variable +(be it scalar or array), built-in function, user-defined function, or +extension function. For each identifier, the value of the element is +one of the following: @table @code @item "array" @@ -18301,6 +18308,8 @@ The definition of a function named @var{name} looks like this: Here, @var{name} is the name of the function to define. A valid function name is like a valid variable name: a sequence of letters, digits, and underscores that doesn't start with a digit. +Here too, only the 52 upper- and lowercase English letters may +be used in a function name. Within a single @command{awk} program, any particular name can only be used as a variable, array, or function. @@ -216,6 +216,7 @@ load_casetable(void) return; #ifndef ZOS_USS + /* use of isalpha is ok here (see is_alpha in awkgram.y) */ for (i = 0200; i <= 0377; i++) { if (isalpha(i) && islower(i) && i != toupper(i)) casetable[i] = toupper(i); @@ -46,33 +46,9 @@ extern SRCFILE *srcfiles; static bool is_letter(unsigned char c) { - switch (c) { - case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': - case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': - case 's': case 't': case 'u': case 'v': case 'w': case 'x': - case 'y': case 'z': - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': - case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': - case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': - case '_': - return true; - default: - return false; - } + return (is_alpha(c) || c == '_'); } -/* is_identifier_char --- return true if a character can be used in an identifier */ - -static bool -is_identifier_char(unsigned char c) -{ - return (is_letter(c) || isdigit(c)); -} - - #define INIT_FUNC "dl_load" /* load_ext --- load an external library */ @@ -224,7 +200,7 @@ make_builtin(const awk_ext_func_t *funcinfo) return awk_false; for (sp++; (c = *sp++) != '\0';) { - if (! is_identifier_char(c)) + if (! is_identchar(c)) return awk_false; } @@ -279,7 +255,7 @@ make_old_builtin(const char *name, NODE *(*func)(int), int count) /* temporary * fatal(_("extension: illegal character `%c' in function name `%s'"), *sp, name); for (sp++; (c = *sp++) != '\0';) { - if (! is_identifier_char(c)) + if (! is_identchar(c)) fatal(_("extension: illegal character `%c' in function name `%s'"), c, name); } @@ -1337,11 +1337,11 @@ arg_assign(char *arg, bool initing) /* first check that the variable name has valid syntax */ badvar = false; - if (! isalpha((unsigned char) arg[0]) && arg[0] != '_') + if (! is_alpha((unsigned char) arg[0]) && arg[0] != '_') badvar = true; else for (cp2 = arg+1; *cp2; cp2++) - if (! isalnum((unsigned char) *cp2) && *cp2 != '_') { + if (! is_identchar((unsigned char) *cp2)) { badvar = true; break; } @@ -72,7 +72,7 @@ r_force_number(NODE *n) * This also allows hexadecimal floating point. Ugh. */ if (! do_posix) { - if (isalpha((unsigned char) *cp)) { + if (is_alpha((unsigned char) *cp)) { return n; } else if (n->stlen == 4 && is_ieee_magic_val(n->stptr)) { if ((n->flags & MAYBE_NUM) != 0) @@ -94,7 +94,7 @@ r_force_number(NODE *n) if ( cp == cpend /* only spaces, or */ || (! do_posix /* not POSIXLY paranoid and */ - && (isalpha((unsigned char) *cp) /* letter, or */ + && (is_alpha((unsigned char) *cp) /* letter, or */ /* CANNOT do non-decimal and saw 0x */ || (! do_non_decimal_data && cp[0] == '0' && (cp[1] == 'x' || cp[1] == 'X'))))) { |