[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, feature/fix-comments, updated. gawk-4.1.
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, feature/fix-comments, updated. gawk-4.1.0-3518-gac700ec |
Date: |
Sun, 11 Nov 2018 14:44:09 -0500 (EST) |
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/fix-comments has been updated
via ac700ecf05bd7f2f877be20311c39c0aefc4887a (commit)
from f2e733ea2a3213e2571bffb269f80bd62f4448c3 (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=ac700ecf05bd7f2f877be20311c39c0aefc4887a
commit ac700ecf05bd7f2f877be20311c39c0aefc4887a
Author: Arnold D. Robbins <address@hidden>
Date: Sun Nov 11 21:43:54 2018 +0200
More improvements on block comments.
diff --git a/ChangeLog b/ChangeLog
index c6e090c..d2ce3bd 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2018-11-11 Arnold D. Robbins <address@hidden>
+ * awkgram.y (outer_comment): New variable.
+ (Grammar): More changes. We now get the simple case of leading
+ and trailing comments, but not all the cases.
+
+2018-11-11 Arnold D. Robbins <address@hidden>
+
* awkgram.y (trailing_comment): New variable.
(Grammar): For `action', append both trailing comments. This may
change. For `statements', append the value of `trailing_comment'
diff --git a/awkgram.c b/awkgram.c
index 40d2948..bc0d706 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -99,6 +99,7 @@ static void next_sourcefile(void);
static char *tokexpand(void);
static NODE *set_profile_text(NODE *n, const char *str, size_t len);
static INSTRUCTION *trailing_comment;
+static INSTRUCTION *outer_comment;
#define instruction(t) bcalloc(t, 1, 0)
@@ -205,7 +206,7 @@ extern double fmod(double x, double y);
#define YYSTYPE INSTRUCTION *
-#line 209 "awkgram.c" /* yacc.c:339 */
+#line 210 "awkgram.c" /* yacc.c:339 */
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
@@ -361,7 +362,7 @@ int yyparse (void);
/* Copy the second part of user declarations. */
-#line 365 "awkgram.c" /* yacc.c:358 */
+#line 366 "awkgram.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -663,27 +664,27 @@ static const yytype_uint8 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 231, 231, 232, 237, 245, 249, 261, 266, 280,
- 287, 297, 310, 320, 322, 327, 337, 339, 345, 349,
- 354, 384, 397, 410, 417, 427, 442, 444, 446, 452,
- 460, 461, 465, 465, 499, 498, 532, 547, 549, 554,
- 555, 573, 578, 579, 583, 594, 599, 606, 714, 765,
- 815, 941, 962, 983, 993, 1003, 1013, 1024, 1037, 1055,
- 1054, 1068, 1086, 1086, 1184, 1184, 1217, 1247, 1255, 1256,
- 1262, 1263, 1270, 1275, 1288, 1303, 1305, 1313, 1320, 1322,
- 1330, 1339, 1341, 1350, 1351, 1359, 1364, 1364, 1377, 1383,
- 1395, 1396, 1418, 1419, 1425, 1426, 1435, 1436, 1441, 1446,
- 1463, 1465, 1467, 1474, 1475, 1481, 1482, 1487, 1489, 1496,
- 1498, 1506, 1511, 1522, 1523, 1528, 1530, 1537, 1539, 1547,
- 1552, 1562, 1563, 1568, 1575, 1579, 1581, 1583, 1596, 1613,
- 1623, 1630, 1632, 1637, 1639, 1641, 1649, 1651, 1656, 1658,
- 1663, 1665, 1667, 1724, 1726, 1728, 1730, 1732, 1734, 1736,
- 1738, 1752, 1757, 1762, 1787, 1793, 1795, 1797, 1799, 1801,
- 1803, 1808, 1812, 1844, 1852, 1858, 1864, 1877, 1878, 1879,
- 1884, 1889, 1893, 1897, 1912, 1933, 1938, 1975, 2004, 2005,
- 2011, 2012, 2017, 2019, 2026, 2043, 2060, 2062, 2069, 2074,
- 2082, 2092, 2104, 2113, 2117, 2122, 2126, 2130, 2134, 2139,
- 2140, 2144, 2148, 2152
+ 0, 232, 232, 233, 238, 249, 253, 265, 270, 284,
+ 291, 301, 314, 324, 326, 331, 341, 343, 349, 353,
+ 358, 388, 401, 414, 421, 431, 449, 451, 453, 459,
+ 467, 468, 472, 472, 506, 505, 539, 554, 556, 561,
+ 562, 580, 585, 586, 590, 601, 606, 613, 721, 772,
+ 822, 948, 969, 990, 1000, 1010, 1020, 1031, 1044, 1062,
+ 1061, 1075, 1093, 1093, 1191, 1191, 1224, 1254, 1262, 1263,
+ 1269, 1270, 1277, 1282, 1295, 1310, 1312, 1320, 1327, 1329,
+ 1337, 1346, 1348, 1357, 1358, 1366, 1371, 1371, 1384, 1390,
+ 1402, 1406, 1428, 1429, 1435, 1436, 1445, 1446, 1451, 1456,
+ 1473, 1475, 1477, 1484, 1485, 1491, 1492, 1497, 1499, 1506,
+ 1508, 1516, 1521, 1532, 1533, 1538, 1540, 1547, 1549, 1557,
+ 1562, 1572, 1573, 1578, 1585, 1589, 1591, 1593, 1606, 1623,
+ 1633, 1640, 1642, 1647, 1649, 1651, 1659, 1661, 1666, 1668,
+ 1673, 1675, 1677, 1734, 1736, 1738, 1740, 1742, 1744, 1746,
+ 1748, 1762, 1767, 1772, 1797, 1803, 1805, 1807, 1809, 1811,
+ 1813, 1818, 1822, 1854, 1862, 1868, 1874, 1887, 1888, 1889,
+ 1894, 1899, 1903, 1907, 1922, 1943, 1948, 1985, 2014, 2015,
+ 2021, 2022, 2027, 2029, 2036, 2053, 2070, 2072, 2079, 2084,
+ 2092, 2102, 2114, 2123, 2127, 2132, 2136, 2140, 2144, 2149,
+ 2150, 2154, 2158, 2162
};
#endif
@@ -1882,42 +1883,45 @@ yyreduce:
switch (yyn)
{
case 2:
-#line 231 "awkgram.y" /* yacc.c:1651 */
+#line 232 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 1888 "awkgram.c" /* yacc.c:1651 */
+#line 1889 "awkgram.c" /* yacc.c:1651 */
break;
case 3:
-#line 233 "awkgram.y" /* yacc.c:1651 */
+#line 234 "awkgram.y" /* yacc.c:1651 */
{
rule = 0;
yyerrok;
}
-#line 1897 "awkgram.c" /* yacc.c:1651 */
+#line 1898 "awkgram.c" /* yacc.c:1651 */
break;
case 4:
-#line 238 "awkgram.y" /* yacc.c:1651 */
+#line 239 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[0]) != NULL) {
- merge_comments((yyvsp[0]), NULL);
- (yyval) = list_append(rule_list, (yyvsp[0]));
- } else
- (yyval) = (yyvsp[-1]);
+ if ((yyvsp[-1]) == NULL) {
+ outer_comment = (yyvsp[0]);
+ } else {
+ trailing_comment = (yyvsp[0]);
+ }
+ }
+ (yyval) = (yyvsp[-1]);
}
-#line 1909 "awkgram.c" /* yacc.c:1651 */
+#line 1913 "awkgram.c" /* yacc.c:1651 */
break;
case 5:
-#line 246 "awkgram.y" /* yacc.c:1651 */
+#line 250 "awkgram.y" /* yacc.c:1651 */
{
next_sourcefile();
}
-#line 1917 "awkgram.c" /* yacc.c:1651 */
+#line 1921 "awkgram.c" /* yacc.c:1651 */
break;
case 6:
-#line 250 "awkgram.y" /* yacc.c:1651 */
+#line 254 "awkgram.y" /* yacc.c:1651 */
{
rule = 0;
/*
@@ -1926,20 +1930,20 @@ yyreduce:
*/
/* yyerrok; */
}
-#line 1930 "awkgram.c" /* yacc.c:1651 */
+#line 1934 "awkgram.c" /* yacc.c:1651 */
break;
case 7:
-#line 262 "awkgram.y" /* yacc.c:1651 */
+#line 266 "awkgram.y" /* yacc.c:1651 */
{
(void) append_rule((yyvsp[-1]), (yyvsp[0]));
first_rule = false;
}
-#line 1939 "awkgram.c" /* yacc.c:1651 */
+#line 1943 "awkgram.c" /* yacc.c:1651 */
break;
case 8:
-#line 267 "awkgram.y" /* yacc.c:1651 */
+#line 271 "awkgram.y" /* yacc.c:1651 */
{
if (rule != Rule) {
msg(_("%s blocks must have an action part"),
ruletab[rule]);
@@ -1953,22 +1957,22 @@ yyreduce:
(void) append_rule((yyvsp[-1]), NULL);
}
}
-#line 1957 "awkgram.c" /* yacc.c:1651 */
+#line 1961 "awkgram.c" /* yacc.c:1651 */
break;
case 9:
-#line 281 "awkgram.y" /* yacc.c:1651 */
+#line 285 "awkgram.y" /* yacc.c:1651 */
{
in_function = NULL;
(void) mk_function((yyvsp[-1]), (yyvsp[0]));
want_param_names = DONT_CHECK;
yyerrok;
}
-#line 1968 "awkgram.c" /* yacc.c:1651 */
+#line 1972 "awkgram.c" /* yacc.c:1651 */
break;
case 10:
-#line 288 "awkgram.y" /* yacc.c:1651 */
+#line 292 "awkgram.y" /* yacc.c:1651 */
{
want_source = false;
at_seen = false;
@@ -1978,11 +1982,11 @@ yyreduce:
}
yyerrok;
}
-#line 1982 "awkgram.c" /* yacc.c:1651 */
+#line 1986 "awkgram.c" /* yacc.c:1651 */
break;
case 11:
-#line 298 "awkgram.y" /* yacc.c:1651 */
+#line 302 "awkgram.y" /* yacc.c:1651 */
{
want_source = false;
at_seen = false;
@@ -1992,11 +1996,11 @@ yyreduce:
}
yyerrok;
}
-#line 1996 "awkgram.c" /* yacc.c:1651 */
+#line 2000 "awkgram.c" /* yacc.c:1651 */
break;
case 12:
-#line 311 "awkgram.y" /* yacc.c:1651 */
+#line 315 "awkgram.y" /* yacc.c:1651 */
{
void *srcfile = NULL;
@@ -2006,23 +2010,23 @@ yyreduce:
bcfree((yyvsp[0]));
(yyval) = (INSTRUCTION *) srcfile;
}
-#line 2010 "awkgram.c" /* yacc.c:1651 */
+#line 2014 "awkgram.c" /* yacc.c:1651 */
break;
case 13:
-#line 321 "awkgram.y" /* yacc.c:1651 */
+#line 325 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 2016 "awkgram.c" /* yacc.c:1651 */
+#line 2020 "awkgram.c" /* yacc.c:1651 */
break;
case 14:
-#line 323 "awkgram.y" /* yacc.c:1651 */
+#line 327 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 2022 "awkgram.c" /* yacc.c:1651 */
+#line 2026 "awkgram.c" /* yacc.c:1651 */
break;
case 15:
-#line 328 "awkgram.y" /* yacc.c:1651 */
+#line 332 "awkgram.y" /* yacc.c:1651 */
{
void *srcfile;
@@ -2032,40 +2036,40 @@ yyreduce:
bcfree((yyvsp[0]));
(yyval) = (INSTRUCTION *) srcfile;
}
-#line 2036 "awkgram.c" /* yacc.c:1651 */
+#line 2040 "awkgram.c" /* yacc.c:1651 */
break;
case 16:
-#line 338 "awkgram.y" /* yacc.c:1651 */
+#line 342 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 2042 "awkgram.c" /* yacc.c:1651 */
+#line 2046 "awkgram.c" /* yacc.c:1651 */
break;
case 17:
-#line 340 "awkgram.y" /* yacc.c:1651 */
+#line 344 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 2048 "awkgram.c" /* yacc.c:1651 */
+#line 2052 "awkgram.c" /* yacc.c:1651 */
break;
case 18:
-#line 345 "awkgram.y" /* yacc.c:1651 */
+#line 349 "awkgram.y" /* yacc.c:1651 */
{
rule = Rule;
(yyval) = NULL;
}
-#line 2057 "awkgram.c" /* yacc.c:1651 */
+#line 2061 "awkgram.c" /* yacc.c:1651 */
break;
case 19:
-#line 350 "awkgram.y" /* yacc.c:1651 */
+#line 354 "awkgram.y" /* yacc.c:1651 */
{
rule = Rule;
}
-#line 2065 "awkgram.c" /* yacc.c:1651 */
+#line 2069 "awkgram.c" /* yacc.c:1651 */
break;
case 20:
-#line 355 "awkgram.y" /* yacc.c:1651 */
+#line 359 "awkgram.y" /* yacc.c:1651 */
{
INSTRUCTION *tp;
@@ -2095,11 +2099,11 @@ yyreduce:
(yyval) = list_append(list_merge((yyvsp[-3]),
(yyvsp[0])), tp);
rule = Rule;
}
-#line 2099 "awkgram.c" /* yacc.c:1651 */
+#line 2103 "awkgram.c" /* yacc.c:1651 */
break;
case 21:
-#line 385 "awkgram.y" /* yacc.c:1651 */
+#line 389 "awkgram.y" /* yacc.c:1651 */
{
static int begin_seen = 0;
@@ -2112,11 +2116,11 @@ yyreduce:
(yyvsp[0])->source_file = source;
(yyval) = (yyvsp[0]);
}
-#line 2116 "awkgram.c" /* yacc.c:1651 */
+#line 2120 "awkgram.c" /* yacc.c:1651 */
break;
case 22:
-#line 398 "awkgram.y" /* yacc.c:1651 */
+#line 402 "awkgram.y" /* yacc.c:1651 */
{
static int end_seen = 0;
@@ -2129,86 +2133,89 @@ yyreduce:
(yyvsp[0])->source_file = source;
(yyval) = (yyvsp[0]);
}
-#line 2133 "awkgram.c" /* yacc.c:1651 */
+#line 2137 "awkgram.c" /* yacc.c:1651 */
break;
case 23:
-#line 411 "awkgram.y" /* yacc.c:1651 */
+#line 415 "awkgram.y" /* yacc.c:1651 */
{
func_first = false;
(yyvsp[0])->in_rule = rule = BEGINFILE;
(yyvsp[0])->source_file = source;
(yyval) = (yyvsp[0]);
}
-#line 2144 "awkgram.c" /* yacc.c:1651 */
+#line 2148 "awkgram.c" /* yacc.c:1651 */
break;
case 24:
-#line 418 "awkgram.y" /* yacc.c:1651 */
+#line 422 "awkgram.y" /* yacc.c:1651 */
{
func_first = false;
(yyvsp[0])->in_rule = rule = ENDFILE;
(yyvsp[0])->source_file = source;
(yyval) = (yyvsp[0]);
}
-#line 2155 "awkgram.c" /* yacc.c:1651 */
+#line 2159 "awkgram.c" /* yacc.c:1651 */
break;
case 25:
-#line 428 "awkgram.y" /* yacc.c:1651 */
+#line 432 "awkgram.y" /* yacc.c:1651 */
{
INSTRUCTION *ip = make_braced_statements((yyvsp[-4]),
(yyvsp[-3]), (yyvsp[-2]));
- if ((yyvsp[-2]) != NULL)
- ip = list_append(ip, (yyvsp[-2]));
-
- if ((yyvsp[0]) != NULL)
- ip = list_append(ip, (yyvsp[0]));
+ if ((yyvsp[-2]) != NULL && (yyvsp[0]) != NULL) {
+ merge_comments((yyvsp[-2]), (yyvsp[0]));
+ trailing_comment = (yyvsp[-2]);
+ } else if ((yyvsp[-2]) != NULL) {
+ trailing_comment = (yyvsp[-2]);
+ } else if ((yyvsp[0]) != NULL) {
+ trailing_comment = (yyvsp[0]);
+ }
(yyval) = ip;
}
-#line 2171 "awkgram.c" /* yacc.c:1651 */
+#line 2178 "awkgram.c" /* yacc.c:1651 */
break;
case 26:
-#line 443 "awkgram.y" /* yacc.c:1651 */
+#line 450 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 2177 "awkgram.c" /* yacc.c:1651 */
+#line 2184 "awkgram.c" /* yacc.c:1651 */
break;
case 27:
-#line 445 "awkgram.y" /* yacc.c:1651 */
+#line 452 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 2183 "awkgram.c" /* yacc.c:1651 */
+#line 2190 "awkgram.c" /* yacc.c:1651 */
break;
case 28:
-#line 447 "awkgram.y" /* yacc.c:1651 */
+#line 454 "awkgram.y" /* yacc.c:1651 */
{
yyerror(_("`%s' is a built-in function, it cannot be
redefined"),
tokstart);
YYABORT;
}
-#line 2193 "awkgram.c" /* yacc.c:1651 */
+#line 2200 "awkgram.c" /* yacc.c:1651 */
break;
case 29:
-#line 453 "awkgram.y" /* yacc.c:1651 */
+#line 460 "awkgram.y" /* yacc.c:1651 */
{
(yyval) = (yyvsp[0]);
at_seen = false;
}
-#line 2202 "awkgram.c" /* yacc.c:1651 */
+#line 2209 "awkgram.c" /* yacc.c:1651 */
break;
case 32:
-#line 465 "awkgram.y" /* yacc.c:1651 */
+#line 472 "awkgram.y" /* yacc.c:1651 */
{ want_param_names = FUNC_HEADER; }
-#line 2208 "awkgram.c" /* yacc.c:1651 */
+#line 2215 "awkgram.c" /* yacc.c:1651 */
break;
case 33:
-#line 466 "awkgram.y" /* yacc.c:1651 */
+#line 473 "awkgram.y" /* yacc.c:1651 */
{
INSTRUCTION *func_comment = NULL;
// Merge any comments found in the parameter list with those
@@ -2234,17 +2241,17 @@ yyreduce:
(yyval) = (yyvsp[-6]);
want_param_names = FUNC_BODY;
}
-#line 2238 "awkgram.c" /* yacc.c:1651 */
+#line 2245 "awkgram.c" /* yacc.c:1651 */
break;
case 34:
-#line 499 "awkgram.y" /* yacc.c:1651 */
+#line 506 "awkgram.y" /* yacc.c:1651 */
{ want_regexp = true; }
-#line 2244 "awkgram.c" /* yacc.c:1651 */
+#line 2251 "awkgram.c" /* yacc.c:1651 */
break;
case 35:
-#line 501 "awkgram.y" /* yacc.c:1651 */
+#line 508 "awkgram.y" /* yacc.c:1651 */
{
NODE *n, *exp;
char *re;
@@ -2273,11 +2280,11 @@ yyreduce:
(yyval)->opcode = Op_match_rec;
(yyval)->memory = n;
}
-#line 2277 "awkgram.c" /* yacc.c:1651 */
+#line 2284 "awkgram.c" /* yacc.c:1651 */
break;
case 36:
-#line 533 "awkgram.y" /* yacc.c:1651 */
+#line 540 "awkgram.y" /* yacc.c:1651 */
{
char *re;
size_t len;
@@ -2290,23 +2297,23 @@ yyreduce:
(yyval)->opcode = Op_push_re;
(yyval)->memory = make_typed_regex(re, len);
}
-#line 2294 "awkgram.c" /* yacc.c:1651 */
+#line 2301 "awkgram.c" /* yacc.c:1651 */
break;
case 37:
-#line 548 "awkgram.y" /* yacc.c:1651 */
+#line 555 "awkgram.y" /* yacc.c:1651 */
{ bcfree((yyvsp[0])); }
-#line 2300 "awkgram.c" /* yacc.c:1651 */
+#line 2307 "awkgram.c" /* yacc.c:1651 */
break;
case 39:
-#line 554 "awkgram.y" /* yacc.c:1651 */
+#line 561 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 2306 "awkgram.c" /* yacc.c:1651 */
+#line 2313 "awkgram.c" /* yacc.c:1651 */
break;
case 40:
-#line 556 "awkgram.y" /* yacc.c:1651 */
+#line 563 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[0]) == NULL) {
(yyval) = (yyvsp[-1]);
@@ -2324,29 +2331,29 @@ yyreduce:
}
yyerrok;
}
-#line 2328 "awkgram.c" /* yacc.c:1651 */
+#line 2335 "awkgram.c" /* yacc.c:1651 */
break;
case 41:
-#line 574 "awkgram.y" /* yacc.c:1651 */
+#line 581 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 2334 "awkgram.c" /* yacc.c:1651 */
+#line 2341 "awkgram.c" /* yacc.c:1651 */
break;
case 42:
-#line 578 "awkgram.y" /* yacc.c:1651 */
+#line 585 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 2340 "awkgram.c" /* yacc.c:1651 */
+#line 2347 "awkgram.c" /* yacc.c:1651 */
break;
case 43:
-#line 579 "awkgram.y" /* yacc.c:1651 */
+#line 586 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 2346 "awkgram.c" /* yacc.c:1651 */
+#line 2353 "awkgram.c" /* yacc.c:1651 */
break;
case 44:
-#line 584 "awkgram.y" /* yacc.c:1651 */
+#line 591 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[0]) != NULL) {
INSTRUCTION *ip;
@@ -2357,31 +2364,31 @@ yyreduce:
} else
(yyval) = NULL;
}
-#line 2361 "awkgram.c" /* yacc.c:1651 */
+#line 2368 "awkgram.c" /* yacc.c:1651 */
break;
case 45:
-#line 595 "awkgram.y" /* yacc.c:1651 */
+#line 602 "awkgram.y" /* yacc.c:1651 */
{
trailing_comment = (yyvsp[0]); // NULL or comment
(yyval) = make_braced_statements((yyvsp[-2]), (yyvsp[-1]),
(yyvsp[0]));
}
-#line 2370 "awkgram.c" /* yacc.c:1651 */
+#line 2377 "awkgram.c" /* yacc.c:1651 */
break;
case 46:
-#line 600 "awkgram.y" /* yacc.c:1651 */
+#line 607 "awkgram.y" /* yacc.c:1651 */
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[0]),
instruction(Op_exec_count));
else
(yyval) = (yyvsp[0]);
}
-#line 2381 "awkgram.c" /* yacc.c:1651 */
+#line 2388 "awkgram.c" /* yacc.c:1651 */
break;
case 47:
-#line 607 "awkgram.y" /* yacc.c:1651 */
+#line 614 "awkgram.y" /* yacc.c:1651 */
{
INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
INSTRUCTION *ip, *nextc, *tbreak;
@@ -2489,11 +2496,11 @@ yyreduce:
break_allowed--;
fix_break_continue(ip, tbreak, NULL);
}
-#line 2493 "awkgram.c" /* yacc.c:1651 */
+#line 2500 "awkgram.c" /* yacc.c:1651 */
break;
case 48:
-#line 715 "awkgram.y" /* yacc.c:1651 */
+#line 722 "awkgram.y" /* yacc.c:1651 */
{
/*
* -----------------
@@ -2544,11 +2551,11 @@ yyreduce:
continue_allowed--;
fix_break_continue(ip, tbreak, tcont);
}
-#line 2548 "awkgram.c" /* yacc.c:1651 */
+#line 2555 "awkgram.c" /* yacc.c:1651 */
break;
case 49:
-#line 766 "awkgram.y" /* yacc.c:1651 */
+#line 773 "awkgram.y" /* yacc.c:1651 */
{
/*
* -----------------
@@ -2598,11 +2605,11 @@ yyreduce:
/* else
$1 and $4 are NULLs */
}
-#line 2602 "awkgram.c" /* yacc.c:1651 */
+#line 2609 "awkgram.c" /* yacc.c:1651 */
break;
case 50:
-#line 816 "awkgram.y" /* yacc.c:1651 */
+#line 823 "awkgram.y" /* yacc.c:1651 */
{
INSTRUCTION *ip;
char *var_name = (yyvsp[-5])->lextok;
@@ -2728,11 +2735,11 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
-#line 2732 "awkgram.c" /* yacc.c:1651 */
+#line 2739 "awkgram.c" /* yacc.c:1651 */
break;
case 51:
-#line 942 "awkgram.y" /* yacc.c:1651 */
+#line 949 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[-7]) != NULL) {
merge_comments((yyvsp[-7]), NULL);
@@ -2753,11 +2760,11 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
-#line 2757 "awkgram.c" /* yacc.c:1651 */
+#line 2764 "awkgram.c" /* yacc.c:1651 */
break;
case 52:
-#line 963 "awkgram.y" /* yacc.c:1651 */
+#line 970 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[-6]) != NULL) {
merge_comments((yyvsp[-6]), NULL);
@@ -2778,22 +2785,22 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
-#line 2782 "awkgram.c" /* yacc.c:1651 */
+#line 2789 "awkgram.c" /* yacc.c:1651 */
break;
case 53:
-#line 984 "awkgram.y" /* yacc.c:1651 */
+#line 991 "awkgram.y" /* yacc.c:1651 */
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[0]),
instruction(Op_exec_count));
else
(yyval) = (yyvsp[0]);
}
-#line 2793 "awkgram.c" /* yacc.c:1651 */
+#line 2800 "awkgram.c" /* yacc.c:1651 */
break;
case 54:
-#line 994 "awkgram.y" /* yacc.c:1651 */
+#line 1001 "awkgram.y" /* yacc.c:1651 */
{
if (! break_allowed)
error_ln((yyvsp[-1])->source_line,
@@ -2803,11 +2810,11 @@ regular_loop:
if ((yyvsp[0]) != NULL)
(yyval) = list_append((yyval), (yyvsp[0]));
}
-#line 2807 "awkgram.c" /* yacc.c:1651 */
+#line 2814 "awkgram.c" /* yacc.c:1651 */
break;
case 55:
-#line 1004 "awkgram.y" /* yacc.c:1651 */
+#line 1011 "awkgram.y" /* yacc.c:1651 */
{
if (! continue_allowed)
error_ln((yyvsp[-1])->source_line,
@@ -2817,11 +2824,11 @@ regular_loop:
if ((yyvsp[0]) != NULL)
(yyval) = list_append((yyval), (yyvsp[0]));
}
-#line 2821 "awkgram.c" /* yacc.c:1651 */
+#line 2828 "awkgram.c" /* yacc.c:1651 */
break;
case 56:
-#line 1014 "awkgram.y" /* yacc.c:1651 */
+#line 1021 "awkgram.y" /* yacc.c:1651 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule && rule != Rule)
@@ -2832,11 +2839,11 @@ regular_loop:
if ((yyvsp[0]) != NULL)
(yyval) = list_append((yyval), (yyvsp[0]));
}
-#line 2836 "awkgram.c" /* yacc.c:1651 */
+#line 2843 "awkgram.c" /* yacc.c:1651 */
break;
case 57:
-#line 1025 "awkgram.y" /* yacc.c:1651 */
+#line 1032 "awkgram.y" /* yacc.c:1651 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule == BEGIN || rule == END || rule == ENDFILE)
@@ -2849,11 +2856,11 @@ regular_loop:
if ((yyvsp[0]) != NULL)
(yyval) = list_append((yyval), (yyvsp[0]));
}
-#line 2853 "awkgram.c" /* yacc.c:1651 */
+#line 2860 "awkgram.c" /* yacc.c:1651 */
break;
case 58:
-#line 1038 "awkgram.y" /* yacc.c:1651 */
+#line 1045 "awkgram.y" /* yacc.c:1651 */
{
/* Initialize the two possible jump targets, the actual target
* is resolved at run-time.
@@ -2870,20 +2877,20 @@ regular_loop:
if ((yyvsp[0]) != NULL)
(yyval) = list_append((yyval), (yyvsp[0]));
}
-#line 2874 "awkgram.c" /* yacc.c:1651 */
+#line 2881 "awkgram.c" /* yacc.c:1651 */
break;
case 59:
-#line 1055 "awkgram.y" /* yacc.c:1651 */
+#line 1062 "awkgram.y" /* yacc.c:1651 */
{
if (! in_function)
yyerror(_("`return' used outside function context"));
}
-#line 2883 "awkgram.c" /* yacc.c:1651 */
+#line 2890 "awkgram.c" /* yacc.c:1651 */
break;
case 60:
-#line 1058 "awkgram.y" /* yacc.c:1651 */
+#line 1065 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[-1]) == NULL) {
(yyval) = list_create((yyvsp[-3]));
@@ -2894,28 +2901,28 @@ regular_loop:
if ((yyvsp[0]) != NULL)
(yyval) = list_append((yyval), (yyvsp[0]));
}
-#line 2898 "awkgram.c" /* yacc.c:1651 */
+#line 2905 "awkgram.c" /* yacc.c:1651 */
break;
case 61:
-#line 1069 "awkgram.y" /* yacc.c:1651 */
+#line 1076 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[0]) != NULL)
(yyval) = list_append((yyvsp[-1]), (yyvsp[0]));
else
(yyval) = (yyvsp[-1]);
}
-#line 2909 "awkgram.c" /* yacc.c:1651 */
+#line 2916 "awkgram.c" /* yacc.c:1651 */
break;
case 62:
-#line 1086 "awkgram.y" /* yacc.c:1651 */
+#line 1093 "awkgram.y" /* yacc.c:1651 */
{ in_print = true; in_parens = 0; }
-#line 2915 "awkgram.c" /* yacc.c:1651 */
+#line 2922 "awkgram.c" /* yacc.c:1651 */
break;
case 63:
-#line 1087 "awkgram.y" /* yacc.c:1651 */
+#line 1094 "awkgram.y" /* yacc.c:1651 */
{
/*
* Optimization: plain `print' has no expression list, so $3 is
null.
@@ -3012,17 +3019,17 @@ regular_print:
}
}
}
-#line 3016 "awkgram.c" /* yacc.c:1651 */
+#line 3023 "awkgram.c" /* yacc.c:1651 */
break;
case 64:
-#line 1184 "awkgram.y" /* yacc.c:1651 */
+#line 1191 "awkgram.y" /* yacc.c:1651 */
{ sub_counter = 0; }
-#line 3022 "awkgram.c" /* yacc.c:1651 */
+#line 3029 "awkgram.c" /* yacc.c:1651 */
break;
case 65:
-#line 1185 "awkgram.y" /* yacc.c:1651 */
+#line 1192 "awkgram.y" /* yacc.c:1651 */
{
char *arr = (yyvsp[-2])->lextok;
@@ -3055,11 +3062,11 @@ regular_print:
(yyval) = list_append(list_append((yyvsp[0]),
(yyvsp[-2])), (yyvsp[-3]));
}
}
-#line 3059 "awkgram.c" /* yacc.c:1651 */
+#line 3066 "awkgram.c" /* yacc.c:1651 */
break;
case 66:
-#line 1222 "awkgram.y" /* yacc.c:1651 */
+#line 1229 "awkgram.y" /* yacc.c:1651 */
{
static bool warned = false;
char *arr = (yyvsp[-1])->lextok;
@@ -3085,54 +3092,54 @@ regular_print:
fatal(_("`delete' is not allowed with
FUNCTAB"));
}
}
-#line 3089 "awkgram.c" /* yacc.c:1651 */
+#line 3096 "awkgram.c" /* yacc.c:1651 */
break;
case 67:
-#line 1248 "awkgram.y" /* yacc.c:1651 */
+#line 1255 "awkgram.y" /* yacc.c:1651 */
{
(yyval) = optimize_assignment((yyvsp[0]));
}
-#line 3097 "awkgram.c" /* yacc.c:1651 */
+#line 3104 "awkgram.c" /* yacc.c:1651 */
break;
case 68:
-#line 1255 "awkgram.y" /* yacc.c:1651 */
+#line 1262 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 3103 "awkgram.c" /* yacc.c:1651 */
+#line 3110 "awkgram.c" /* yacc.c:1651 */
break;
case 69:
-#line 1257 "awkgram.y" /* yacc.c:1651 */
+#line 1264 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3109 "awkgram.c" /* yacc.c:1651 */
+#line 3116 "awkgram.c" /* yacc.c:1651 */
break;
case 70:
-#line 1262 "awkgram.y" /* yacc.c:1651 */
+#line 1269 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 3115 "awkgram.c" /* yacc.c:1651 */
+#line 3122 "awkgram.c" /* yacc.c:1651 */
break;
case 71:
-#line 1264 "awkgram.y" /* yacc.c:1651 */
+#line 1271 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[-1]) == NULL)
(yyval) = list_create((yyvsp[0]));
else
(yyval) = list_prepend((yyvsp[-1]), (yyvsp[0]));
}
-#line 3126 "awkgram.c" /* yacc.c:1651 */
+#line 3133 "awkgram.c" /* yacc.c:1651 */
break;
case 72:
-#line 1271 "awkgram.y" /* yacc.c:1651 */
+#line 1278 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 3132 "awkgram.c" /* yacc.c:1651 */
+#line 3139 "awkgram.c" /* yacc.c:1651 */
break;
case 73:
-#line 1276 "awkgram.y" /* yacc.c:1651 */
+#line 1283 "awkgram.y" /* yacc.c:1651 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -3145,11 +3152,11 @@ regular_print:
bcfree((yyvsp[-2]));
(yyval) = (yyvsp[-4]);
}
-#line 3149 "awkgram.c" /* yacc.c:1651 */
+#line 3156 "awkgram.c" /* yacc.c:1651 */
break;
case 74:
-#line 1289 "awkgram.y" /* yacc.c:1651 */
+#line 1296 "awkgram.y" /* yacc.c:1651 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -3161,17 +3168,17 @@ regular_print:
(yyvsp[-3])->comment = (yyvsp[-1]);
(yyval) = (yyvsp[-3]);
}
-#line 3165 "awkgram.c" /* yacc.c:1651 */
+#line 3172 "awkgram.c" /* yacc.c:1651 */
break;
case 75:
-#line 1304 "awkgram.y" /* yacc.c:1651 */
+#line 1311 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3171 "awkgram.c" /* yacc.c:1651 */
+#line 3178 "awkgram.c" /* yacc.c:1651 */
break;
case 76:
-#line 1306 "awkgram.y" /* yacc.c:1651 */
+#line 1313 "awkgram.y" /* yacc.c:1651 */
{
NODE *n = (yyvsp[0])->memory;
(void) force_number(n);
@@ -3179,28 +3186,28 @@ regular_print:
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3183 "awkgram.c" /* yacc.c:1651 */
+#line 3190 "awkgram.c" /* yacc.c:1651 */
break;
case 77:
-#line 1314 "awkgram.y" /* yacc.c:1651 */
+#line 1321 "awkgram.y" /* yacc.c:1651 */
{
NODE *n = (yyvsp[0])->lasti->memory;
bcfree((yyvsp[-1]));
add_sign_to_num(n, '+');
(yyval) = (yyvsp[0]);
}
-#line 3194 "awkgram.c" /* yacc.c:1651 */
+#line 3201 "awkgram.c" /* yacc.c:1651 */
break;
case 78:
-#line 1321 "awkgram.y" /* yacc.c:1651 */
+#line 1328 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3200 "awkgram.c" /* yacc.c:1651 */
+#line 3207 "awkgram.c" /* yacc.c:1651 */
break;
case 79:
-#line 1323 "awkgram.y" /* yacc.c:1651 */
+#line 1330 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[0])->memory->type == Node_regex)
(yyvsp[0])->opcode = Op_push_re;
@@ -3208,57 +3215,57 @@ regular_print:
(yyvsp[0])->opcode = Op_push;
(yyval) = (yyvsp[0]);
}
-#line 3212 "awkgram.c" /* yacc.c:1651 */
+#line 3219 "awkgram.c" /* yacc.c:1651 */
break;
case 80:
-#line 1331 "awkgram.y" /* yacc.c:1651 */
+#line 1338 "awkgram.y" /* yacc.c:1651 */
{
assert(((yyvsp[0])->memory->flags & REGEX) == REGEX);
(yyvsp[0])->opcode = Op_push_re;
(yyval) = (yyvsp[0]);
}
-#line 3222 "awkgram.c" /* yacc.c:1651 */
+#line 3229 "awkgram.c" /* yacc.c:1651 */
break;
case 81:
-#line 1340 "awkgram.y" /* yacc.c:1651 */
+#line 1347 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3228 "awkgram.c" /* yacc.c:1651 */
+#line 3235 "awkgram.c" /* yacc.c:1651 */
break;
case 82:
-#line 1342 "awkgram.y" /* yacc.c:1651 */
+#line 1349 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3234 "awkgram.c" /* yacc.c:1651 */
+#line 3241 "awkgram.c" /* yacc.c:1651 */
break;
case 84:
-#line 1352 "awkgram.y" /* yacc.c:1651 */
+#line 1359 "awkgram.y" /* yacc.c:1651 */
{
(yyval) = (yyvsp[-1]);
}
-#line 3242 "awkgram.c" /* yacc.c:1651 */
+#line 3249 "awkgram.c" /* yacc.c:1651 */
break;
case 85:
-#line 1359 "awkgram.y" /* yacc.c:1651 */
+#line 1366 "awkgram.y" /* yacc.c:1651 */
{
in_print = false;
in_parens = 0;
(yyval) = NULL;
}
-#line 3252 "awkgram.c" /* yacc.c:1651 */
+#line 3259 "awkgram.c" /* yacc.c:1651 */
break;
case 86:
-#line 1364 "awkgram.y" /* yacc.c:1651 */
+#line 1371 "awkgram.y" /* yacc.c:1651 */
{ in_print = false; in_parens = 0; }
-#line 3258 "awkgram.c" /* yacc.c:1651 */
+#line 3265 "awkgram.c" /* yacc.c:1651 */
break;
case 87:
-#line 1365 "awkgram.y" /* yacc.c:1651 */
+#line 1372 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[-2])->redir_type == redirect_twoway
&& (yyvsp[0])->lasti->opcode == Op_K_getline_redir
@@ -3268,21 +3275,21 @@ regular_print:
lintwarn(_("concatenation as I/O `>' redirection target
is ambiguous"));
(yyval) = list_prepend((yyvsp[0]), (yyvsp[-2]));
}
-#line 3272 "awkgram.c" /* yacc.c:1651 */
+#line 3279 "awkgram.c" /* yacc.c:1651 */
break;
case 88:
-#line 1378 "awkgram.y" /* yacc.c:1651 */
+#line 1385 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[-1]) != NULL)
(yyvsp[-5])->comment = (yyvsp[-1]);
(yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]),
NULL, NULL);
}
-#line 3282 "awkgram.c" /* yacc.c:1651 */
+#line 3289 "awkgram.c" /* yacc.c:1651 */
break;
case 89:
-#line 1385 "awkgram.y" /* yacc.c:1651 */
+#line 1392 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[-4]) != NULL)
(yyvsp[-8])->comment = (yyvsp[-4]);
@@ -3290,17 +3297,19 @@ regular_print:
(yyvsp[-2])->comment = (yyvsp[-1]);
(yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]),
(yyvsp[-2]), (yyvsp[0]));
}
-#line 3294 "awkgram.c" /* yacc.c:1651 */
+#line 3301 "awkgram.c" /* yacc.c:1651 */
break;
case 90:
-#line 1395 "awkgram.y" /* yacc.c:1651 */
- { (yyval) = (yyvsp[0]); }
-#line 3300 "awkgram.c" /* yacc.c:1651 */
+#line 1403 "awkgram.y" /* yacc.c:1651 */
+ {
+ (yyval) = (yyvsp[0]);
+ }
+#line 3309 "awkgram.c" /* yacc.c:1651 */
break;
case 91:
-#line 1397 "awkgram.y" /* yacc.c:1651 */
+#line 1407 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[-1]) != NULL && (yyvsp[0]) != NULL) {
if ((yyvsp[-1])->memory->comment_type == EOL_COMMENT) {
@@ -3318,59 +3327,59 @@ regular_print:
} else
(yyval) = NULL;
}
-#line 3322 "awkgram.c" /* yacc.c:1651 */
+#line 3331 "awkgram.c" /* yacc.c:1651 */
break;
case 92:
-#line 1418 "awkgram.y" /* yacc.c:1651 */
+#line 1428 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 3328 "awkgram.c" /* yacc.c:1651 */
+#line 3337 "awkgram.c" /* yacc.c:1651 */
break;
case 93:
-#line 1420 "awkgram.y" /* yacc.c:1651 */
+#line 1430 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3334 "awkgram.c" /* yacc.c:1651 */
+#line 3343 "awkgram.c" /* yacc.c:1651 */
break;
case 94:
-#line 1425 "awkgram.y" /* yacc.c:1651 */
+#line 1435 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 3340 "awkgram.c" /* yacc.c:1651 */
+#line 3349 "awkgram.c" /* yacc.c:1651 */
break;
case 95:
-#line 1427 "awkgram.y" /* yacc.c:1651 */
+#line 1437 "awkgram.y" /* yacc.c:1651 */
{
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3349 "awkgram.c" /* yacc.c:1651 */
+#line 3358 "awkgram.c" /* yacc.c:1651 */
break;
case 96:
-#line 1435 "awkgram.y" /* yacc.c:1651 */
+#line 1445 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 3355 "awkgram.c" /* yacc.c:1651 */
+#line 3364 "awkgram.c" /* yacc.c:1651 */
break;
case 97:
-#line 1437 "awkgram.y" /* yacc.c:1651 */
+#line 1447 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3361 "awkgram.c" /* yacc.c:1651 */
+#line 3370 "awkgram.c" /* yacc.c:1651 */
break;
case 98:
-#line 1442 "awkgram.y" /* yacc.c:1651 */
+#line 1452 "awkgram.y" /* yacc.c:1651 */
{
(yyvsp[0])->param_count = 0;
(yyval) = list_create((yyvsp[0]));
}
-#line 3370 "awkgram.c" /* yacc.c:1651 */
+#line 3379 "awkgram.c" /* yacc.c:1651 */
break;
case 99:
-#line 1447 "awkgram.y" /* yacc.c:1651 */
+#line 1457 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[-2]) != NULL && (yyvsp[0]) != NULL) {
(yyvsp[0])->param_count =
(yyvsp[-2])->lasti->param_count + 1;
@@ -3387,76 +3396,76 @@ regular_print:
} else
(yyval) = NULL;
}
-#line 3391 "awkgram.c" /* yacc.c:1651 */
+#line 3400 "awkgram.c" /* yacc.c:1651 */
break;
case 100:
-#line 1464 "awkgram.y" /* yacc.c:1651 */
+#line 1474 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 3397 "awkgram.c" /* yacc.c:1651 */
+#line 3406 "awkgram.c" /* yacc.c:1651 */
break;
case 101:
-#line 1466 "awkgram.y" /* yacc.c:1651 */
+#line 1476 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[-1]); }
-#line 3403 "awkgram.c" /* yacc.c:1651 */
+#line 3412 "awkgram.c" /* yacc.c:1651 */
break;
case 102:
-#line 1468 "awkgram.y" /* yacc.c:1651 */
+#line 1478 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[-2]); }
-#line 3409 "awkgram.c" /* yacc.c:1651 */
+#line 3418 "awkgram.c" /* yacc.c:1651 */
break;
case 103:
-#line 1474 "awkgram.y" /* yacc.c:1651 */
+#line 1484 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 3415 "awkgram.c" /* yacc.c:1651 */
+#line 3424 "awkgram.c" /* yacc.c:1651 */
break;
case 104:
-#line 1476 "awkgram.y" /* yacc.c:1651 */
+#line 1486 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3421 "awkgram.c" /* yacc.c:1651 */
+#line 3430 "awkgram.c" /* yacc.c:1651 */
break;
case 105:
-#line 1481 "awkgram.y" /* yacc.c:1651 */
+#line 1491 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 3427 "awkgram.c" /* yacc.c:1651 */
+#line 3436 "awkgram.c" /* yacc.c:1651 */
break;
case 106:
-#line 1483 "awkgram.y" /* yacc.c:1651 */
+#line 1493 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3433 "awkgram.c" /* yacc.c:1651 */
+#line 3442 "awkgram.c" /* yacc.c:1651 */
break;
case 107:
-#line 1488 "awkgram.y" /* yacc.c:1651 */
+#line 1498 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3439 "awkgram.c" /* yacc.c:1651 */
+#line 3448 "awkgram.c" /* yacc.c:1651 */
break;
case 108:
-#line 1490 "awkgram.y" /* yacc.c:1651 */
+#line 1500 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[-1]) != NULL)
(yyvsp[-2])->lasti->comment = (yyvsp[-1]);
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3450 "awkgram.c" /* yacc.c:1651 */
+#line 3459 "awkgram.c" /* yacc.c:1651 */
break;
case 109:
-#line 1497 "awkgram.y" /* yacc.c:1651 */
+#line 1507 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 3456 "awkgram.c" /* yacc.c:1651 */
+#line 3465 "awkgram.c" /* yacc.c:1651 */
break;
case 110:
-#line 1499 "awkgram.y" /* yacc.c:1651 */
+#line 1509 "awkgram.y" /* yacc.c:1651 */
{
/*
* Returning the expression list instead of NULL lets
@@ -3464,66 +3473,66 @@ regular_print:
*/
(yyval) = (yyvsp[-1]);
}
-#line 3468 "awkgram.c" /* yacc.c:1651 */
+#line 3477 "awkgram.c" /* yacc.c:1651 */
break;
case 111:
-#line 1507 "awkgram.y" /* yacc.c:1651 */
+#line 1517 "awkgram.y" /* yacc.c:1651 */
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3477 "awkgram.c" /* yacc.c:1651 */
+#line 3486 "awkgram.c" /* yacc.c:1651 */
break;
case 112:
-#line 1512 "awkgram.y" /* yacc.c:1651 */
+#line 1522 "awkgram.y" /* yacc.c:1651 */
{
/* Ditto */
if ((yyvsp[-1]) != NULL)
(yyvsp[-2])->lasti->comment = (yyvsp[-1]);
(yyval) = (yyvsp[-2]);
}
-#line 3488 "awkgram.c" /* yacc.c:1651 */
+#line 3497 "awkgram.c" /* yacc.c:1651 */
break;
case 113:
-#line 1522 "awkgram.y" /* yacc.c:1651 */
+#line 1532 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 3494 "awkgram.c" /* yacc.c:1651 */
+#line 3503 "awkgram.c" /* yacc.c:1651 */
break;
case 114:
-#line 1524 "awkgram.y" /* yacc.c:1651 */
+#line 1534 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3500 "awkgram.c" /* yacc.c:1651 */
+#line 3509 "awkgram.c" /* yacc.c:1651 */
break;
case 115:
-#line 1529 "awkgram.y" /* yacc.c:1651 */
+#line 1539 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3506 "awkgram.c" /* yacc.c:1651 */
+#line 3515 "awkgram.c" /* yacc.c:1651 */
break;
case 116:
-#line 1531 "awkgram.y" /* yacc.c:1651 */
+#line 1541 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[-1]) != NULL)
(yyvsp[-2])->lasti->comment = (yyvsp[-1]);
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3517 "awkgram.c" /* yacc.c:1651 */
+#line 3526 "awkgram.c" /* yacc.c:1651 */
break;
case 117:
-#line 1538 "awkgram.y" /* yacc.c:1651 */
+#line 1548 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 3523 "awkgram.c" /* yacc.c:1651 */
+#line 3532 "awkgram.c" /* yacc.c:1651 */
break;
case 118:
-#line 1540 "awkgram.y" /* yacc.c:1651 */
+#line 1550 "awkgram.y" /* yacc.c:1651 */
{
/*
* Returning the expression list instead of NULL lets
@@ -3531,74 +3540,74 @@ regular_print:
*/
(yyval) = (yyvsp[-1]);
}
-#line 3535 "awkgram.c" /* yacc.c:1651 */
+#line 3544 "awkgram.c" /* yacc.c:1651 */
break;
case 119:
-#line 1548 "awkgram.y" /* yacc.c:1651 */
+#line 1558 "awkgram.y" /* yacc.c:1651 */
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3544 "awkgram.c" /* yacc.c:1651 */
+#line 3553 "awkgram.c" /* yacc.c:1651 */
break;
case 120:
-#line 1553 "awkgram.y" /* yacc.c:1651 */
+#line 1563 "awkgram.y" /* yacc.c:1651 */
{
/* Ditto */
if ((yyvsp[-1]) != NULL)
(yyvsp[-2])->comment = (yyvsp[-1]);
(yyval) = (yyvsp[-2]);
}
-#line 3555 "awkgram.c" /* yacc.c:1651 */
+#line 3564 "awkgram.c" /* yacc.c:1651 */
break;
case 121:
-#line 1562 "awkgram.y" /* yacc.c:1651 */
+#line 1572 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3561 "awkgram.c" /* yacc.c:1651 */
+#line 3570 "awkgram.c" /* yacc.c:1651 */
break;
case 122:
-#line 1563 "awkgram.y" /* yacc.c:1651 */
+#line 1573 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = list_create((yyvsp[0])); }
-#line 3567 "awkgram.c" /* yacc.c:1651 */
+#line 3576 "awkgram.c" /* yacc.c:1651 */
break;
case 123:
-#line 1569 "awkgram.y" /* yacc.c:1651 */
+#line 1579 "awkgram.y" /* yacc.c:1651 */
{
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 3578 "awkgram.c" /* yacc.c:1651 */
+#line 3587 "awkgram.c" /* yacc.c:1651 */
break;
case 124:
-#line 1576 "awkgram.y" /* yacc.c:1651 */
+#line 1586 "awkgram.y" /* yacc.c:1651 */
{
(yyval) = mk_assignment((yyvsp[-2]), list_create((yyvsp[0])),
(yyvsp[-1]));
}
-#line 3586 "awkgram.c" /* yacc.c:1651 */
+#line 3595 "awkgram.c" /* yacc.c:1651 */
break;
case 125:
-#line 1580 "awkgram.y" /* yacc.c:1651 */
+#line 1590 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3592 "awkgram.c" /* yacc.c:1651 */
+#line 3601 "awkgram.c" /* yacc.c:1651 */
break;
case 126:
-#line 1582 "awkgram.y" /* yacc.c:1651 */
+#line 1592 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3598 "awkgram.c" /* yacc.c:1651 */
+#line 3607 "awkgram.c" /* yacc.c:1651 */
break;
case 127:
-#line 1584 "awkgram.y" /* yacc.c:1651 */
+#line 1594 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[-2])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[-1])->source_line,
@@ -3611,11 +3620,11 @@ regular_print:
bcfree((yyvsp[0]));
(yyval) = list_append((yyvsp[-2]), (yyvsp[-1]));
}
-#line 3615 "awkgram.c" /* yacc.c:1651 */
+#line 3624 "awkgram.c" /* yacc.c:1651 */
break;
case 128:
-#line 1597 "awkgram.y" /* yacc.c:1651 */
+#line 1607 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[-2])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[-1])->source_line,
@@ -3632,11 +3641,11 @@ regular_print:
(yyval) = list_append(list_merge((yyvsp[-2]),
(yyvsp[0])), (yyvsp[-1]));
}
}
-#line 3636 "awkgram.c" /* yacc.c:1651 */
+#line 3645 "awkgram.c" /* yacc.c:1651 */
break;
case 129:
-#line 1614 "awkgram.y" /* yacc.c:1651 */
+#line 1624 "awkgram.y" /* yacc.c:1651 */
{
if (do_lint_old)
warning_ln((yyvsp[-1])->source_line,
@@ -3646,91 +3655,91 @@ regular_print:
(yyvsp[-1])->expr_count = 1;
(yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])),
(yyvsp[-1]));
}
-#line 3650 "awkgram.c" /* yacc.c:1651 */
+#line 3659 "awkgram.c" /* yacc.c:1651 */
break;
case 130:
-#line 1624 "awkgram.y" /* yacc.c:1651 */
+#line 1634 "awkgram.y" /* yacc.c:1651 */
{
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 3661 "awkgram.c" /* yacc.c:1651 */
+#line 3670 "awkgram.c" /* yacc.c:1651 */
break;
case 131:
-#line 1631 "awkgram.y" /* yacc.c:1651 */
+#line 1641 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]),
(yyvsp[-1]), (yyvsp[0])); }
-#line 3667 "awkgram.c" /* yacc.c:1651 */
+#line 3676 "awkgram.c" /* yacc.c:1651 */
break;
case 132:
-#line 1633 "awkgram.y" /* yacc.c:1651 */
+#line 1643 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3673 "awkgram.c" /* yacc.c:1651 */
+#line 3682 "awkgram.c" /* yacc.c:1651 */
break;
case 133:
-#line 1638 "awkgram.y" /* yacc.c:1651 */
+#line 1648 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3679 "awkgram.c" /* yacc.c:1651 */
+#line 3688 "awkgram.c" /* yacc.c:1651 */
break;
case 134:
-#line 1640 "awkgram.y" /* yacc.c:1651 */
+#line 1650 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3685 "awkgram.c" /* yacc.c:1651 */
+#line 3694 "awkgram.c" /* yacc.c:1651 */
break;
case 135:
-#line 1642 "awkgram.y" /* yacc.c:1651 */
+#line 1652 "awkgram.y" /* yacc.c:1651 */
{
(yyvsp[0])->opcode = Op_assign_quotient;
(yyval) = (yyvsp[0]);
}
-#line 3694 "awkgram.c" /* yacc.c:1651 */
+#line 3703 "awkgram.c" /* yacc.c:1651 */
break;
case 136:
-#line 1650 "awkgram.y" /* yacc.c:1651 */
+#line 1660 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3700 "awkgram.c" /* yacc.c:1651 */
+#line 3709 "awkgram.c" /* yacc.c:1651 */
break;
case 137:
-#line 1652 "awkgram.y" /* yacc.c:1651 */
+#line 1662 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3706 "awkgram.c" /* yacc.c:1651 */
+#line 3715 "awkgram.c" /* yacc.c:1651 */
break;
case 138:
-#line 1657 "awkgram.y" /* yacc.c:1651 */
+#line 1667 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3712 "awkgram.c" /* yacc.c:1651 */
+#line 3721 "awkgram.c" /* yacc.c:1651 */
break;
case 139:
-#line 1659 "awkgram.y" /* yacc.c:1651 */
+#line 1669 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3718 "awkgram.c" /* yacc.c:1651 */
+#line 3727 "awkgram.c" /* yacc.c:1651 */
break;
case 140:
-#line 1664 "awkgram.y" /* yacc.c:1651 */
+#line 1674 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3724 "awkgram.c" /* yacc.c:1651 */
+#line 3733 "awkgram.c" /* yacc.c:1651 */
break;
case 141:
-#line 1666 "awkgram.y" /* yacc.c:1651 */
+#line 1676 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 3730 "awkgram.c" /* yacc.c:1651 */
+#line 3739 "awkgram.c" /* yacc.c:1651 */
break;
case 142:
-#line 1668 "awkgram.y" /* yacc.c:1651 */
+#line 1678 "awkgram.y" /* yacc.c:1651 */
{
int count = 2;
bool is_simple_var = false;
@@ -3784,47 +3793,47 @@ regular_print:
max_args = count;
}
}
-#line 3788 "awkgram.c" /* yacc.c:1651 */
+#line 3797 "awkgram.c" /* yacc.c:1651 */
break;
case 144:
-#line 1727 "awkgram.y" /* yacc.c:1651 */
+#line 1737 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3794 "awkgram.c" /* yacc.c:1651 */
+#line 3803 "awkgram.c" /* yacc.c:1651 */
break;
case 145:
-#line 1729 "awkgram.y" /* yacc.c:1651 */
+#line 1739 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3800 "awkgram.c" /* yacc.c:1651 */
+#line 3809 "awkgram.c" /* yacc.c:1651 */
break;
case 146:
-#line 1731 "awkgram.y" /* yacc.c:1651 */
+#line 1741 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3806 "awkgram.c" /* yacc.c:1651 */
+#line 3815 "awkgram.c" /* yacc.c:1651 */
break;
case 147:
-#line 1733 "awkgram.y" /* yacc.c:1651 */
+#line 1743 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3812 "awkgram.c" /* yacc.c:1651 */
+#line 3821 "awkgram.c" /* yacc.c:1651 */
break;
case 148:
-#line 1735 "awkgram.y" /* yacc.c:1651 */
+#line 1745 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3818 "awkgram.c" /* yacc.c:1651 */
+#line 3827 "awkgram.c" /* yacc.c:1651 */
break;
case 149:
-#line 1737 "awkgram.y" /* yacc.c:1651 */
+#line 1747 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3824 "awkgram.c" /* yacc.c:1651 */
+#line 3833 "awkgram.c" /* yacc.c:1651 */
break;
case 150:
-#line 1739 "awkgram.y" /* yacc.c:1651 */
+#line 1749 "awkgram.y" /* yacc.c:1651 */
{
/*
* In BEGINFILE/ENDFILE, allow `getline [var] < file'
@@ -3838,29 +3847,29 @@ regular_print:
_("non-redirected `getline' undefined inside
END action"));
(yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]),
redirect_input);
}
-#line 3842 "awkgram.c" /* yacc.c:1651 */
+#line 3851 "awkgram.c" /* yacc.c:1651 */
break;
case 151:
-#line 1753 "awkgram.y" /* yacc.c:1651 */
+#line 1763 "awkgram.y" /* yacc.c:1651 */
{
(yyvsp[0])->opcode = Op_postincrement;
(yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3851 "awkgram.c" /* yacc.c:1651 */
+#line 3860 "awkgram.c" /* yacc.c:1651 */
break;
case 152:
-#line 1758 "awkgram.y" /* yacc.c:1651 */
+#line 1768 "awkgram.y" /* yacc.c:1651 */
{
(yyvsp[0])->opcode = Op_postdecrement;
(yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3860 "awkgram.c" /* yacc.c:1651 */
+#line 3869 "awkgram.c" /* yacc.c:1651 */
break;
case 153:
-#line 1763 "awkgram.y" /* yacc.c:1651 */
+#line 1773 "awkgram.y" /* yacc.c:1651 */
{
if (do_lint_old) {
warning_ln((yyvsp[-1])->source_line,
@@ -3880,64 +3889,64 @@ regular_print:
(yyval) = list_append(list_merge(t, (yyvsp[0])),
(yyvsp[-1]));
}
}
-#line 3884 "awkgram.c" /* yacc.c:1651 */
+#line 3893 "awkgram.c" /* yacc.c:1651 */
break;
case 154:
-#line 1788 "awkgram.y" /* yacc.c:1651 */
+#line 1798 "awkgram.y" /* yacc.c:1651 */
{
(yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]),
(yyvsp[-2])->redir_type);
bcfree((yyvsp[-2]));
}
-#line 3893 "awkgram.c" /* yacc.c:1651 */
+#line 3902 "awkgram.c" /* yacc.c:1651 */
break;
case 155:
-#line 1794 "awkgram.y" /* yacc.c:1651 */
+#line 1804 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3899 "awkgram.c" /* yacc.c:1651 */
+#line 3908 "awkgram.c" /* yacc.c:1651 */
break;
case 156:
-#line 1796 "awkgram.y" /* yacc.c:1651 */
+#line 1806 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3905 "awkgram.c" /* yacc.c:1651 */
+#line 3914 "awkgram.c" /* yacc.c:1651 */
break;
case 157:
-#line 1798 "awkgram.y" /* yacc.c:1651 */
+#line 1808 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3911 "awkgram.c" /* yacc.c:1651 */
+#line 3920 "awkgram.c" /* yacc.c:1651 */
break;
case 158:
-#line 1800 "awkgram.y" /* yacc.c:1651 */
+#line 1810 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3917 "awkgram.c" /* yacc.c:1651 */
+#line 3926 "awkgram.c" /* yacc.c:1651 */
break;
case 159:
-#line 1802 "awkgram.y" /* yacc.c:1651 */
+#line 1812 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3923 "awkgram.c" /* yacc.c:1651 */
+#line 3932 "awkgram.c" /* yacc.c:1651 */
break;
case 160:
-#line 1804 "awkgram.y" /* yacc.c:1651 */
+#line 1814 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3929 "awkgram.c" /* yacc.c:1651 */
+#line 3938 "awkgram.c" /* yacc.c:1651 */
break;
case 161:
-#line 1809 "awkgram.y" /* yacc.c:1651 */
+#line 1819 "awkgram.y" /* yacc.c:1651 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3937 "awkgram.c" /* yacc.c:1651 */
+#line 3946 "awkgram.c" /* yacc.c:1651 */
break;
case 162:
-#line 1813 "awkgram.y" /* yacc.c:1651 */
+#line 1823 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[0])->opcode == Op_match_rec) {
(yyvsp[0])->opcode = Op_nomatch;
@@ -3969,11 +3978,11 @@ regular_print:
}
}
}
-#line 3973 "awkgram.c" /* yacc.c:1651 */
+#line 3982 "awkgram.c" /* yacc.c:1651 */
break;
case 163:
-#line 1845 "awkgram.y" /* yacc.c:1651 */
+#line 1855 "awkgram.y" /* yacc.c:1651 */
{
// Always include. Allows us to lint warn on
// print "foo" > "bar" 1
@@ -3981,31 +3990,31 @@ regular_print:
// print "foo" > ("bar" 1)
(yyval) = list_append((yyvsp[-1]), bcalloc(Op_parens, 1,
sourceline));
}
-#line 3985 "awkgram.c" /* yacc.c:1651 */
+#line 3994 "awkgram.c" /* yacc.c:1651 */
break;
case 164:
-#line 1853 "awkgram.y" /* yacc.c:1651 */
+#line 1863 "awkgram.y" /* yacc.c:1651 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3995 "awkgram.c" /* yacc.c:1651 */
+#line 4004 "awkgram.c" /* yacc.c:1651 */
break;
case 165:
-#line 1859 "awkgram.y" /* yacc.c:1651 */
+#line 1869 "awkgram.y" /* yacc.c:1651 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 4005 "awkgram.c" /* yacc.c:1651 */
+#line 4014 "awkgram.c" /* yacc.c:1651 */
break;
case 166:
-#line 1865 "awkgram.y" /* yacc.c:1651 */
+#line 1875 "awkgram.y" /* yacc.c:1651 */
{
static bool warned = false;
@@ -4018,45 +4027,45 @@ regular_print:
if ((yyval) == NULL)
YYABORT;
}
-#line 4022 "awkgram.c" /* yacc.c:1651 */
+#line 4031 "awkgram.c" /* yacc.c:1651 */
break;
case 169:
-#line 1880 "awkgram.y" /* yacc.c:1651 */
+#line 1890 "awkgram.y" /* yacc.c:1651 */
{
(yyvsp[-1])->opcode = Op_preincrement;
(yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1]));
}
-#line 4031 "awkgram.c" /* yacc.c:1651 */
+#line 4040 "awkgram.c" /* yacc.c:1651 */
break;
case 170:
-#line 1885 "awkgram.y" /* yacc.c:1651 */
+#line 1895 "awkgram.y" /* yacc.c:1651 */
{
(yyvsp[-1])->opcode = Op_predecrement;
(yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1]));
}
-#line 4040 "awkgram.c" /* yacc.c:1651 */
+#line 4049 "awkgram.c" /* yacc.c:1651 */
break;
case 171:
-#line 1890 "awkgram.y" /* yacc.c:1651 */
+#line 1900 "awkgram.y" /* yacc.c:1651 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 4048 "awkgram.c" /* yacc.c:1651 */
+#line 4057 "awkgram.c" /* yacc.c:1651 */
break;
case 172:
-#line 1894 "awkgram.y" /* yacc.c:1651 */
+#line 1904 "awkgram.y" /* yacc.c:1651 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 4056 "awkgram.c" /* yacc.c:1651 */
+#line 4065 "awkgram.c" /* yacc.c:1651 */
break;
case 173:
-#line 1898 "awkgram.y" /* yacc.c:1651 */
+#line 1908 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[0])->lasti->opcode == Op_push_i
&& ((yyvsp[0])->lasti->memory->flags & STRING) == 0
@@ -4071,11 +4080,11 @@ regular_print:
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
}
-#line 4075 "awkgram.c" /* yacc.c:1651 */
+#line 4084 "awkgram.c" /* yacc.c:1651 */
break;
case 174:
-#line 1913 "awkgram.y" /* yacc.c:1651 */
+#line 1923 "awkgram.y" /* yacc.c:1651 */
{
if ((yyvsp[0])->lasti->opcode == Op_push_i
&& ((yyvsp[0])->lasti->memory->flags & STRING) == 0
@@ -4093,20 +4102,20 @@ regular_print:
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
}
-#line 4097 "awkgram.c" /* yacc.c:1651 */
+#line 4106 "awkgram.c" /* yacc.c:1651 */
break;
case 175:
-#line 1934 "awkgram.y" /* yacc.c:1651 */
+#line 1944 "awkgram.y" /* yacc.c:1651 */
{
func_use((yyvsp[0])->lasti->func_name, FUNC_USE);
(yyval) = (yyvsp[0]);
}
-#line 4106 "awkgram.c" /* yacc.c:1651 */
+#line 4115 "awkgram.c" /* yacc.c:1651 */
break;
case 176:
-#line 1939 "awkgram.y" /* yacc.c:1651 */
+#line 1949 "awkgram.y" /* yacc.c:1651 */
{
/* indirect function call */
INSTRUCTION *f, *t;
@@ -4140,11 +4149,11 @@ regular_print:
(yyval) = list_prepend((yyvsp[0]), t);
at_seen = false;
}
-#line 4144 "awkgram.c" /* yacc.c:1651 */
+#line 4153 "awkgram.c" /* yacc.c:1651 */
break;
case 177:
-#line 1976 "awkgram.y" /* yacc.c:1651 */
+#line 1986 "awkgram.y" /* yacc.c:1651 */
{
NODE *n;
@@ -4169,49 +4178,49 @@ regular_print:
(yyval) = list_append(t, (yyvsp[-3]));
}
}
-#line 4173 "awkgram.c" /* yacc.c:1651 */
+#line 4182 "awkgram.c" /* yacc.c:1651 */
break;
case 178:
-#line 2004 "awkgram.y" /* yacc.c:1651 */
+#line 2014 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 4179 "awkgram.c" /* yacc.c:1651 */
+#line 4188 "awkgram.c" /* yacc.c:1651 */
break;
case 179:
-#line 2006 "awkgram.y" /* yacc.c:1651 */
+#line 2016 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 4185 "awkgram.c" /* yacc.c:1651 */
+#line 4194 "awkgram.c" /* yacc.c:1651 */
break;
case 180:
-#line 2011 "awkgram.y" /* yacc.c:1651 */
+#line 2021 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 4191 "awkgram.c" /* yacc.c:1651 */
+#line 4200 "awkgram.c" /* yacc.c:1651 */
break;
case 181:
-#line 2013 "awkgram.y" /* yacc.c:1651 */
+#line 2023 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[-1]); }
-#line 4197 "awkgram.c" /* yacc.c:1651 */
+#line 4206 "awkgram.c" /* yacc.c:1651 */
break;
case 182:
-#line 2018 "awkgram.y" /* yacc.c:1651 */
+#line 2028 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 4203 "awkgram.c" /* yacc.c:1651 */
+#line 4212 "awkgram.c" /* yacc.c:1651 */
break;
case 183:
-#line 2020 "awkgram.y" /* yacc.c:1651 */
+#line 2030 "awkgram.y" /* yacc.c:1651 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 4211 "awkgram.c" /* yacc.c:1651 */
+#line 4220 "awkgram.c" /* yacc.c:1651 */
break;
case 184:
-#line 2027 "awkgram.y" /* yacc.c:1651 */
+#line 2037 "awkgram.y" /* yacc.c:1651 */
{
INSTRUCTION *ip = (yyvsp[0])->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated
expressions */
@@ -4225,11 +4234,11 @@ regular_print:
sub_counter++; /* count # of dimensions */
(yyval) = (yyvsp[0]);
}
-#line 4229 "awkgram.c" /* yacc.c:1651 */
+#line 4238 "awkgram.c" /* yacc.c:1651 */
break;
case 185:
-#line 2044 "awkgram.y" /* yacc.c:1651 */
+#line 2054 "awkgram.y" /* yacc.c:1651 */
{
INSTRUCTION *t = (yyvsp[-1]);
if ((yyvsp[-1]) == NULL) {
@@ -4243,31 +4252,31 @@ regular_print:
(yyvsp[0])->sub_count = count_expressions(&t, false);
(yyval) = list_append(t, (yyvsp[0]));
}
-#line 4247 "awkgram.c" /* yacc.c:1651 */
+#line 4256 "awkgram.c" /* yacc.c:1651 */
break;
case 186:
-#line 2061 "awkgram.y" /* yacc.c:1651 */
+#line 2071 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 4253 "awkgram.c" /* yacc.c:1651 */
+#line 4262 "awkgram.c" /* yacc.c:1651 */
break;
case 187:
-#line 2063 "awkgram.y" /* yacc.c:1651 */
+#line 2073 "awkgram.y" /* yacc.c:1651 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 4261 "awkgram.c" /* yacc.c:1651 */
+#line 4270 "awkgram.c" /* yacc.c:1651 */
break;
case 188:
-#line 2070 "awkgram.y" /* yacc.c:1651 */
+#line 2080 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[-1]); }
-#line 4267 "awkgram.c" /* yacc.c:1651 */
+#line 4276 "awkgram.c" /* yacc.c:1651 */
break;
case 189:
-#line 2075 "awkgram.y" /* yacc.c:1651 */
+#line 2085 "awkgram.y" /* yacc.c:1651 */
{
char *var_name = (yyvsp[0])->lextok;
@@ -4275,22 +4284,22 @@ regular_print:
(yyvsp[0])->memory = variable((yyvsp[0])->source_line,
var_name, Node_var_new);
(yyval) = list_create((yyvsp[0]));
}
-#line 4279 "awkgram.c" /* yacc.c:1651 */
+#line 4288 "awkgram.c" /* yacc.c:1651 */
break;
case 190:
-#line 2083 "awkgram.y" /* yacc.c:1651 */
+#line 2093 "awkgram.y" /* yacc.c:1651 */
{
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 4290 "awkgram.c" /* yacc.c:1651 */
+#line 4299 "awkgram.c" /* yacc.c:1651 */
break;
case 191:
-#line 2093 "awkgram.y" /* yacc.c:1651 */
+#line 2103 "awkgram.y" /* yacc.c:1651 */
{
INSTRUCTION *ip = (yyvsp[0])->nexti;
if (ip->opcode == Op_push
@@ -4302,85 +4311,85 @@ regular_print:
} else
(yyval) = (yyvsp[0]);
}
-#line 4306 "awkgram.c" /* yacc.c:1651 */
+#line 4315 "awkgram.c" /* yacc.c:1651 */
break;
case 192:
-#line 2105 "awkgram.y" /* yacc.c:1651 */
+#line 2115 "awkgram.y" /* yacc.c:1651 */
{
(yyval) = list_append((yyvsp[-1]), (yyvsp[-2]));
if ((yyvsp[0]) != NULL)
mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 4316 "awkgram.c" /* yacc.c:1651 */
+#line 4325 "awkgram.c" /* yacc.c:1651 */
break;
case 193:
-#line 2114 "awkgram.y" /* yacc.c:1651 */
+#line 2124 "awkgram.y" /* yacc.c:1651 */
{
(yyvsp[0])->opcode = Op_postincrement;
}
-#line 4324 "awkgram.c" /* yacc.c:1651 */
+#line 4333 "awkgram.c" /* yacc.c:1651 */
break;
case 194:
-#line 2118 "awkgram.y" /* yacc.c:1651 */
+#line 2128 "awkgram.y" /* yacc.c:1651 */
{
(yyvsp[0])->opcode = Op_postdecrement;
}
-#line 4332 "awkgram.c" /* yacc.c:1651 */
+#line 4341 "awkgram.c" /* yacc.c:1651 */
break;
case 195:
-#line 2122 "awkgram.y" /* yacc.c:1651 */
+#line 2132 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 4338 "awkgram.c" /* yacc.c:1651 */
+#line 4347 "awkgram.c" /* yacc.c:1651 */
break;
case 196:
-#line 2126 "awkgram.y" /* yacc.c:1651 */
+#line 2136 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); }
-#line 4344 "awkgram.c" /* yacc.c:1651 */
+#line 4353 "awkgram.c" /* yacc.c:1651 */
break;
case 197:
-#line 2130 "awkgram.y" /* yacc.c:1651 */
+#line 2140 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); yyerrok; }
-#line 4350 "awkgram.c" /* yacc.c:1651 */
+#line 4359 "awkgram.c" /* yacc.c:1651 */
break;
case 198:
-#line 2134 "awkgram.y" /* yacc.c:1651 */
+#line 2144 "awkgram.y" /* yacc.c:1651 */
{ yyerrok; }
-#line 4356 "awkgram.c" /* yacc.c:1651 */
+#line 4365 "awkgram.c" /* yacc.c:1651 */
break;
case 199:
-#line 2139 "awkgram.y" /* yacc.c:1651 */
+#line 2149 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = NULL; }
-#line 4362 "awkgram.c" /* yacc.c:1651 */
+#line 4371 "awkgram.c" /* yacc.c:1651 */
break;
case 201:
-#line 2144 "awkgram.y" /* yacc.c:1651 */
+#line 2154 "awkgram.y" /* yacc.c:1651 */
{ yyerrok; }
-#line 4368 "awkgram.c" /* yacc.c:1651 */
+#line 4377 "awkgram.c" /* yacc.c:1651 */
break;
case 202:
-#line 2148 "awkgram.y" /* yacc.c:1651 */
+#line 2158 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); yyerrok; }
-#line 4374 "awkgram.c" /* yacc.c:1651 */
+#line 4383 "awkgram.c" /* yacc.c:1651 */
break;
case 203:
-#line 2152 "awkgram.y" /* yacc.c:1651 */
+#line 2162 "awkgram.y" /* yacc.c:1651 */
{ (yyval) = (yyvsp[0]); yyerrok; }
-#line 4380 "awkgram.c" /* yacc.c:1651 */
+#line 4389 "awkgram.c" /* yacc.c:1651 */
break;
-#line 4384 "awkgram.c" /* yacc.c:1651 */
+#line 4393 "awkgram.c" /* yacc.c:1651 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -4608,7 +4617,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 2154 "awkgram.y" /* yacc.c:1910 */
+#line 2164 "awkgram.y" /* yacc.c:1910 */
struct token {
@@ -5047,6 +5056,18 @@ mk_program()
cp = end_block;
else
cp = list_merge(begin_block, end_block);
+
+
+ if (outer_comment != NULL) {
+ (void) list_prepend(cp, outer_comment);
+ outer_comment = NULL;
+ }
+
+ if (trailing_comment != NULL) {
+ (void) list_append(cp, trailing_comment);
+ trailing_comment = NULL;
+ }
+
(void) list_append(cp, ip_atexit);
(void) list_append(cp, instruction(Op_stop));
diff --git a/awkgram.y b/awkgram.y
index 9373543..55b4eb8 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -1,12 +1,7 @@
-/* working on statement_term and opt_nls */
/*
TODO:
-- Handle comments outside blocks
--- Handle EOL comments on a closing right brace
--- Get comments from all instances of opt_nls
--- Get comments from all instances of l_brace
--- Get comments from all instances of r_brace
--- Review statement lists and handling of statement_term
+-- Put together a big test file
DONE:
-- Get comments from all instances of nls
-- After , in parameter list
@@ -16,8 +11,13 @@ DONE:
-- After && and ||
-- case part of switch statement
-- for(;;) statement
--- for(iggy in fo) statement
+-- for(iggy in foo) statement
-- Comments after commas in expressions lists in print/f and function calls
+-- Handle EOL comments on a closing right brace
+-- Get comments from all instances of opt_nls
+-- Get comments from all instances of l_brace
+-- Get comments from all instances of r_brace
+-- Review statement lists and handling of statement_term
*/
/*
* awkgram.y --- yacc/bison parser
@@ -80,6 +80,7 @@ static void next_sourcefile(void);
static char *tokexpand(void);
static NODE *set_profile_text(NODE *n, const char *str, size_t len);
static INSTRUCTION *trailing_comment;
+static INSTRUCTION *outer_comment;
#define instruction(t) bcalloc(t, 1, 0)
@@ -237,10 +238,13 @@ program
| program nls
{
if ($2 != NULL) {
- merge_comments($2, NULL);
- $$ = list_append(rule_list, $2);
- } else
- $$ = $1;
+ if ($1 == NULL) {
+ outer_comment = $2;
+ } else {
+ trailing_comment = $2;
+ }
+ }
+ $$ = $1;
}
| program LEX_EOF
{
@@ -428,11 +432,14 @@ action
{
INSTRUCTION *ip = make_braced_statements($1, $2, $3);
- if ($3 != NULL)
- ip = list_append(ip, $3);
-
- if ($5 != NULL)
- ip = list_append(ip, $5);
+ if ($3 != NULL && $5 != NULL) {
+ merge_comments($3, $5);
+ trailing_comment = $3;
+ } else if ($3 != NULL) {
+ trailing_comment = $3;
+ } else if ($5 != NULL) {
+ trailing_comment = $5;
+ }
$$ = ip;
}
@@ -1392,7 +1399,10 @@ if_statement
;
nls
- : NEWLINE { $$ = $1; }
+ : NEWLINE
+ {
+ $$ = $1;
+ }
| nls NEWLINE
{
if ($1 != NULL && $2 != NULL) {
@@ -2589,6 +2599,18 @@ mk_program()
cp = end_block;
else
cp = list_merge(begin_block, end_block);
+
+
+ if (outer_comment != NULL) {
+ (void) list_prepend(cp, outer_comment);
+ outer_comment = NULL;
+ }
+
+ if (trailing_comment != NULL) {
+ (void) list_append(cp, trailing_comment);
+ trailing_comment = NULL;
+ }
+
(void) list_append(cp, ip_atexit);
(void) list_append(cp, instruction(Op_stop));
diff --git a/test/ChangeLog b/test/ChangeLog
index 9530e00..f5d3334 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2018-11-11 Arnold D. Robbins <address@hidden>
+
+ * profile10.ok: Updated after code change.
+
2018-10-14 Arnold D. Robbins <address@hidden>
* profile0.ok: Updated after code change.
diff --git a/test/profile10.ok b/test/profile10.ok
index 13f0b67..0f77bd3 100644
--- a/test/profile10.ok
+++ b/test/profile10.ok
@@ -17,14 +17,12 @@ BEGIN { # Comment 0
print "MNO" # Comment 16
} # Comment 17
switch (q) {
- case "a":
- # Comment 18
+ # Comment 18
+ case "a": # Comment 19
case "b":
- # Comment 19
- break # Comment 20
- # Comment 21
- default:
- # Comment 22
+ # Comment 20
+ break # Comment 21
+ default: # Comment 22
break # Comment 23
}
# Comment 24
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 +
awkgram.c | 867 ++++++++++++++++++++++++++++--------------------------
awkgram.y | 56 ++--
test/ChangeLog | 4 +
test/profile10.ok | 12 +-
5 files changed, 498 insertions(+), 447 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, feature/fix-comments, updated. gawk-4.1.0-3518-gac700ec,
Arnold Robbins <=