[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, feature/namespaces, updated. gawk-4.1.0-
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, feature/namespaces, updated. gawk-4.1.0-2647-g4138bc1 |
Date: |
Wed, 26 Jul 2017 02:51:39 -0400 (EDT) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, feature/namespaces has been updated
via 4138bc1e488b8dcb91de9cc3235d0294a0106d64 (commit)
from 708832674045de145cb78b465fb2cfcbb02ebcae (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=4138bc1e488b8dcb91de9cc3235d0294a0106d64
commit 4138bc1e488b8dcb91de9cc3235d0294a0106d64
Author: Arnold D. Robbins <address@hidden>
Date: Wed Jul 26 09:51:05 2017 +0300
Improve namespace identifer error mesasges. Add a test.
diff --git a/ChangeLog b/ChangeLog
index 0755ada..ff2c31f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2017-07-26 Arnold D. Robbins <address@hidden>
+
+ * awkgram.y (set_namespace): Change return type void, adjust
+ all return statements.
+ address@hidden: Don't YYABORT on bad namespace so that we can check
+ the rest of the program.
+ (validate_qualified_name): Check traditional / posix first. Return
+ after printing an error message; we don't want to print multiple
+ messages for the same identifer.
+ * interpret.h (r_interpret): For indirect call, set do_qualify
+ parameter of lookup based on presence of a colon.
+
2017-07-20 Arnold D. Robbins <address@hidden>
Make qualified names work with -v and command-line assignments.
diff --git a/awkgram.c b/awkgram.c
index 37b8c66..77119b0 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -95,7 +95,7 @@ static void dumpintlstr(const char *str, size_t len);
static void dumpintlstr2(const char *str1, size_t len1, const char *str2,
size_t len2);
static int include_source(INSTRUCTION *file);
static int load_library(INSTRUCTION *file);
-static bool set_namespace(INSTRUCTION *ns);
+static void set_namespace(INSTRUCTION *ns);
static void next_sourcefile(void);
static char *tokexpand(void);
static NODE *set_profile_text(NODE *n, const char *str, size_t len);
@@ -680,26 +680,26 @@ static const yytype_uint8 yytranslate[] =
static const yytype_uint16 yyrline[] =
{
0, 221, 221, 223, 228, 229, 233, 245, 250, 261,
- 268, 274, 280, 294, 302, 304, 309, 317, 319, 324,
- 326, 328, 334, 342, 352, 382, 396, 410, 418, 429,
- 441, 443, 445, 451, 459, 460, 464, 464, 510, 509,
- 543, 558, 560, 565, 575, 622, 627, 628, 632, 634,
- 636, 643, 733, 775, 817, 930, 937, 944, 955, 965,
- 975, 985, 997, 1014, 1013, 1038, 1050, 1050, 1149, 1149,
- 1183, 1214, 1223, 1224, 1230, 1231, 1238, 1243, 1255, 1269,
- 1271, 1279, 1286, 1288, 1296, 1305, 1307, 1316, 1317, 1325,
- 1330, 1330, 1341, 1345, 1353, 1354, 1357, 1359, 1364, 1365,
- 1374, 1375, 1380, 1385, 1394, 1396, 1398, 1405, 1406, 1412,
- 1413, 1418, 1420, 1425, 1427, 1435, 1440, 1449, 1450, 1455,
- 1457, 1462, 1464, 1472, 1477, 1485, 1486, 1491, 1498, 1502,
- 1504, 1506, 1519, 1536, 1546, 1553, 1555, 1560, 1562, 1564,
- 1572, 1574, 1579, 1581, 1586, 1588, 1590, 1646, 1648, 1650,
- 1652, 1654, 1656, 1658, 1660, 1674, 1679, 1684, 1709, 1715,
- 1717, 1719, 1721, 1723, 1725, 1730, 1734, 1766, 1773, 1779,
- 1785, 1798, 1799, 1800, 1805, 1810, 1814, 1818, 1833, 1854,
- 1859, 1896, 1938, 1939, 1945, 1946, 1951, 1953, 1960, 1977,
- 1994, 1996, 2003, 2008, 2016, 2026, 2038, 2047, 2051, 2055,
- 2059, 2063, 2067, 2070, 2072, 2076, 2080, 2084
+ 268, 274, 280, 293, 301, 303, 308, 316, 318, 323,
+ 325, 327, 333, 341, 351, 381, 395, 409, 417, 428,
+ 440, 442, 444, 450, 458, 459, 463, 463, 509, 508,
+ 542, 557, 559, 564, 574, 621, 626, 627, 631, 633,
+ 635, 642, 732, 774, 816, 929, 936, 943, 954, 964,
+ 974, 984, 996, 1013, 1012, 1037, 1049, 1049, 1148, 1148,
+ 1182, 1213, 1222, 1223, 1229, 1230, 1237, 1242, 1254, 1268,
+ 1270, 1278, 1285, 1287, 1295, 1304, 1306, 1315, 1316, 1324,
+ 1329, 1329, 1340, 1344, 1352, 1353, 1356, 1358, 1363, 1364,
+ 1373, 1374, 1379, 1384, 1393, 1395, 1397, 1404, 1405, 1411,
+ 1412, 1417, 1419, 1424, 1426, 1434, 1439, 1448, 1449, 1454,
+ 1456, 1461, 1463, 1471, 1476, 1484, 1485, 1490, 1497, 1501,
+ 1503, 1505, 1518, 1535, 1545, 1552, 1554, 1559, 1561, 1563,
+ 1571, 1573, 1578, 1580, 1585, 1587, 1589, 1645, 1647, 1649,
+ 1651, 1653, 1655, 1657, 1659, 1673, 1678, 1683, 1708, 1714,
+ 1716, 1718, 1720, 1722, 1724, 1729, 1733, 1765, 1772, 1778,
+ 1784, 1797, 1798, 1799, 1804, 1809, 1813, 1817, 1832, 1853,
+ 1858, 1895, 1937, 1938, 1944, 1945, 1950, 1952, 1959, 1976,
+ 1993, 1995, 2002, 2007, 2015, 2025, 2037, 2046, 2050, 2054,
+ 2058, 2062, 2066, 2069, 2071, 2075, 2079, 2083
};
#endif
@@ -1986,16 +1986,15 @@ yyreduce:
at_seen = false;
// this frees $3 storage in all cases
- if (! set_namespace((yyvsp[-1])))
- YYABORT;
+ set_namespace((yyvsp[-1]));
yyerrok;
}
-#line 1995 "awkgram.c" /* yacc.c:1646 */
+#line 1994 "awkgram.c" /* yacc.c:1646 */
break;
case 13:
-#line 295 "awkgram.y" /* yacc.c:1646 */
+#line 294 "awkgram.y" /* yacc.c:1646 */
{
if (include_source((yyvsp[0])) < 0)
YYABORT;
@@ -2003,23 +2002,23 @@ yyreduce:
bcfree((yyvsp[0]));
(yyval) = NULL;
}
-#line 2007 "awkgram.c" /* yacc.c:1646 */
+#line 2006 "awkgram.c" /* yacc.c:1646 */
break;
case 14:
-#line 303 "awkgram.y" /* yacc.c:1646 */
+#line 302 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2013 "awkgram.c" /* yacc.c:1646 */
+#line 2012 "awkgram.c" /* yacc.c:1646 */
break;
case 15:
-#line 305 "awkgram.y" /* yacc.c:1646 */
+#line 304 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2019 "awkgram.c" /* yacc.c:1646 */
+#line 2018 "awkgram.c" /* yacc.c:1646 */
break;
case 16:
-#line 310 "awkgram.y" /* yacc.c:1646 */
+#line 309 "awkgram.y" /* yacc.c:1646 */
{
if (load_library((yyvsp[0])) < 0)
YYABORT;
@@ -2027,41 +2026,41 @@ yyreduce:
bcfree((yyvsp[0]));
(yyval) = NULL;
}
-#line 2031 "awkgram.c" /* yacc.c:1646 */
+#line 2030 "awkgram.c" /* yacc.c:1646 */
break;
case 17:
-#line 318 "awkgram.y" /* yacc.c:1646 */
+#line 317 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2037 "awkgram.c" /* yacc.c:1646 */
+#line 2036 "awkgram.c" /* yacc.c:1646 */
break;
case 18:
-#line 320 "awkgram.y" /* yacc.c:1646 */
+#line 319 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2043 "awkgram.c" /* yacc.c:1646 */
+#line 2042 "awkgram.c" /* yacc.c:1646 */
break;
case 19:
-#line 325 "awkgram.y" /* yacc.c:1646 */
+#line 324 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2049 "awkgram.c" /* yacc.c:1646 */
+#line 2048 "awkgram.c" /* yacc.c:1646 */
break;
case 20:
-#line 327 "awkgram.y" /* yacc.c:1646 */
+#line 326 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2055 "awkgram.c" /* yacc.c:1646 */
+#line 2054 "awkgram.c" /* yacc.c:1646 */
break;
case 21:
-#line 329 "awkgram.y" /* yacc.c:1646 */
+#line 328 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2061 "awkgram.c" /* yacc.c:1646 */
+#line 2060 "awkgram.c" /* yacc.c:1646 */
break;
case 22:
-#line 334 "awkgram.y" /* yacc.c:1646 */
+#line 333 "awkgram.y" /* yacc.c:1646 */
{
rule = Rule;
if (comment != NULL) {
@@ -2070,11 +2069,11 @@ yyreduce:
} else
(yyval) = NULL;
}
-#line 2074 "awkgram.c" /* yacc.c:1646 */
+#line 2073 "awkgram.c" /* yacc.c:1646 */
break;
case 23:
-#line 343 "awkgram.y" /* yacc.c:1646 */
+#line 342 "awkgram.y" /* yacc.c:1646 */
{
rule = Rule;
if (comment != NULL) {
@@ -2083,11 +2082,11 @@ yyreduce:
} else
(yyval) = (yyvsp[0]);
}
-#line 2087 "awkgram.c" /* yacc.c:1646 */
+#line 2086 "awkgram.c" /* yacc.c:1646 */
break;
case 24:
-#line 353 "awkgram.y" /* yacc.c:1646 */
+#line 352 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *tp;
@@ -2117,11 +2116,11 @@ yyreduce:
(yyval) = list_append(list_merge((yyvsp[-3]),
(yyvsp[0])), tp);
rule = Rule;
}
-#line 2121 "awkgram.c" /* yacc.c:1646 */
+#line 2120 "awkgram.c" /* yacc.c:1646 */
break;
case 25:
-#line 383 "awkgram.y" /* yacc.c:1646 */
+#line 382 "awkgram.y" /* yacc.c:1646 */
{
static int begin_seen = 0;
@@ -2135,11 +2134,11 @@ yyreduce:
check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2139 "awkgram.c" /* yacc.c:1646 */
+#line 2138 "awkgram.c" /* yacc.c:1646 */
break;
case 26:
-#line 397 "awkgram.y" /* yacc.c:1646 */
+#line 396 "awkgram.y" /* yacc.c:1646 */
{
static int end_seen = 0;
@@ -2153,11 +2152,11 @@ yyreduce:
check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2157 "awkgram.c" /* yacc.c:1646 */
+#line 2156 "awkgram.c" /* yacc.c:1646 */
break;
case 27:
-#line 411 "awkgram.y" /* yacc.c:1646 */
+#line 410 "awkgram.y" /* yacc.c:1646 */
{
func_first = false;
(yyvsp[0])->in_rule = rule = BEGINFILE;
@@ -2165,11 +2164,11 @@ yyreduce:
check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2169 "awkgram.c" /* yacc.c:1646 */
+#line 2168 "awkgram.c" /* yacc.c:1646 */
break;
case 28:
-#line 419 "awkgram.y" /* yacc.c:1646 */
+#line 418 "awkgram.y" /* yacc.c:1646 */
{
func_first = false;
(yyvsp[0])->in_rule = rule = ENDFILE;
@@ -2177,11 +2176,11 @@ yyreduce:
check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2181 "awkgram.c" /* yacc.c:1646 */
+#line 2180 "awkgram.c" /* yacc.c:1646 */
break;
case 29:
-#line 430 "awkgram.y" /* yacc.c:1646 */
+#line 429 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip;
if ((yyvsp[-3]) == NULL)
@@ -2190,48 +2189,48 @@ yyreduce:
ip = (yyvsp[-3]);
(yyval) = ip;
}
-#line 2194 "awkgram.c" /* yacc.c:1646 */
+#line 2193 "awkgram.c" /* yacc.c:1646 */
break;
case 30:
-#line 442 "awkgram.y" /* yacc.c:1646 */
+#line 441 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2200 "awkgram.c" /* yacc.c:1646 */
+#line 2199 "awkgram.c" /* yacc.c:1646 */
break;
case 31:
-#line 444 "awkgram.y" /* yacc.c:1646 */
+#line 443 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2206 "awkgram.c" /* yacc.c:1646 */
+#line 2205 "awkgram.c" /* yacc.c:1646 */
break;
case 32:
-#line 446 "awkgram.y" /* yacc.c:1646 */
+#line 445 "awkgram.y" /* yacc.c:1646 */
{
yyerror(_("`%s' is a built-in function, it cannot be
redefined"),
tokstart);
YYABORT;
}
-#line 2216 "awkgram.c" /* yacc.c:1646 */
+#line 2215 "awkgram.c" /* yacc.c:1646 */
break;
case 33:
-#line 452 "awkgram.y" /* yacc.c:1646 */
+#line 451 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = (yyvsp[0]);
at_seen = false;
}
-#line 2225 "awkgram.c" /* yacc.c:1646 */
+#line 2224 "awkgram.c" /* yacc.c:1646 */
break;
case 36:
-#line 464 "awkgram.y" /* yacc.c:1646 */
+#line 463 "awkgram.y" /* yacc.c:1646 */
{ want_param_names = FUNC_HEADER; }
-#line 2231 "awkgram.c" /* yacc.c:1646 */
+#line 2230 "awkgram.c" /* yacc.c:1646 */
break;
case 37:
-#line 465 "awkgram.y" /* yacc.c:1646 */
+#line 464 "awkgram.y" /* yacc.c:1646 */
{
/*
* treat any comments between BOF and the first function
@@ -2269,17 +2268,17 @@ yyreduce:
(yyval) = (yyvsp[-6]);
want_param_names = FUNC_BODY;
}
-#line 2273 "awkgram.c" /* yacc.c:1646 */
+#line 2272 "awkgram.c" /* yacc.c:1646 */
break;
case 38:
-#line 510 "awkgram.y" /* yacc.c:1646 */
+#line 509 "awkgram.y" /* yacc.c:1646 */
{ want_regexp = true; }
-#line 2279 "awkgram.c" /* yacc.c:1646 */
+#line 2278 "awkgram.c" /* yacc.c:1646 */
break;
case 39:
-#line 512 "awkgram.y" /* yacc.c:1646 */
+#line 511 "awkgram.y" /* yacc.c:1646 */
{
NODE *n, *exp;
char *re;
@@ -2308,11 +2307,11 @@ yyreduce:
(yyval)->opcode = Op_match_rec;
(yyval)->memory = n;
}
-#line 2312 "awkgram.c" /* yacc.c:1646 */
+#line 2311 "awkgram.c" /* yacc.c:1646 */
break;
case 40:
-#line 544 "awkgram.y" /* yacc.c:1646 */
+#line 543 "awkgram.y" /* yacc.c:1646 */
{
char *re;
size_t len;
@@ -2325,17 +2324,17 @@ yyreduce:
(yyval)->opcode = Op_push_re;
(yyval)->memory = make_typed_regex(re, len);
}
-#line 2329 "awkgram.c" /* yacc.c:1646 */
+#line 2328 "awkgram.c" /* yacc.c:1646 */
break;
case 41:
-#line 559 "awkgram.y" /* yacc.c:1646 */
+#line 558 "awkgram.y" /* yacc.c:1646 */
{ bcfree((yyvsp[0])); }
-#line 2335 "awkgram.c" /* yacc.c:1646 */
+#line 2334 "awkgram.c" /* yacc.c:1646 */
break;
case 43:
-#line 565 "awkgram.y" /* yacc.c:1646 */
+#line 564 "awkgram.y" /* yacc.c:1646 */
{
if (prior_comment != NULL) {
(yyval) = list_create(prior_comment);
@@ -2346,11 +2345,11 @@ yyreduce:
} else
(yyval) = NULL;
}
-#line 2350 "awkgram.c" /* yacc.c:1646 */
+#line 2349 "awkgram.c" /* yacc.c:1646 */
break;
case 44:
-#line 576 "awkgram.y" /* yacc.c:1646 */
+#line 575 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0]) == NULL) {
if (prior_comment != NULL) {
@@ -2397,40 +2396,40 @@ yyreduce:
}
yyerrok;
}
-#line 2401 "awkgram.c" /* yacc.c:1646 */
+#line 2400 "awkgram.c" /* yacc.c:1646 */
break;
case 45:
-#line 623 "awkgram.y" /* yacc.c:1646 */
+#line 622 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2407 "awkgram.c" /* yacc.c:1646 */
+#line 2406 "awkgram.c" /* yacc.c:1646 */
break;
case 48:
-#line 633 "awkgram.y" /* yacc.c:1646 */
+#line 632 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2413 "awkgram.c" /* yacc.c:1646 */
+#line 2412 "awkgram.c" /* yacc.c:1646 */
break;
case 49:
-#line 635 "awkgram.y" /* yacc.c:1646 */
+#line 634 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 2419 "awkgram.c" /* yacc.c:1646 */
+#line 2418 "awkgram.c" /* yacc.c:1646 */
break;
case 50:
-#line 637 "awkgram.y" /* yacc.c:1646 */
+#line 636 "awkgram.y" /* yacc.c:1646 */
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[0]),
instruction(Op_exec_count));
else
(yyval) = (yyvsp[0]);
}
-#line 2430 "awkgram.c" /* yacc.c:1646 */
+#line 2429 "awkgram.c" /* yacc.c:1646 */
break;
case 51:
-#line 644 "awkgram.y" /* yacc.c:1646 */
+#line 643 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
INSTRUCTION *ip, *nextc, *tbreak;
@@ -2520,11 +2519,11 @@ yyreduce:
break_allowed--;
fix_break_continue(ip, tbreak, NULL);
}
-#line 2524 "awkgram.c" /* yacc.c:1646 */
+#line 2523 "awkgram.c" /* yacc.c:1646 */
break;
case 52:
-#line 734 "awkgram.y" /* yacc.c:1646 */
+#line 733 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@ -2566,11 +2565,11 @@ yyreduce:
continue_allowed--;
fix_break_continue(ip, tbreak, tcont);
}
-#line 2570 "awkgram.c" /* yacc.c:1646 */
+#line 2569 "awkgram.c" /* yacc.c:1646 */
break;
case 53:
-#line 776 "awkgram.y" /* yacc.c:1646 */
+#line 775 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@ -2612,11 +2611,11 @@ yyreduce:
} /* else
$1 and $4 are NULLs */
}
-#line 2616 "awkgram.c" /* yacc.c:1646 */
+#line 2615 "awkgram.c" /* yacc.c:1646 */
break;
case 54:
-#line 818 "awkgram.y" /* yacc.c:1646 */
+#line 817 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip;
char *var_name = (yyvsp[-5])->lextok;
@@ -2729,33 +2728,33 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
-#line 2733 "awkgram.c" /* yacc.c:1646 */
+#line 2732 "awkgram.c" /* yacc.c:1646 */
break;
case 55:
-#line 931 "awkgram.y" /* yacc.c:1646 */
+#line 930 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]),
(yyvsp[-3]), (yyvsp[0]));
break_allowed--;
continue_allowed--;
}
-#line 2744 "awkgram.c" /* yacc.c:1646 */
+#line 2743 "awkgram.c" /* yacc.c:1646 */
break;
case 56:
-#line 938 "awkgram.y" /* yacc.c:1646 */
+#line 937 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION
*) NULL, (yyvsp[-3]), (yyvsp[0]));
break_allowed--;
continue_allowed--;
}
-#line 2755 "awkgram.c" /* yacc.c:1646 */
+#line 2754 "awkgram.c" /* yacc.c:1646 */
break;
case 57:
-#line 945 "awkgram.y" /* yacc.c:1646 */
+#line 944 "awkgram.y" /* yacc.c:1646 */
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[0]),
instruction(Op_exec_count));
@@ -2763,11 +2762,11 @@ regular_loop:
(yyval) = (yyvsp[0]);
(yyval) = add_pending_comment((yyval));
}
-#line 2767 "awkgram.c" /* yacc.c:1646 */
+#line 2766 "awkgram.c" /* yacc.c:1646 */
break;
case 58:
-#line 956 "awkgram.y" /* yacc.c:1646 */
+#line 955 "awkgram.y" /* yacc.c:1646 */
{
if (! break_allowed)
error_ln((yyvsp[-1])->source_line,
@@ -2777,11 +2776,11 @@ regular_loop:
(yyval) = add_pending_comment((yyval));
}
-#line 2781 "awkgram.c" /* yacc.c:1646 */
+#line 2780 "awkgram.c" /* yacc.c:1646 */
break;
case 59:
-#line 966 "awkgram.y" /* yacc.c:1646 */
+#line 965 "awkgram.y" /* yacc.c:1646 */
{
if (! continue_allowed)
error_ln((yyvsp[-1])->source_line,
@@ -2791,11 +2790,11 @@ regular_loop:
(yyval) = add_pending_comment((yyval));
}
-#line 2795 "awkgram.c" /* yacc.c:1646 */
+#line 2794 "awkgram.c" /* yacc.c:1646 */
break;
case 60:
-#line 976 "awkgram.y" /* yacc.c:1646 */
+#line 975 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule && rule != Rule)
@@ -2805,11 +2804,11 @@ regular_loop:
(yyval) = list_create((yyvsp[-1]));
(yyval) = add_pending_comment((yyval));
}
-#line 2809 "awkgram.c" /* yacc.c:1646 */
+#line 2808 "awkgram.c" /* yacc.c:1646 */
break;
case 61:
-#line 986 "awkgram.y" /* yacc.c:1646 */
+#line 985 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule == BEGIN || rule == END || rule == ENDFILE)
@@ -2821,11 +2820,11 @@ regular_loop:
(yyval) = list_create((yyvsp[-1]));
(yyval) = add_pending_comment((yyval));
}
-#line 2825 "awkgram.c" /* yacc.c:1646 */
+#line 2824 "awkgram.c" /* yacc.c:1646 */
break;
case 62:
-#line 998 "awkgram.y" /* yacc.c:1646 */
+#line 997 "awkgram.y" /* yacc.c:1646 */
{
/* Initialize the two possible jump targets, the actual target
* is resolved at run-time.
@@ -2841,20 +2840,20 @@ regular_loop:
(yyval) = list_append((yyvsp[-1]), (yyvsp[-2]));
(yyval) = add_pending_comment((yyval));
}
-#line 2845 "awkgram.c" /* yacc.c:1646 */
+#line 2844 "awkgram.c" /* yacc.c:1646 */
break;
case 63:
-#line 1014 "awkgram.y" /* yacc.c:1646 */
+#line 1013 "awkgram.y" /* yacc.c:1646 */
{
if (! in_function)
yyerror(_("`return' used outside function context"));
}
-#line 2854 "awkgram.c" /* yacc.c:1646 */
+#line 2853 "awkgram.c" /* yacc.c:1646 */
break;
case 64:
-#line 1017 "awkgram.y" /* yacc.c:1646 */
+#line 1016 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) == NULL) {
(yyval) = list_create((yyvsp[-3]));
@@ -2876,17 +2875,17 @@ regular_loop:
}
(yyval) = add_pending_comment((yyval));
}
-#line 2880 "awkgram.c" /* yacc.c:1646 */
+#line 2879 "awkgram.c" /* yacc.c:1646 */
break;
case 66:
-#line 1050 "awkgram.y" /* yacc.c:1646 */
+#line 1049 "awkgram.y" /* yacc.c:1646 */
{ in_print = true; in_parens = 0; }
-#line 2886 "awkgram.c" /* yacc.c:1646 */
+#line 2885 "awkgram.c" /* yacc.c:1646 */
break;
case 67:
-#line 1051 "awkgram.y" /* yacc.c:1646 */
+#line 1050 "awkgram.y" /* yacc.c:1646 */
{
/*
* Optimization: plain `print' has no expression list, so $3 is
null.
@@ -2984,17 +2983,17 @@ regular_print:
}
(yyval) = add_pending_comment((yyval));
}
-#line 2988 "awkgram.c" /* yacc.c:1646 */
+#line 2987 "awkgram.c" /* yacc.c:1646 */
break;
case 68:
-#line 1149 "awkgram.y" /* yacc.c:1646 */
+#line 1148 "awkgram.y" /* yacc.c:1646 */
{ sub_counter = 0; }
-#line 2994 "awkgram.c" /* yacc.c:1646 */
+#line 2993 "awkgram.c" /* yacc.c:1646 */
break;
case 69:
-#line 1150 "awkgram.y" /* yacc.c:1646 */
+#line 1149 "awkgram.y" /* yacc.c:1646 */
{
char *arr = (yyvsp[-2])->lextok;
@@ -3028,11 +3027,11 @@ regular_print:
}
(yyval) = add_pending_comment((yyval));
}
-#line 3032 "awkgram.c" /* yacc.c:1646 */
+#line 3031 "awkgram.c" /* yacc.c:1646 */
break;
case 70:
-#line 1188 "awkgram.y" /* yacc.c:1646 */
+#line 1187 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
char *arr = (yyvsp[-1])->lextok;
@@ -3059,55 +3058,55 @@ regular_print:
}
(yyval) = add_pending_comment((yyval));
}
-#line 3063 "awkgram.c" /* yacc.c:1646 */
+#line 3062 "awkgram.c" /* yacc.c:1646 */
break;
case 71:
-#line 1215 "awkgram.y" /* yacc.c:1646 */
+#line 1214 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = optimize_assignment((yyvsp[0]));
(yyval) = add_pending_comment((yyval));
}
-#line 3072 "awkgram.c" /* yacc.c:1646 */
+#line 3071 "awkgram.c" /* yacc.c:1646 */
break;
case 72:
-#line 1223 "awkgram.y" /* yacc.c:1646 */
+#line 1222 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3078 "awkgram.c" /* yacc.c:1646 */
+#line 3077 "awkgram.c" /* yacc.c:1646 */
break;
case 73:
-#line 1225 "awkgram.y" /* yacc.c:1646 */
+#line 1224 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3084 "awkgram.c" /* yacc.c:1646 */
+#line 3083 "awkgram.c" /* yacc.c:1646 */
break;
case 74:
-#line 1230 "awkgram.y" /* yacc.c:1646 */
+#line 1229 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3090 "awkgram.c" /* yacc.c:1646 */
+#line 3089 "awkgram.c" /* yacc.c:1646 */
break;
case 75:
-#line 1232 "awkgram.y" /* yacc.c:1646 */
+#line 1231 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) == NULL)
(yyval) = list_create((yyvsp[0]));
else
(yyval) = list_prepend((yyvsp[-1]), (yyvsp[0]));
}
-#line 3101 "awkgram.c" /* yacc.c:1646 */
+#line 3100 "awkgram.c" /* yacc.c:1646 */
break;
case 76:
-#line 1239 "awkgram.y" /* yacc.c:1646 */
+#line 1238 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3107 "awkgram.c" /* yacc.c:1646 */
+#line 3106 "awkgram.c" /* yacc.c:1646 */
break;
case 77:
-#line 1244 "awkgram.y" /* yacc.c:1646 */
+#line 1243 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -3119,11 +3118,11 @@ regular_print:
bcfree((yyvsp[-2]));
(yyval) = (yyvsp[-4]);
}
-#line 3123 "awkgram.c" /* yacc.c:1646 */
+#line 3122 "awkgram.c" /* yacc.c:1646 */
break;
case 78:
-#line 1256 "awkgram.y" /* yacc.c:1646 */
+#line 1255 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -3134,17 +3133,17 @@ regular_print:
(yyvsp[-3])->case_stmt = casestmt;
(yyval) = (yyvsp[-3]);
}
-#line 3138 "awkgram.c" /* yacc.c:1646 */
+#line 3137 "awkgram.c" /* yacc.c:1646 */
break;
case 79:
-#line 1270 "awkgram.y" /* yacc.c:1646 */
+#line 1269 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3144 "awkgram.c" /* yacc.c:1646 */
+#line 3143 "awkgram.c" /* yacc.c:1646 */
break;
case 80:
-#line 1272 "awkgram.y" /* yacc.c:1646 */
+#line 1271 "awkgram.y" /* yacc.c:1646 */
{
NODE *n = (yyvsp[0])->memory;
(void) force_number(n);
@@ -3152,28 +3151,28 @@ regular_print:
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3156 "awkgram.c" /* yacc.c:1646 */
+#line 3155 "awkgram.c" /* yacc.c:1646 */
break;
case 81:
-#line 1280 "awkgram.y" /* yacc.c:1646 */
+#line 1279 "awkgram.y" /* yacc.c:1646 */
{
NODE *n = (yyvsp[0])->lasti->memory;
bcfree((yyvsp[-1]));
add_sign_to_num(n, '+');
(yyval) = (yyvsp[0]);
}
-#line 3167 "awkgram.c" /* yacc.c:1646 */
+#line 3166 "awkgram.c" /* yacc.c:1646 */
break;
case 82:
-#line 1287 "awkgram.y" /* yacc.c:1646 */
+#line 1286 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3173 "awkgram.c" /* yacc.c:1646 */
+#line 3172 "awkgram.c" /* yacc.c:1646 */
break;
case 83:
-#line 1289 "awkgram.y" /* yacc.c:1646 */
+#line 1288 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->memory->type == Node_regex)
(yyvsp[0])->opcode = Op_push_re;
@@ -3181,57 +3180,57 @@ regular_print:
(yyvsp[0])->opcode = Op_push;
(yyval) = (yyvsp[0]);
}
-#line 3185 "awkgram.c" /* yacc.c:1646 */
+#line 3184 "awkgram.c" /* yacc.c:1646 */
break;
case 84:
-#line 1297 "awkgram.y" /* yacc.c:1646 */
+#line 1296 "awkgram.y" /* yacc.c:1646 */
{
assert(((yyvsp[0])->memory->flags & REGEX) == REGEX);
(yyvsp[0])->opcode = Op_push_re;
(yyval) = (yyvsp[0]);
}
-#line 3195 "awkgram.c" /* yacc.c:1646 */
+#line 3194 "awkgram.c" /* yacc.c:1646 */
break;
case 85:
-#line 1306 "awkgram.y" /* yacc.c:1646 */
+#line 1305 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3201 "awkgram.c" /* yacc.c:1646 */
+#line 3200 "awkgram.c" /* yacc.c:1646 */
break;
case 86:
-#line 1308 "awkgram.y" /* yacc.c:1646 */
+#line 1307 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3207 "awkgram.c" /* yacc.c:1646 */
+#line 3206 "awkgram.c" /* yacc.c:1646 */
break;
case 88:
-#line 1318 "awkgram.y" /* yacc.c:1646 */
+#line 1317 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = (yyvsp[-1]);
}
-#line 3215 "awkgram.c" /* yacc.c:1646 */
+#line 3214 "awkgram.c" /* yacc.c:1646 */
break;
case 89:
-#line 1325 "awkgram.y" /* yacc.c:1646 */
+#line 1324 "awkgram.y" /* yacc.c:1646 */
{
in_print = false;
in_parens = 0;
(yyval) = NULL;
}
-#line 3225 "awkgram.c" /* yacc.c:1646 */
+#line 3224 "awkgram.c" /* yacc.c:1646 */
break;
case 90:
-#line 1330 "awkgram.y" /* yacc.c:1646 */
+#line 1329 "awkgram.y" /* yacc.c:1646 */
{ in_print = false; in_parens = 0; }
-#line 3231 "awkgram.c" /* yacc.c:1646 */
+#line 3230 "awkgram.c" /* yacc.c:1646 */
break;
case 91:
-#line 1331 "awkgram.y" /* yacc.c:1646 */
+#line 1330 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->redir_type == redirect_twoway
&& (yyvsp[0])->lasti->opcode == Op_K_getline_redir
@@ -3239,63 +3238,63 @@ regular_print:
yyerror(_("multistage two-way pipelines don't work"));
(yyval) = list_prepend((yyvsp[0]), (yyvsp[-2]));
}
-#line 3243 "awkgram.c" /* yacc.c:1646 */
+#line 3242 "awkgram.c" /* yacc.c:1646 */
break;
case 92:
-#line 1342 "awkgram.y" /* yacc.c:1646 */
+#line 1341 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]),
NULL, NULL);
}
-#line 3251 "awkgram.c" /* yacc.c:1646 */
+#line 3250 "awkgram.c" /* yacc.c:1646 */
break;
case 93:
-#line 1347 "awkgram.y" /* yacc.c:1646 */
+#line 1346 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]),
(yyvsp[-2]), (yyvsp[0]));
}
-#line 3259 "awkgram.c" /* yacc.c:1646 */
+#line 3258 "awkgram.c" /* yacc.c:1646 */
break;
case 98:
-#line 1364 "awkgram.y" /* yacc.c:1646 */
+#line 1363 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3265 "awkgram.c" /* yacc.c:1646 */
+#line 3264 "awkgram.c" /* yacc.c:1646 */
break;
case 99:
-#line 1366 "awkgram.y" /* yacc.c:1646 */
+#line 1365 "awkgram.y" /* yacc.c:1646 */
{
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3274 "awkgram.c" /* yacc.c:1646 */
+#line 3273 "awkgram.c" /* yacc.c:1646 */
break;
case 100:
-#line 1374 "awkgram.y" /* yacc.c:1646 */
+#line 1373 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3280 "awkgram.c" /* yacc.c:1646 */
+#line 3279 "awkgram.c" /* yacc.c:1646 */
break;
case 101:
-#line 1376 "awkgram.y" /* yacc.c:1646 */
+#line 1375 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3286 "awkgram.c" /* yacc.c:1646 */
+#line 3285 "awkgram.c" /* yacc.c:1646 */
break;
case 102:
-#line 1381 "awkgram.y" /* yacc.c:1646 */
+#line 1380 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->param_count = 0;
(yyval) = list_create((yyvsp[0]));
}
-#line 3295 "awkgram.c" /* yacc.c:1646 */
+#line 3294 "awkgram.c" /* yacc.c:1646 */
break;
case 103:
-#line 1386 "awkgram.y" /* yacc.c:1646 */
+#line 1385 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2]) != NULL && (yyvsp[0]) != NULL) {
(yyvsp[0])->param_count =
(yyvsp[-2])->lasti->param_count + 1;
@@ -3304,74 +3303,74 @@ regular_print:
} else
(yyval) = NULL;
}
-#line 3308 "awkgram.c" /* yacc.c:1646 */
+#line 3307 "awkgram.c" /* yacc.c:1646 */
break;
case 104:
-#line 1395 "awkgram.y" /* yacc.c:1646 */
+#line 1394 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3314 "awkgram.c" /* yacc.c:1646 */
+#line 3313 "awkgram.c" /* yacc.c:1646 */
break;
case 105:
-#line 1397 "awkgram.y" /* yacc.c:1646 */
+#line 1396 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3320 "awkgram.c" /* yacc.c:1646 */
+#line 3319 "awkgram.c" /* yacc.c:1646 */
break;
case 106:
-#line 1399 "awkgram.y" /* yacc.c:1646 */
+#line 1398 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-2]); }
-#line 3326 "awkgram.c" /* yacc.c:1646 */
+#line 3325 "awkgram.c" /* yacc.c:1646 */
break;
case 107:
-#line 1405 "awkgram.y" /* yacc.c:1646 */
+#line 1404 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3332 "awkgram.c" /* yacc.c:1646 */
+#line 3331 "awkgram.c" /* yacc.c:1646 */
break;
case 108:
-#line 1407 "awkgram.y" /* yacc.c:1646 */
+#line 1406 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3338 "awkgram.c" /* yacc.c:1646 */
+#line 3337 "awkgram.c" /* yacc.c:1646 */
break;
case 109:
-#line 1412 "awkgram.y" /* yacc.c:1646 */
+#line 1411 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3344 "awkgram.c" /* yacc.c:1646 */
+#line 3343 "awkgram.c" /* yacc.c:1646 */
break;
case 110:
-#line 1414 "awkgram.y" /* yacc.c:1646 */
+#line 1413 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3350 "awkgram.c" /* yacc.c:1646 */
+#line 3349 "awkgram.c" /* yacc.c:1646 */
break;
case 111:
-#line 1419 "awkgram.y" /* yacc.c:1646 */
+#line 1418 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3356 "awkgram.c" /* yacc.c:1646 */
+#line 3355 "awkgram.c" /* yacc.c:1646 */
break;
case 112:
-#line 1421 "awkgram.y" /* yacc.c:1646 */
+#line 1420 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3365 "awkgram.c" /* yacc.c:1646 */
+#line 3364 "awkgram.c" /* yacc.c:1646 */
break;
case 113:
-#line 1426 "awkgram.y" /* yacc.c:1646 */
+#line 1425 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3371 "awkgram.c" /* yacc.c:1646 */
+#line 3370 "awkgram.c" /* yacc.c:1646 */
break;
case 114:
-#line 1428 "awkgram.y" /* yacc.c:1646 */
+#line 1427 "awkgram.y" /* yacc.c:1646 */
{
/*
* Returning the expression list instead of NULL lets
@@ -3379,62 +3378,62 @@ regular_print:
*/
(yyval) = (yyvsp[-1]);
}
-#line 3383 "awkgram.c" /* yacc.c:1646 */
+#line 3382 "awkgram.c" /* yacc.c:1646 */
break;
case 115:
-#line 1436 "awkgram.y" /* yacc.c:1646 */
+#line 1435 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3392 "awkgram.c" /* yacc.c:1646 */
+#line 3391 "awkgram.c" /* yacc.c:1646 */
break;
case 116:
-#line 1441 "awkgram.y" /* yacc.c:1646 */
+#line 1440 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = (yyvsp[-2]);
}
-#line 3401 "awkgram.c" /* yacc.c:1646 */
+#line 3400 "awkgram.c" /* yacc.c:1646 */
break;
case 117:
-#line 1449 "awkgram.y" /* yacc.c:1646 */
+#line 1448 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3407 "awkgram.c" /* yacc.c:1646 */
+#line 3406 "awkgram.c" /* yacc.c:1646 */
break;
case 118:
-#line 1451 "awkgram.y" /* yacc.c:1646 */
+#line 1450 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3413 "awkgram.c" /* yacc.c:1646 */
+#line 3412 "awkgram.c" /* yacc.c:1646 */
break;
case 119:
-#line 1456 "awkgram.y" /* yacc.c:1646 */
+#line 1455 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3419 "awkgram.c" /* yacc.c:1646 */
+#line 3418 "awkgram.c" /* yacc.c:1646 */
break;
case 120:
-#line 1458 "awkgram.y" /* yacc.c:1646 */
+#line 1457 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3428 "awkgram.c" /* yacc.c:1646 */
+#line 3427 "awkgram.c" /* yacc.c:1646 */
break;
case 121:
-#line 1463 "awkgram.y" /* yacc.c:1646 */
+#line 1462 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3434 "awkgram.c" /* yacc.c:1646 */
+#line 3433 "awkgram.c" /* yacc.c:1646 */
break;
case 122:
-#line 1465 "awkgram.y" /* yacc.c:1646 */
+#line 1464 "awkgram.y" /* yacc.c:1646 */
{
/*
* Returning the expression list instead of NULL lets
@@ -3442,72 +3441,72 @@ regular_print:
*/
(yyval) = (yyvsp[-1]);
}
-#line 3446 "awkgram.c" /* yacc.c:1646 */
+#line 3445 "awkgram.c" /* yacc.c:1646 */
break;
case 123:
-#line 1473 "awkgram.y" /* yacc.c:1646 */
+#line 1472 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3455 "awkgram.c" /* yacc.c:1646 */
+#line 3454 "awkgram.c" /* yacc.c:1646 */
break;
case 124:
-#line 1478 "awkgram.y" /* yacc.c:1646 */
+#line 1477 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = (yyvsp[-2]);
}
-#line 3464 "awkgram.c" /* yacc.c:1646 */
+#line 3463 "awkgram.c" /* yacc.c:1646 */
break;
case 125:
-#line 1485 "awkgram.y" /* yacc.c:1646 */
+#line 1484 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3470 "awkgram.c" /* yacc.c:1646 */
+#line 3469 "awkgram.c" /* yacc.c:1646 */
break;
case 126:
-#line 1486 "awkgram.y" /* yacc.c:1646 */
+#line 1485 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = list_create((yyvsp[0])); }
-#line 3476 "awkgram.c" /* yacc.c:1646 */
+#line 3475 "awkgram.c" /* yacc.c:1646 */
break;
case 127:
-#line 1492 "awkgram.y" /* yacc.c:1646 */
+#line 1491 "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 3487 "awkgram.c" /* yacc.c:1646 */
+#line 3486 "awkgram.c" /* yacc.c:1646 */
break;
case 128:
-#line 1499 "awkgram.y" /* yacc.c:1646 */
+#line 1498 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_assignment((yyvsp[-2]), list_create((yyvsp[0])),
(yyvsp[-1]));
}
-#line 3495 "awkgram.c" /* yacc.c:1646 */
+#line 3494 "awkgram.c" /* yacc.c:1646 */
break;
case 129:
-#line 1503 "awkgram.y" /* yacc.c:1646 */
+#line 1502 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3501 "awkgram.c" /* yacc.c:1646 */
+#line 3500 "awkgram.c" /* yacc.c:1646 */
break;
case 130:
-#line 1505 "awkgram.y" /* yacc.c:1646 */
+#line 1504 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3507 "awkgram.c" /* yacc.c:1646 */
+#line 3506 "awkgram.c" /* yacc.c:1646 */
break;
case 131:
-#line 1507 "awkgram.y" /* yacc.c:1646 */
+#line 1506 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[-1])->source_line,
@@ -3520,11 +3519,11 @@ regular_print:
bcfree((yyvsp[0]));
(yyval) = list_append((yyvsp[-2]), (yyvsp[-1]));
}
-#line 3524 "awkgram.c" /* yacc.c:1646 */
+#line 3523 "awkgram.c" /* yacc.c:1646 */
break;
case 132:
-#line 1520 "awkgram.y" /* yacc.c:1646 */
+#line 1519 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[-1])->source_line,
@@ -3541,11 +3540,11 @@ regular_print:
(yyval) = list_append(list_merge((yyvsp[-2]),
(yyvsp[0])), (yyvsp[-1]));
}
}
-#line 3545 "awkgram.c" /* yacc.c:1646 */
+#line 3544 "awkgram.c" /* yacc.c:1646 */
break;
case 133:
-#line 1537 "awkgram.y" /* yacc.c:1646 */
+#line 1536 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old)
warning_ln((yyvsp[-1])->source_line,
@@ -3555,91 +3554,91 @@ regular_print:
(yyvsp[-1])->expr_count = 1;
(yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])),
(yyvsp[-1]));
}
-#line 3559 "awkgram.c" /* yacc.c:1646 */
+#line 3558 "awkgram.c" /* yacc.c:1646 */
break;
case 134:
-#line 1547 "awkgram.y" /* yacc.c:1646 */
+#line 1546 "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 3570 "awkgram.c" /* yacc.c:1646 */
+#line 3569 "awkgram.c" /* yacc.c:1646 */
break;
case 135:
-#line 1554 "awkgram.y" /* yacc.c:1646 */
+#line 1553 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]),
(yyvsp[-1]), (yyvsp[0])); }
-#line 3576 "awkgram.c" /* yacc.c:1646 */
+#line 3575 "awkgram.c" /* yacc.c:1646 */
break;
case 136:
-#line 1556 "awkgram.y" /* yacc.c:1646 */
+#line 1555 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3582 "awkgram.c" /* yacc.c:1646 */
+#line 3581 "awkgram.c" /* yacc.c:1646 */
break;
case 137:
-#line 1561 "awkgram.y" /* yacc.c:1646 */
+#line 1560 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3588 "awkgram.c" /* yacc.c:1646 */
+#line 3587 "awkgram.c" /* yacc.c:1646 */
break;
case 138:
-#line 1563 "awkgram.y" /* yacc.c:1646 */
+#line 1562 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3594 "awkgram.c" /* yacc.c:1646 */
+#line 3593 "awkgram.c" /* yacc.c:1646 */
break;
case 139:
-#line 1565 "awkgram.y" /* yacc.c:1646 */
+#line 1564 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_assign_quotient;
(yyval) = (yyvsp[0]);
}
-#line 3603 "awkgram.c" /* yacc.c:1646 */
+#line 3602 "awkgram.c" /* yacc.c:1646 */
break;
case 140:
-#line 1573 "awkgram.y" /* yacc.c:1646 */
+#line 1572 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3609 "awkgram.c" /* yacc.c:1646 */
+#line 3608 "awkgram.c" /* yacc.c:1646 */
break;
case 141:
-#line 1575 "awkgram.y" /* yacc.c:1646 */
+#line 1574 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3615 "awkgram.c" /* yacc.c:1646 */
+#line 3614 "awkgram.c" /* yacc.c:1646 */
break;
case 142:
-#line 1580 "awkgram.y" /* yacc.c:1646 */
+#line 1579 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3621 "awkgram.c" /* yacc.c:1646 */
+#line 3620 "awkgram.c" /* yacc.c:1646 */
break;
case 143:
-#line 1582 "awkgram.y" /* yacc.c:1646 */
+#line 1581 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3627 "awkgram.c" /* yacc.c:1646 */
+#line 3626 "awkgram.c" /* yacc.c:1646 */
break;
case 144:
-#line 1587 "awkgram.y" /* yacc.c:1646 */
+#line 1586 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3633 "awkgram.c" /* yacc.c:1646 */
+#line 3632 "awkgram.c" /* yacc.c:1646 */
break;
case 145:
-#line 1589 "awkgram.y" /* yacc.c:1646 */
+#line 1588 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3639 "awkgram.c" /* yacc.c:1646 */
+#line 3638 "awkgram.c" /* yacc.c:1646 */
break;
case 146:
-#line 1591 "awkgram.y" /* yacc.c:1646 */
+#line 1590 "awkgram.y" /* yacc.c:1646 */
{
int count = 2;
bool is_simple_var = false;
@@ -3692,47 +3691,47 @@ regular_print:
max_args = count;
}
}
-#line 3696 "awkgram.c" /* yacc.c:1646 */
+#line 3695 "awkgram.c" /* yacc.c:1646 */
break;
case 148:
-#line 1649 "awkgram.y" /* yacc.c:1646 */
+#line 1648 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3702 "awkgram.c" /* yacc.c:1646 */
+#line 3701 "awkgram.c" /* yacc.c:1646 */
break;
case 149:
-#line 1651 "awkgram.y" /* yacc.c:1646 */
+#line 1650 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3708 "awkgram.c" /* yacc.c:1646 */
+#line 3707 "awkgram.c" /* yacc.c:1646 */
break;
case 150:
-#line 1653 "awkgram.y" /* yacc.c:1646 */
+#line 1652 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3714 "awkgram.c" /* yacc.c:1646 */
+#line 3713 "awkgram.c" /* yacc.c:1646 */
break;
case 151:
-#line 1655 "awkgram.y" /* yacc.c:1646 */
+#line 1654 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3720 "awkgram.c" /* yacc.c:1646 */
+#line 3719 "awkgram.c" /* yacc.c:1646 */
break;
case 152:
-#line 1657 "awkgram.y" /* yacc.c:1646 */
+#line 1656 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3726 "awkgram.c" /* yacc.c:1646 */
+#line 3725 "awkgram.c" /* yacc.c:1646 */
break;
case 153:
-#line 1659 "awkgram.y" /* yacc.c:1646 */
+#line 1658 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3732 "awkgram.c" /* yacc.c:1646 */
+#line 3731 "awkgram.c" /* yacc.c:1646 */
break;
case 154:
-#line 1661 "awkgram.y" /* yacc.c:1646 */
+#line 1660 "awkgram.y" /* yacc.c:1646 */
{
/*
* In BEGINFILE/ENDFILE, allow `getline [var] < file'
@@ -3746,29 +3745,29 @@ regular_print:
_("non-redirected `getline' undefined inside
END action"));
(yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]),
redirect_input);
}
-#line 3750 "awkgram.c" /* yacc.c:1646 */
+#line 3749 "awkgram.c" /* yacc.c:1646 */
break;
case 155:
-#line 1675 "awkgram.y" /* yacc.c:1646 */
+#line 1674 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postincrement;
(yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3759 "awkgram.c" /* yacc.c:1646 */
+#line 3758 "awkgram.c" /* yacc.c:1646 */
break;
case 156:
-#line 1680 "awkgram.y" /* yacc.c:1646 */
+#line 1679 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postdecrement;
(yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3768 "awkgram.c" /* yacc.c:1646 */
+#line 3767 "awkgram.c" /* yacc.c:1646 */
break;
case 157:
-#line 1685 "awkgram.y" /* yacc.c:1646 */
+#line 1684 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old) {
warning_ln((yyvsp[-1])->source_line,
@@ -3788,64 +3787,64 @@ regular_print:
(yyval) = list_append(list_merge(t, (yyvsp[0])),
(yyvsp[-1]));
}
}
-#line 3792 "awkgram.c" /* yacc.c:1646 */
+#line 3791 "awkgram.c" /* yacc.c:1646 */
break;
case 158:
-#line 1710 "awkgram.y" /* yacc.c:1646 */
+#line 1709 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]),
(yyvsp[-2])->redir_type);
bcfree((yyvsp[-2]));
}
-#line 3801 "awkgram.c" /* yacc.c:1646 */
+#line 3800 "awkgram.c" /* yacc.c:1646 */
break;
case 159:
-#line 1716 "awkgram.y" /* yacc.c:1646 */
+#line 1715 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3807 "awkgram.c" /* yacc.c:1646 */
+#line 3806 "awkgram.c" /* yacc.c:1646 */
break;
case 160:
-#line 1718 "awkgram.y" /* yacc.c:1646 */
+#line 1717 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3813 "awkgram.c" /* yacc.c:1646 */
+#line 3812 "awkgram.c" /* yacc.c:1646 */
break;
case 161:
-#line 1720 "awkgram.y" /* yacc.c:1646 */
+#line 1719 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3819 "awkgram.c" /* yacc.c:1646 */
+#line 3818 "awkgram.c" /* yacc.c:1646 */
break;
case 162:
-#line 1722 "awkgram.y" /* yacc.c:1646 */
+#line 1721 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3825 "awkgram.c" /* yacc.c:1646 */
+#line 3824 "awkgram.c" /* yacc.c:1646 */
break;
case 163:
-#line 1724 "awkgram.y" /* yacc.c:1646 */
+#line 1723 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3831 "awkgram.c" /* yacc.c:1646 */
+#line 3830 "awkgram.c" /* yacc.c:1646 */
break;
case 164:
-#line 1726 "awkgram.y" /* yacc.c:1646 */
+#line 1725 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3837 "awkgram.c" /* yacc.c:1646 */
+#line 3836 "awkgram.c" /* yacc.c:1646 */
break;
case 165:
-#line 1731 "awkgram.y" /* yacc.c:1646 */
+#line 1730 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3845 "awkgram.c" /* yacc.c:1646 */
+#line 3844 "awkgram.c" /* yacc.c:1646 */
break;
case 166:
-#line 1735 "awkgram.y" /* yacc.c:1646 */
+#line 1734 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->opcode == Op_match_rec) {
(yyvsp[0])->opcode = Op_nomatch;
@@ -3877,42 +3876,42 @@ regular_print:
}
}
}
-#line 3881 "awkgram.c" /* yacc.c:1646 */
+#line 3880 "awkgram.c" /* yacc.c:1646 */
break;
case 167:
-#line 1767 "awkgram.y" /* yacc.c:1646 */
+#line 1766 "awkgram.y" /* yacc.c:1646 */
{
if (do_pretty_print)
(yyval) = list_append((yyvsp[-1]), bcalloc(Op_parens,
1, sourceline));
else
(yyval) = (yyvsp[-1]);
}
-#line 3892 "awkgram.c" /* yacc.c:1646 */
+#line 3891 "awkgram.c" /* yacc.c:1646 */
break;
case 168:
-#line 1774 "awkgram.y" /* yacc.c:1646 */
+#line 1773 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3902 "awkgram.c" /* yacc.c:1646 */
+#line 3901 "awkgram.c" /* yacc.c:1646 */
break;
case 169:
-#line 1780 "awkgram.y" /* yacc.c:1646 */
+#line 1779 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3912 "awkgram.c" /* yacc.c:1646 */
+#line 3911 "awkgram.c" /* yacc.c:1646 */
break;
case 170:
-#line 1786 "awkgram.y" /* yacc.c:1646 */
+#line 1785 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
@@ -3925,45 +3924,45 @@ regular_print:
if ((yyval) == NULL)
YYABORT;
}
-#line 3929 "awkgram.c" /* yacc.c:1646 */
+#line 3928 "awkgram.c" /* yacc.c:1646 */
break;
case 173:
-#line 1801 "awkgram.y" /* yacc.c:1646 */
+#line 1800 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[-1])->opcode = Op_preincrement;
(yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1]));
}
-#line 3938 "awkgram.c" /* yacc.c:1646 */
+#line 3937 "awkgram.c" /* yacc.c:1646 */
break;
case 174:
-#line 1806 "awkgram.y" /* yacc.c:1646 */
+#line 1805 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[-1])->opcode = Op_predecrement;
(yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1]));
}
-#line 3947 "awkgram.c" /* yacc.c:1646 */
+#line 3946 "awkgram.c" /* yacc.c:1646 */
break;
case 175:
-#line 1811 "awkgram.y" /* yacc.c:1646 */
+#line 1810 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3955 "awkgram.c" /* yacc.c:1646 */
+#line 3954 "awkgram.c" /* yacc.c:1646 */
break;
case 176:
-#line 1815 "awkgram.y" /* yacc.c:1646 */
+#line 1814 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3963 "awkgram.c" /* yacc.c:1646 */
+#line 3962 "awkgram.c" /* yacc.c:1646 */
break;
case 177:
-#line 1819 "awkgram.y" /* yacc.c:1646 */
+#line 1818 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->lasti->opcode == Op_push_i
&& ((yyvsp[0])->lasti->memory->flags & STRING) == 0
@@ -3978,11 +3977,11 @@ regular_print:
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
}
-#line 3982 "awkgram.c" /* yacc.c:1646 */
+#line 3981 "awkgram.c" /* yacc.c:1646 */
break;
case 178:
-#line 1834 "awkgram.y" /* yacc.c:1646 */
+#line 1833 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->lasti->opcode == Op_push_i
&& ((yyvsp[0])->lasti->memory->flags & STRING) == 0
@@ -4000,20 +3999,20 @@ regular_print:
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
}
-#line 4004 "awkgram.c" /* yacc.c:1646 */
+#line 4003 "awkgram.c" /* yacc.c:1646 */
break;
case 179:
-#line 1855 "awkgram.y" /* yacc.c:1646 */
+#line 1854 "awkgram.y" /* yacc.c:1646 */
{
func_use((yyvsp[0])->lasti->func_name, FUNC_USE);
(yyval) = (yyvsp[0]);
}
-#line 4013 "awkgram.c" /* yacc.c:1646 */
+#line 4012 "awkgram.c" /* yacc.c:1646 */
break;
case 180:
-#line 1860 "awkgram.y" /* yacc.c:1646 */
+#line 1859 "awkgram.y" /* yacc.c:1646 */
{
/* indirect function call */
INSTRUCTION *f, *t;
@@ -4047,11 +4046,11 @@ regular_print:
(yyval) = list_prepend((yyvsp[0]), t);
at_seen = false;
}
-#line 4051 "awkgram.c" /* yacc.c:1646 */
+#line 4050 "awkgram.c" /* yacc.c:1646 */
break;
case 181:
-#line 1897 "awkgram.y" /* yacc.c:1646 */
+#line 1896 "awkgram.y" /* yacc.c:1646 */
{
NODE *n;
const char *name = (yyvsp[-3])->func_name;
@@ -4089,49 +4088,49 @@ regular_print:
(yyval) = list_append(t, (yyvsp[-3]));
}
}
-#line 4093 "awkgram.c" /* yacc.c:1646 */
+#line 4092 "awkgram.c" /* yacc.c:1646 */
break;
case 182:
-#line 1938 "awkgram.y" /* yacc.c:1646 */
+#line 1937 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 4099 "awkgram.c" /* yacc.c:1646 */
+#line 4098 "awkgram.c" /* yacc.c:1646 */
break;
case 183:
-#line 1940 "awkgram.y" /* yacc.c:1646 */
+#line 1939 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 4105 "awkgram.c" /* yacc.c:1646 */
+#line 4104 "awkgram.c" /* yacc.c:1646 */
break;
case 184:
-#line 1945 "awkgram.y" /* yacc.c:1646 */
+#line 1944 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 4111 "awkgram.c" /* yacc.c:1646 */
+#line 4110 "awkgram.c" /* yacc.c:1646 */
break;
case 185:
-#line 1947 "awkgram.y" /* yacc.c:1646 */
+#line 1946 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 4117 "awkgram.c" /* yacc.c:1646 */
+#line 4116 "awkgram.c" /* yacc.c:1646 */
break;
case 186:
-#line 1952 "awkgram.y" /* yacc.c:1646 */
+#line 1951 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 4123 "awkgram.c" /* yacc.c:1646 */
+#line 4122 "awkgram.c" /* yacc.c:1646 */
break;
case 187:
-#line 1954 "awkgram.y" /* yacc.c:1646 */
+#line 1953 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 4131 "awkgram.c" /* yacc.c:1646 */
+#line 4130 "awkgram.c" /* yacc.c:1646 */
break;
case 188:
-#line 1961 "awkgram.y" /* yacc.c:1646 */
+#line 1960 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = (yyvsp[0])->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated
expressions */
@@ -4145,11 +4144,11 @@ regular_print:
sub_counter++; /* count # of dimensions */
(yyval) = (yyvsp[0]);
}
-#line 4149 "awkgram.c" /* yacc.c:1646 */
+#line 4148 "awkgram.c" /* yacc.c:1646 */
break;
case 189:
-#line 1978 "awkgram.y" /* yacc.c:1646 */
+#line 1977 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *t = (yyvsp[-1]);
if ((yyvsp[-1]) == NULL) {
@@ -4163,31 +4162,31 @@ regular_print:
(yyvsp[0])->sub_count = count_expressions(&t, false);
(yyval) = list_append(t, (yyvsp[0]));
}
-#line 4167 "awkgram.c" /* yacc.c:1646 */
+#line 4166 "awkgram.c" /* yacc.c:1646 */
break;
case 190:
-#line 1995 "awkgram.y" /* yacc.c:1646 */
+#line 1994 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 4173 "awkgram.c" /* yacc.c:1646 */
+#line 4172 "awkgram.c" /* yacc.c:1646 */
break;
case 191:
-#line 1997 "awkgram.y" /* yacc.c:1646 */
+#line 1996 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 4181 "awkgram.c" /* yacc.c:1646 */
+#line 4180 "awkgram.c" /* yacc.c:1646 */
break;
case 192:
-#line 2004 "awkgram.y" /* yacc.c:1646 */
+#line 2003 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 4187 "awkgram.c" /* yacc.c:1646 */
+#line 4186 "awkgram.c" /* yacc.c:1646 */
break;
case 193:
-#line 2009 "awkgram.y" /* yacc.c:1646 */
+#line 2008 "awkgram.y" /* yacc.c:1646 */
{
char *var_name = (yyvsp[0])->lextok;
@@ -4195,22 +4194,22 @@ regular_print:
(yyvsp[0])->memory = variable((yyvsp[0])->source_line,
var_name, Node_var_new);
(yyval) = list_create((yyvsp[0]));
}
-#line 4199 "awkgram.c" /* yacc.c:1646 */
+#line 4198 "awkgram.c" /* yacc.c:1646 */
break;
case 194:
-#line 2017 "awkgram.y" /* yacc.c:1646 */
+#line 2016 "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 4210 "awkgram.c" /* yacc.c:1646 */
+#line 4209 "awkgram.c" /* yacc.c:1646 */
break;
case 195:
-#line 2027 "awkgram.y" /* yacc.c:1646 */
+#line 2026 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = (yyvsp[0])->nexti;
if (ip->opcode == Op_push
@@ -4222,73 +4221,73 @@ regular_print:
} else
(yyval) = (yyvsp[0]);
}
-#line 4226 "awkgram.c" /* yacc.c:1646 */
+#line 4225 "awkgram.c" /* yacc.c:1646 */
break;
case 196:
-#line 2039 "awkgram.y" /* yacc.c:1646 */
+#line 2038 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_append((yyvsp[-1]), (yyvsp[-2]));
if ((yyvsp[0]) != NULL)
mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 4236 "awkgram.c" /* yacc.c:1646 */
+#line 4235 "awkgram.c" /* yacc.c:1646 */
break;
case 197:
-#line 2048 "awkgram.y" /* yacc.c:1646 */
+#line 2047 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postincrement;
}
-#line 4244 "awkgram.c" /* yacc.c:1646 */
+#line 4243 "awkgram.c" /* yacc.c:1646 */
break;
case 198:
-#line 2052 "awkgram.y" /* yacc.c:1646 */
+#line 2051 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postdecrement;
}
-#line 4252 "awkgram.c" /* yacc.c:1646 */
+#line 4251 "awkgram.c" /* yacc.c:1646 */
break;
case 199:
-#line 2055 "awkgram.y" /* yacc.c:1646 */
+#line 2054 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 4258 "awkgram.c" /* yacc.c:1646 */
+#line 4257 "awkgram.c" /* yacc.c:1646 */
break;
case 201:
-#line 2063 "awkgram.y" /* yacc.c:1646 */
+#line 2062 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4264 "awkgram.c" /* yacc.c:1646 */
+#line 4263 "awkgram.c" /* yacc.c:1646 */
break;
case 202:
-#line 2067 "awkgram.y" /* yacc.c:1646 */
+#line 2066 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4270 "awkgram.c" /* yacc.c:1646 */
+#line 4269 "awkgram.c" /* yacc.c:1646 */
break;
case 205:
-#line 2076 "awkgram.y" /* yacc.c:1646 */
+#line 2075 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4276 "awkgram.c" /* yacc.c:1646 */
+#line 4275 "awkgram.c" /* yacc.c:1646 */
break;
case 206:
-#line 2080 "awkgram.y" /* yacc.c:1646 */
+#line 2079 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); yyerrok; }
-#line 4282 "awkgram.c" /* yacc.c:1646 */
+#line 4281 "awkgram.c" /* yacc.c:1646 */
break;
case 207:
-#line 2084 "awkgram.y" /* yacc.c:1646 */
+#line 2083 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4288 "awkgram.c" /* yacc.c:1646 */
+#line 4287 "awkgram.c" /* yacc.c:1646 */
break;
-#line 4292 "awkgram.c" /* yacc.c:1646 */
+#line 4291 "awkgram.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -4516,7 +4515,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 2086 "awkgram.y" /* yacc.c:1906 */
+#line 2085 "awkgram.y" /* yacc.c:1906 */
struct token {
@@ -8883,6 +8882,11 @@ set_profile_text(NODE *n, const char *str, size_t len)
/* validate_qualified_name --- make sure that a qualified name is built
correctly */
+/*
+ * This routine returns upon first error, no need to produce multiple, possibly
+ * conflicting / confusing error messages.
+ */
+
void
validate_qualified_name(char *token)
{
@@ -8892,15 +8896,29 @@ validate_qualified_name(char *token)
if ((cp = strchr(token, ':')) == NULL)
return;
- if (! is_letter(cp[2]))
+ if (do_traditional || do_posix) {
+ error_ln(sourceline, _("identifier %s: qualified names not
allowed in traditional / POSIX mode"), token);
+ return;
+ }
+
+ if (cp[1] != ':') { // could happen from command line
+ error_ln(sourceline, _("identifier %s: namespace separator is
two colons, not one"), token);
+ return;
+ }
+
+ if (! is_letter(cp[2])) {
error_ln(sourceline,
_("qualified identifier `%s' is badly formed"),
token);
+ return;
+ }
- if ((cp2 = strchr(cp+2, ':')) != NULL)
+ if ((cp2 = strchr(cp+2, ':')) != NULL) {
error_ln(sourceline,
_("identifier `%s': namespace separator can only appear
once in a qualified name"),
token);
+ return;
+ }
}
/* check_qualified_name --- decide if a name is special or not */
@@ -8943,43 +8961,53 @@ check_qualified_name(char *token)
// First check the namespace part
i = check_special(ns);
- if (i >= 0 && (tokentab[i].flags & GAWKX) == 0)
- fatal(_("using reserved identifier `%s' as a namespace is not
allowed"), ns);
+ if (i >= 0 && (tokentab[i].flags & GAWKX) == 0) {
+ error_ln(sourceline, _("using reserved identifier `%s' as a
namespace is not allowed"), ns);
+ goto done;
+ }
// Now check the subordinate part
i = check_special(subname);
- if (i >= 0 && (tokentab[i].flags & GAWKX) == 0 && strcmp(ns, "awk") !=
0)
- fatal(_("using reserved identifier `%s' as second component of
a qualified name is not allowed"), subname);
+ if (i >= 0 && (tokentab[i].flags & GAWKX) == 0 && strcmp(ns, "awk") !=
0) {
+ error_ln(sourceline, _("using reserved identifier `%s' as
second component of a qualified name is not allowed"), subname);
+ goto done;
+ }
- if (strcmp(ns, "awk") == 0)
+ if (strcmp(ns, "awk") == 0) {
i = check_special(subname);
- else
+ if (i >= 0) {
+ if ((tokentab[i].flags & GAWKX) != 0 &&
tokentab[i].class == LEX_BUILTIN)
+ ; // gawk additional builtin function, is
ok
+ else
+ error_ln(sourceline, _("using reserved
identifier `%s' as second component of a qualified name is not allowed"),
subname);
+ }
+ } else
i = -1;
-
+done:
*end = ':';
return i;
}
/* set_namespace --- change the current namespace */
-static bool
+static void
set_namespace(INSTRUCTION *ns)
{
if (ns == NULL)
- return false;
+ return;
if (do_traditional || do_posix) {
error_ln(ns->source_line, _("@namespace is a gawk extension"));
efree(ns->lextok);
bcfree(ns);
- return false;
+ return;
}
if (! is_valid_identifier(ns->lextok)) {
error_ln(ns->source_line, _("namespace name `%s' must meet
identifier naming rules"), ns->lextok);
efree(ns->lextok);
bcfree(ns);
- return false;
+ return;
}
int mid = check_special(ns->lextok);
@@ -8988,7 +9016,7 @@ set_namespace(INSTRUCTION *ns)
error_ln(ns->source_line, _("using reserved identifier `%s' as
a namespace is not allowed"), ns->lextok);
efree(ns->lextok);
bcfree(ns);
- return false;
+ return;
}
if (strcmp(ns->lextok, current_namespace) == 0)
@@ -9007,7 +9035,7 @@ set_namespace(INSTRUCTION *ns)
namespace_changed = true;
- return true;
+ return;
}
/* make_pp_namespace --- make namespace string for use by pretty printer */
diff --git a/awkgram.y b/awkgram.y
index 534aa5c..90249e2 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -55,7 +55,7 @@ static void dumpintlstr(const char *str, size_t len);
static void dumpintlstr2(const char *str1, size_t len1, const char *str2,
size_t len2);
static int include_source(INSTRUCTION *file);
static int load_library(INSTRUCTION *file);
-static bool set_namespace(INSTRUCTION *ns);
+static void set_namespace(INSTRUCTION *ns);
static void next_sourcefile(void);
static char *tokexpand(void);
static NODE *set_profile_text(NODE *n, const char *str, size_t len);
@@ -283,8 +283,7 @@ rule
at_seen = false;
// this frees $3 storage in all cases
- if (! set_namespace($3))
- YYABORT;
+ set_namespace($3);
yyerrok;
}
@@ -6449,6 +6448,11 @@ set_profile_text(NODE *n, const char *str, size_t len)
/* validate_qualified_name --- make sure that a qualified name is built
correctly */
+/*
+ * This routine returns upon first error, no need to produce multiple, possibly
+ * conflicting / confusing error messages.
+ */
+
void
validate_qualified_name(char *token)
{
@@ -6458,15 +6462,29 @@ validate_qualified_name(char *token)
if ((cp = strchr(token, ':')) == NULL)
return;
- if (! is_letter(cp[2]))
+ if (do_traditional || do_posix) {
+ error_ln(sourceline, _("identifier %s: qualified names not
allowed in traditional / POSIX mode"), token);
+ return;
+ }
+
+ if (cp[1] != ':') { // could happen from command line
+ error_ln(sourceline, _("identifier %s: namespace separator is
two colons, not one"), token);
+ return;
+ }
+
+ if (! is_letter(cp[2])) {
error_ln(sourceline,
_("qualified identifier `%s' is badly formed"),
token);
+ return;
+ }
- if ((cp2 = strchr(cp+2, ':')) != NULL)
+ if ((cp2 = strchr(cp+2, ':')) != NULL) {
error_ln(sourceline,
_("identifier `%s': namespace separator can only appear
once in a qualified name"),
token);
+ return;
+ }
}
/* check_qualified_name --- decide if a name is special or not */
@@ -6509,43 +6527,53 @@ check_qualified_name(char *token)
// First check the namespace part
i = check_special(ns);
- if (i >= 0 && (tokentab[i].flags & GAWKX) == 0)
- fatal(_("using reserved identifier `%s' as a namespace is not
allowed"), ns);
+ if (i >= 0 && (tokentab[i].flags & GAWKX) == 0) {
+ error_ln(sourceline, _("using reserved identifier `%s' as a
namespace is not allowed"), ns);
+ goto done;
+ }
// Now check the subordinate part
i = check_special(subname);
- if (i >= 0 && (tokentab[i].flags & GAWKX) == 0 && strcmp(ns, "awk") !=
0)
- fatal(_("using reserved identifier `%s' as second component of
a qualified name is not allowed"), subname);
+ if (i >= 0 && (tokentab[i].flags & GAWKX) == 0 && strcmp(ns, "awk") !=
0) {
+ error_ln(sourceline, _("using reserved identifier `%s' as
second component of a qualified name is not allowed"), subname);
+ goto done;
+ }
- if (strcmp(ns, "awk") == 0)
+ if (strcmp(ns, "awk") == 0) {
i = check_special(subname);
- else
+ if (i >= 0) {
+ if ((tokentab[i].flags & GAWKX) != 0 &&
tokentab[i].class == LEX_BUILTIN)
+ ; // gawk additional builtin function, is
ok
+ else
+ error_ln(sourceline, _("using reserved
identifier `%s' as second component of a qualified name is not allowed"),
subname);
+ }
+ } else
i = -1;
-
+done:
*end = ':';
return i;
}
/* set_namespace --- change the current namespace */
-static bool
+static void
set_namespace(INSTRUCTION *ns)
{
if (ns == NULL)
- return false;
+ return;
if (do_traditional || do_posix) {
error_ln(ns->source_line, _("@namespace is a gawk extension"));
efree(ns->lextok);
bcfree(ns);
- return false;
+ return;
}
if (! is_valid_identifier(ns->lextok)) {
error_ln(ns->source_line, _("namespace name `%s' must meet
identifier naming rules"), ns->lextok);
efree(ns->lextok);
bcfree(ns);
- return false;
+ return;
}
int mid = check_special(ns->lextok);
@@ -6554,7 +6582,7 @@ set_namespace(INSTRUCTION *ns)
error_ln(ns->source_line, _("using reserved identifier `%s' as
a namespace is not allowed"), ns->lextok);
efree(ns->lextok);
bcfree(ns);
- return false;
+ return;
}
if (strcmp(ns->lextok, current_namespace) == 0)
@@ -6573,7 +6601,7 @@ set_namespace(INSTRUCTION *ns)
namespace_changed = true;
- return true;
+ return;
}
/* make_pp_namespace --- make namespace string for use by pretty printer */
diff --git a/interpret.h b/interpret.h
index b2b453e..391715b 100644
--- a/interpret.h
+++ b/interpret.h
@@ -1076,7 +1076,8 @@ match_re:
ni = setup_frame(pc);
JUMPTO(ni); /* Op_func */
}
- f = lookup(t1->stptr, false);
+ bool do_qualify = (strchr(t1->stptr, ':') ==
NULL);
+ f = lookup(t1->stptr, do_qualify);
}
if (f == NULL) {
diff --git a/test/ChangeLog b/test/ChangeLog
index 37007dd..41b5c92 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2017-07-26 Arnold D. Robbins <address@hidden>
+
+ * Makefile.am (nsbad): New test.
+ * nsbad.awk, nsbad.ok: New files.
+
2017-07-20 Arnold D. Robbins <address@hidden>
* Makefile.am (inplace1, inplace2, inplace3): Update to use
diff --git a/test/Makefile.am b/test/Makefile.am
index 7aa1bd9..f6e0b6b 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -740,6 +740,8 @@ EXTRA_DIST = \
noparms.ok \
nors.in \
nors.ok \
+ nsbad.awk \
+ nsbad.ok \
nsprof1.awk \
nsprof1.ok \
nsprof2.awk \
@@ -1265,7 +1267,7 @@ GAWK_EXT_TESTS = \
muldimposix \
nastyparm negtime next nondec nondec2 \
nonfatal1 nonfatal2 nonfatal3 \
- nsprof1 nsprof2 \
+ nsbad nsprof1 nsprof2 \
patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge
procinfs \
profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7
\
profile8 profile9 profile10 pty1 \
diff --git a/test/Makefile.in b/test/Makefile.in
index 8703347..a6ff60c 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -998,6 +998,8 @@ EXTRA_DIST = \
noparms.ok \
nors.in \
nors.ok \
+ nsbad.awk \
+ nsbad.ok \
nsprof1.awk \
nsprof1.ok \
nsprof2.awk \
@@ -1522,7 +1524,7 @@ GAWK_EXT_TESTS = \
muldimposix \
nastyparm negtime next nondec nondec2 \
nonfatal1 nonfatal2 nonfatal3 \
- nsprof1 nsprof2 \
+ nsbad nsprof1 nsprof2 \
patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge
procinfs \
profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7
\
profile8 profile9 profile10 pty1 \
@@ -4275,6 +4277,11 @@ nonfatal3:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+nsbad:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
patsplit:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index f8c54f9..87c811b 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1392,6 +1392,11 @@ nonfatal3:
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+nsbad:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
patsplit:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo EXIT
CODE: $$? >>_$@
diff --git a/test/nsbad.awk b/test/nsbad.awk
new file mode 100644
index 0000000..825bb35
--- /dev/null
+++ b/test/nsbad.awk
@@ -0,0 +1,15 @@
address@hidden "1foo"
address@hidden "for"
address@hidden "42f"
address@hidden "ab#d"
+
+BEGIN {
+ foo75::bar = 57
+ if::junk = 1
+ foo::match = 3
+}
+
address@hidden "foo"
+function gsub () {
+ print "foo::gsub"
+}
diff --git a/test/nsbad.ok b/test/nsbad.ok
new file mode 100644
index 0000000..dfa228a
--- /dev/null
+++ b/test/nsbad.ok
@@ -0,0 +1,13 @@
+gawk: nsbad.awk:1: error: namespace name `1foo' must meet identifier naming
rules
+gawk: nsbad.awk:2: error: using reserved identifier `for' as a namespace is
not allowed
+gawk: nsbad.awk:3: error: namespace name `42f' must meet identifier naming
rules
+gawk: nsbad.awk:4: error: namespace name `ab#d' must meet identifier naming
rules
+gawk: nsbad.awk:8: error: using reserved identifier `if' as a namespace is not
allowed
+gawk: nsbad.awk:8: if::junk = 1
+gawk: nsbad.awk:8: ^ syntax error
+gawk: nsbad.awk:9: error: using reserved identifier `match' as second
component of a qualified name is not allowed
+gawk: nsbad.awk:9: foo::match = 3
+gawk: nsbad.awk:9: ^ syntax error
+gawk: nsbad.awk:13: function gsub () {
+gawk: nsbad.awk:13: ^ `gsub' is a built-in function, it cannot be
redefined
+EXIT CODE: 1
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 12 +
awkgram.c | 822 ++++++++++++++++++++++++++++---------------------------
awkgram.y | 64 +++--
interpret.h | 3 +-
test/ChangeLog | 5 +
test/Makefile.am | 4 +-
test/Makefile.in | 9 +-
test/Maketests | 5 +
test/nsbad.awk | 15 +
test/nsbad.ok | 13 +
10 files changed, 534 insertions(+), 418 deletions(-)
create mode 100644 test/nsbad.awk
create mode 100644 test/nsbad.ok
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, feature/namespaces, updated. gawk-4.1.0-2647-g4138bc1,
Arnold Robbins <=