aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-03-03 22:05:24 +0200
committerArnold D. Robbins <arnold@skeeve.com>2016-03-17 22:02:20 +0200
commit4b33ad392a8ddf1cc480d29498af80f7da1db269 (patch)
tree4fec86680f2e9eabaa4c1db9e5ec3faecdc07004
parentcd6b37514fd3eea9cc26a76514d487328a11a8ba (diff)
downloadegawk-4b33ad392a8ddf1cc480d29498af80f7da1db269.tar.gz
egawk-4b33ad392a8ddf1cc480d29498af80f7da1db269.tar.bz2
egawk-4b33ad392a8ddf1cc480d29498af80f7da1db269.zip
Initial changes to improve end of line comments.
-rw-r--r--awkgram.c853
-rw-r--r--awkgram.y71
-rw-r--r--profile.c55
-rw-r--r--test/profile5.ok348
4 files changed, 856 insertions, 471 deletions
diff --git a/awkgram.c b/awkgram.c
index d50040b3..9b4d4349 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -191,6 +191,8 @@ static INSTRUCTION *ip_beginfile;
INSTRUCTION *main_beginfile;
static INSTRUCTION *comment = NULL;
+static INSTRUCTION *prior_comment = NULL;
+static INSTRUCTION *comment_to_save = NULL;
static INSTRUCTION *program_comment = NULL;
static INSTRUCTION *function_comment = NULL;
static INSTRUCTION *block_comment = NULL;
@@ -202,12 +204,13 @@ static inline INSTRUCTION *list_create(INSTRUCTION *x);
static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x);
static inline INSTRUCTION *list_prepend(INSTRUCTION *l, INSTRUCTION *x);
static inline INSTRUCTION *list_merge(INSTRUCTION *l1, INSTRUCTION *l2);
+static inline INSTRUCTION *add_pending_comment(INSTRUCTION *stmt);
extern double fmod(double x, double y);
#define YYSTYPE INSTRUCTION *
-#line 211 "awkgram.c" /* yacc.c:339 */
+#line 214 "awkgram.c" /* yacc.c:339 */
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
@@ -363,7 +366,7 @@ int yyparse (void);
/* Copy the second part of user declarations. */
-#line 367 "awkgram.c" /* yacc.c:358 */
+#line 370 "awkgram.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -665,27 +668,27 @@ static const yytype_uint8 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 210, 210, 212, 217, 218, 222, 234, 239, 250,
- 257, 263, 272, 280, 282, 287, 295, 297, 303, 311,
- 321, 351, 365, 379, 387, 398, 410, 412, 414, 420,
- 428, 429, 433, 433, 469, 468, 502, 524, 526, 531,
- 537, 565, 570, 571, 575, 577, 579, 586, 676, 718,
- 760, 873, 880, 887, 897, 906, 915, 924, 935, 951,
- 950, 974, 986, 986, 1084, 1084, 1117, 1147, 1153, 1154,
- 1160, 1161, 1168, 1173, 1185, 1199, 1201, 1209, 1214, 1216,
- 1224, 1233, 1235, 1244, 1245, 1253, 1258, 1258, 1269, 1273,
- 1281, 1282, 1285, 1287, 1292, 1293, 1302, 1303, 1308, 1313,
- 1322, 1324, 1326, 1333, 1334, 1340, 1341, 1346, 1348, 1353,
- 1355, 1363, 1368, 1377, 1378, 1383, 1385, 1390, 1392, 1400,
- 1405, 1413, 1414, 1419, 1426, 1430, 1432, 1434, 1447, 1464,
- 1474, 1481, 1483, 1488, 1490, 1492, 1500, 1502, 1507, 1509,
- 1514, 1516, 1518, 1574, 1576, 1578, 1580, 1582, 1584, 1586,
- 1588, 1602, 1607, 1612, 1637, 1643, 1645, 1647, 1649, 1651,
- 1653, 1658, 1662, 1694, 1696, 1702, 1708, 1721, 1722, 1723,
- 1728, 1733, 1737, 1741, 1756, 1769, 1774, 1811, 1840, 1841,
- 1847, 1848, 1853, 1855, 1862, 1879, 1896, 1898, 1905, 1910,
- 1918, 1928, 1940, 1949, 1953, 1957, 1961, 1965, 1969, 1972,
- 1974, 1978, 1982, 1986
+ 0, 213, 213, 215, 220, 221, 225, 237, 242, 253,
+ 260, 266, 275, 283, 285, 290, 298, 300, 306, 314,
+ 324, 354, 368, 382, 390, 401, 413, 415, 417, 423,
+ 431, 432, 436, 436, 481, 480, 514, 536, 538, 543,
+ 549, 577, 582, 583, 587, 589, 591, 598, 688, 730,
+ 772, 885, 892, 899, 910, 920, 930, 940, 952, 969,
+ 968, 993, 1005, 1005, 1104, 1104, 1138, 1169, 1178, 1179,
+ 1185, 1186, 1193, 1198, 1210, 1224, 1226, 1234, 1239, 1241,
+ 1249, 1258, 1260, 1269, 1270, 1278, 1283, 1283, 1294, 1298,
+ 1306, 1307, 1310, 1312, 1317, 1318, 1327, 1328, 1333, 1338,
+ 1347, 1349, 1351, 1358, 1359, 1365, 1366, 1371, 1373, 1378,
+ 1380, 1388, 1393, 1402, 1403, 1408, 1410, 1415, 1417, 1425,
+ 1430, 1438, 1439, 1444, 1451, 1455, 1457, 1459, 1472, 1489,
+ 1499, 1506, 1508, 1513, 1515, 1517, 1525, 1527, 1532, 1534,
+ 1539, 1541, 1543, 1599, 1601, 1603, 1605, 1607, 1609, 1611,
+ 1613, 1627, 1632, 1637, 1662, 1668, 1670, 1672, 1674, 1676,
+ 1678, 1683, 1687, 1719, 1721, 1727, 1733, 1746, 1747, 1748,
+ 1753, 1758, 1762, 1766, 1781, 1794, 1799, 1836, 1865, 1866,
+ 1872, 1873, 1878, 1880, 1887, 1904, 1921, 1923, 1930, 1935,
+ 1943, 1953, 1965, 1974, 1978, 1982, 1986, 1990, 1994, 1997,
+ 1999, 2003, 2007, 2011
};
#endif
@@ -1883,24 +1886,24 @@ yyreduce:
switch (yyn)
{
case 3:
-#line 213 "awkgram.y" /* yacc.c:1646 */
+#line 216 "awkgram.y" /* yacc.c:1646 */
{
rule = 0;
yyerrok;
}
-#line 1892 "awkgram.c" /* yacc.c:1646 */
+#line 1895 "awkgram.c" /* yacc.c:1646 */
break;
case 5:
-#line 219 "awkgram.y" /* yacc.c:1646 */
+#line 222 "awkgram.y" /* yacc.c:1646 */
{
next_sourcefile();
}
-#line 1900 "awkgram.c" /* yacc.c:1646 */
+#line 1903 "awkgram.c" /* yacc.c:1646 */
break;
case 6:
-#line 223 "awkgram.y" /* yacc.c:1646 */
+#line 226 "awkgram.y" /* yacc.c:1646 */
{
rule = 0;
/*
@@ -1909,20 +1912,20 @@ yyreduce:
*/
/* yyerrok; */
}
-#line 1913 "awkgram.c" /* yacc.c:1646 */
+#line 1916 "awkgram.c" /* yacc.c:1646 */
break;
case 7:
-#line 235 "awkgram.y" /* yacc.c:1646 */
+#line 238 "awkgram.y" /* yacc.c:1646 */
{
(void) append_rule((yyvsp[-1]), (yyvsp[0]));
first_rule = false;
}
-#line 1922 "awkgram.c" /* yacc.c:1646 */
+#line 1925 "awkgram.c" /* yacc.c:1646 */
break;
case 8:
-#line 240 "awkgram.y" /* yacc.c:1646 */
+#line 243 "awkgram.y" /* yacc.c:1646 */
{
if (rule != Rule) {
msg(_("%s blocks must have an action part"), ruletab[rule]);
@@ -1933,42 +1936,42 @@ yyreduce:
} else /* pattern rule with non-empty pattern */
(void) append_rule((yyvsp[-1]), NULL);
}
-#line 1937 "awkgram.c" /* yacc.c:1646 */
+#line 1940 "awkgram.c" /* yacc.c:1646 */
break;
case 9:
-#line 251 "awkgram.y" /* yacc.c:1646 */
+#line 254 "awkgram.y" /* yacc.c:1646 */
{
in_function = NULL;
(void) mk_function((yyvsp[-1]), (yyvsp[0]));
want_param_names = DONT_CHECK;
yyerrok;
}
-#line 1948 "awkgram.c" /* yacc.c:1646 */
+#line 1951 "awkgram.c" /* yacc.c:1646 */
break;
case 10:
-#line 258 "awkgram.y" /* yacc.c:1646 */
+#line 261 "awkgram.y" /* yacc.c:1646 */
{
want_source = false;
at_seen = false;
yyerrok;
}
-#line 1958 "awkgram.c" /* yacc.c:1646 */
+#line 1961 "awkgram.c" /* yacc.c:1646 */
break;
case 11:
-#line 264 "awkgram.y" /* yacc.c:1646 */
+#line 267 "awkgram.y" /* yacc.c:1646 */
{
want_source = false;
at_seen = false;
yyerrok;
}
-#line 1968 "awkgram.c" /* yacc.c:1646 */
+#line 1971 "awkgram.c" /* yacc.c:1646 */
break;
case 12:
-#line 273 "awkgram.y" /* yacc.c:1646 */
+#line 276 "awkgram.y" /* yacc.c:1646 */
{
if (include_source((yyvsp[0])) < 0)
YYABORT;
@@ -1976,23 +1979,23 @@ yyreduce:
bcfree((yyvsp[0]));
(yyval) = NULL;
}
-#line 1980 "awkgram.c" /* yacc.c:1646 */
+#line 1983 "awkgram.c" /* yacc.c:1646 */
break;
case 13:
-#line 281 "awkgram.y" /* yacc.c:1646 */
+#line 284 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 1986 "awkgram.c" /* yacc.c:1646 */
+#line 1989 "awkgram.c" /* yacc.c:1646 */
break;
case 14:
-#line 283 "awkgram.y" /* yacc.c:1646 */
+#line 286 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 1992 "awkgram.c" /* yacc.c:1646 */
+#line 1995 "awkgram.c" /* yacc.c:1646 */
break;
case 15:
-#line 288 "awkgram.y" /* yacc.c:1646 */
+#line 291 "awkgram.y" /* yacc.c:1646 */
{
if (load_library((yyvsp[0])) < 0)
YYABORT;
@@ -2000,23 +2003,23 @@ yyreduce:
bcfree((yyvsp[0]));
(yyval) = NULL;
}
-#line 2004 "awkgram.c" /* yacc.c:1646 */
+#line 2007 "awkgram.c" /* yacc.c:1646 */
break;
case 16:
-#line 296 "awkgram.y" /* yacc.c:1646 */
+#line 299 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2010 "awkgram.c" /* yacc.c:1646 */
+#line 2013 "awkgram.c" /* yacc.c:1646 */
break;
case 17:
-#line 298 "awkgram.y" /* yacc.c:1646 */
+#line 301 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2016 "awkgram.c" /* yacc.c:1646 */
+#line 2019 "awkgram.c" /* yacc.c:1646 */
break;
case 18:
-#line 303 "awkgram.y" /* yacc.c:1646 */
+#line 306 "awkgram.y" /* yacc.c:1646 */
{
rule = Rule;
if (comment != NULL) {
@@ -2025,11 +2028,11 @@ yyreduce:
} else
(yyval) = NULL;
}
-#line 2029 "awkgram.c" /* yacc.c:1646 */
+#line 2032 "awkgram.c" /* yacc.c:1646 */
break;
case 19:
-#line 312 "awkgram.y" /* yacc.c:1646 */
+#line 315 "awkgram.y" /* yacc.c:1646 */
{
rule = Rule;
if (comment != NULL) {
@@ -2038,11 +2041,11 @@ yyreduce:
} else
(yyval) = (yyvsp[0]);
}
-#line 2042 "awkgram.c" /* yacc.c:1646 */
+#line 2045 "awkgram.c" /* yacc.c:1646 */
break;
case 20:
-#line 322 "awkgram.y" /* yacc.c:1646 */
+#line 325 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *tp;
@@ -2072,11 +2075,11 @@ yyreduce:
(yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp);
rule = Rule;
}
-#line 2076 "awkgram.c" /* yacc.c:1646 */
+#line 2079 "awkgram.c" /* yacc.c:1646 */
break;
case 21:
-#line 352 "awkgram.y" /* yacc.c:1646 */
+#line 355 "awkgram.y" /* yacc.c:1646 */
{
static int begin_seen = 0;
@@ -2090,11 +2093,11 @@ yyreduce:
check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2094 "awkgram.c" /* yacc.c:1646 */
+#line 2097 "awkgram.c" /* yacc.c:1646 */
break;
case 22:
-#line 366 "awkgram.y" /* yacc.c:1646 */
+#line 369 "awkgram.y" /* yacc.c:1646 */
{
static int end_seen = 0;
@@ -2108,11 +2111,11 @@ yyreduce:
check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2112 "awkgram.c" /* yacc.c:1646 */
+#line 2115 "awkgram.c" /* yacc.c:1646 */
break;
case 23:
-#line 380 "awkgram.y" /* yacc.c:1646 */
+#line 383 "awkgram.y" /* yacc.c:1646 */
{
func_first = false;
(yyvsp[0])->in_rule = rule = BEGINFILE;
@@ -2120,11 +2123,11 @@ yyreduce:
check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2124 "awkgram.c" /* yacc.c:1646 */
+#line 2127 "awkgram.c" /* yacc.c:1646 */
break;
case 24:
-#line 388 "awkgram.y" /* yacc.c:1646 */
+#line 391 "awkgram.y" /* yacc.c:1646 */
{
func_first = false;
(yyvsp[0])->in_rule = rule = ENDFILE;
@@ -2132,11 +2135,11 @@ yyreduce:
check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2136 "awkgram.c" /* yacc.c:1646 */
+#line 2139 "awkgram.c" /* yacc.c:1646 */
break;
case 25:
-#line 399 "awkgram.y" /* yacc.c:1646 */
+#line 402 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip;
if ((yyvsp[-3]) == NULL)
@@ -2145,48 +2148,48 @@ yyreduce:
ip = (yyvsp[-3]);
(yyval) = ip;
}
-#line 2149 "awkgram.c" /* yacc.c:1646 */
+#line 2152 "awkgram.c" /* yacc.c:1646 */
break;
case 26:
-#line 411 "awkgram.y" /* yacc.c:1646 */
+#line 414 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2155 "awkgram.c" /* yacc.c:1646 */
+#line 2158 "awkgram.c" /* yacc.c:1646 */
break;
case 27:
-#line 413 "awkgram.y" /* yacc.c:1646 */
+#line 416 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2161 "awkgram.c" /* yacc.c:1646 */
+#line 2164 "awkgram.c" /* yacc.c:1646 */
break;
case 28:
-#line 415 "awkgram.y" /* yacc.c:1646 */
+#line 418 "awkgram.y" /* yacc.c:1646 */
{
yyerror(_("`%s' is a built-in function, it cannot be redefined"),
tokstart);
YYABORT;
}
-#line 2171 "awkgram.c" /* yacc.c:1646 */
+#line 2174 "awkgram.c" /* yacc.c:1646 */
break;
case 29:
-#line 421 "awkgram.y" /* yacc.c:1646 */
+#line 424 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = (yyvsp[0]);
at_seen = false;
}
-#line 2180 "awkgram.c" /* yacc.c:1646 */
+#line 2183 "awkgram.c" /* yacc.c:1646 */
break;
case 32:
-#line 433 "awkgram.y" /* yacc.c:1646 */
+#line 436 "awkgram.y" /* yacc.c:1646 */
{ want_param_names = FUNC_HEADER; }
-#line 2186 "awkgram.c" /* yacc.c:1646 */
+#line 2189 "awkgram.c" /* yacc.c:1646 */
break;
case 33:
-#line 434 "awkgram.y" /* yacc.c:1646 */
+#line 437 "awkgram.y" /* yacc.c:1646 */
{
/*
* treat any comments between BOF and the first function
@@ -2195,13 +2198,22 @@ yyreduce:
* than one such comments, treat the last as a function
* comment.
*/
- if (comment != NULL && func_first
- && strstr(comment->memory->stptr, "\n\n") != NULL)
+ if (prior_comment != NULL) {
+ comment_to_save = prior_comment;
+ prior_comment = NULL;
+ } else if (comment != NULL) {
+ comment_to_save = comment;
+ comment = NULL;
+ } else
+ comment_to_save = NULL;
+
+ if (comment_to_save != NULL && func_first
+ && strstr(comment_to_save->memory->stptr, "\n\n") != NULL)
split_comment();
/* save any other pre-function comment as function comment */
- if (comment != NULL) {
- function_comment = comment;
- comment = NULL;
+ if (comment_to_save != NULL) {
+ function_comment = comment_to_save;
+ comment_to_save = NULL;
}
func_first = false;
(yyvsp[-6])->source_file = source;
@@ -2214,17 +2226,17 @@ yyreduce:
(yyval) = (yyvsp[-6]);
want_param_names = FUNC_BODY;
}
-#line 2218 "awkgram.c" /* yacc.c:1646 */
+#line 2230 "awkgram.c" /* yacc.c:1646 */
break;
case 34:
-#line 469 "awkgram.y" /* yacc.c:1646 */
+#line 481 "awkgram.y" /* yacc.c:1646 */
{ want_regexp = true; }
-#line 2224 "awkgram.c" /* yacc.c:1646 */
+#line 2236 "awkgram.c" /* yacc.c:1646 */
break;
case 35:
-#line 471 "awkgram.y" /* yacc.c:1646 */
+#line 483 "awkgram.y" /* yacc.c:1646 */
{
NODE *n, *exp;
char *re;
@@ -2253,11 +2265,11 @@ yyreduce:
(yyval)->opcode = Op_match_rec;
(yyval)->memory = n;
}
-#line 2257 "awkgram.c" /* yacc.c:1646 */
+#line 2269 "awkgram.c" /* yacc.c:1646 */
break;
case 36:
-#line 503 "awkgram.y" /* yacc.c:1646 */
+#line 515 "awkgram.y" /* yacc.c:1646 */
{
NODE *n, *exp;
char *re;
@@ -2277,28 +2289,28 @@ yyreduce:
(yyval)->opcode = Op_push_re;
(yyval)->memory = n;
}
-#line 2281 "awkgram.c" /* yacc.c:1646 */
+#line 2293 "awkgram.c" /* yacc.c:1646 */
break;
case 37:
-#line 525 "awkgram.y" /* yacc.c:1646 */
+#line 537 "awkgram.y" /* yacc.c:1646 */
{ bcfree((yyvsp[0])); }
-#line 2287 "awkgram.c" /* yacc.c:1646 */
+#line 2299 "awkgram.c" /* yacc.c:1646 */
break;
case 39:
-#line 531 "awkgram.y" /* yacc.c:1646 */
+#line 543 "awkgram.y" /* yacc.c:1646 */
{
if (comment != NULL) {
(yyval) = list_create(comment);
comment = NULL;
} else (yyval) = NULL;
}
-#line 2298 "awkgram.c" /* yacc.c:1646 */
+#line 2310 "awkgram.c" /* yacc.c:1646 */
break;
case 40:
-#line 538 "awkgram.y" /* yacc.c:1646 */
+#line 550 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0]) == NULL) {
if (comment == NULL)
@@ -2326,40 +2338,40 @@ yyreduce:
}
yyerrok;
}
-#line 2330 "awkgram.c" /* yacc.c:1646 */
+#line 2342 "awkgram.c" /* yacc.c:1646 */
break;
case 41:
-#line 566 "awkgram.y" /* yacc.c:1646 */
+#line 578 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2336 "awkgram.c" /* yacc.c:1646 */
+#line 2348 "awkgram.c" /* yacc.c:1646 */
break;
case 44:
-#line 576 "awkgram.y" /* yacc.c:1646 */
+#line 588 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2342 "awkgram.c" /* yacc.c:1646 */
+#line 2354 "awkgram.c" /* yacc.c:1646 */
break;
case 45:
-#line 578 "awkgram.y" /* yacc.c:1646 */
+#line 590 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 2348 "awkgram.c" /* yacc.c:1646 */
+#line 2360 "awkgram.c" /* yacc.c:1646 */
break;
case 46:
-#line 580 "awkgram.y" /* yacc.c:1646 */
+#line 592 "awkgram.y" /* yacc.c:1646 */
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count));
else
(yyval) = (yyvsp[0]);
}
-#line 2359 "awkgram.c" /* yacc.c:1646 */
+#line 2371 "awkgram.c" /* yacc.c:1646 */
break;
case 47:
-#line 587 "awkgram.y" /* yacc.c:1646 */
+#line 599 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
INSTRUCTION *ip, *nextc, *tbreak;
@@ -2449,11 +2461,11 @@ yyreduce:
break_allowed--;
fix_break_continue(ip, tbreak, NULL);
}
-#line 2453 "awkgram.c" /* yacc.c:1646 */
+#line 2465 "awkgram.c" /* yacc.c:1646 */
break;
case 48:
-#line 677 "awkgram.y" /* yacc.c:1646 */
+#line 689 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@ -2495,11 +2507,11 @@ yyreduce:
continue_allowed--;
fix_break_continue(ip, tbreak, tcont);
}
-#line 2499 "awkgram.c" /* yacc.c:1646 */
+#line 2511 "awkgram.c" /* yacc.c:1646 */
break;
case 49:
-#line 719 "awkgram.y" /* yacc.c:1646 */
+#line 731 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@ -2541,11 +2553,11 @@ yyreduce:
} /* else
$1 and $4 are NULLs */
}
-#line 2545 "awkgram.c" /* yacc.c:1646 */
+#line 2557 "awkgram.c" /* yacc.c:1646 */
break;
case 50:
-#line 761 "awkgram.y" /* yacc.c:1646 */
+#line 773 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip;
char *var_name = (yyvsp[-5])->lextok;
@@ -2658,70 +2670,73 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
-#line 2662 "awkgram.c" /* yacc.c:1646 */
+#line 2674 "awkgram.c" /* yacc.c:1646 */
break;
case 51:
-#line 874 "awkgram.y" /* yacc.c:1646 */
+#line 886 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0]));
break_allowed--;
continue_allowed--;
}
-#line 2673 "awkgram.c" /* yacc.c:1646 */
+#line 2685 "awkgram.c" /* yacc.c:1646 */
break;
case 52:
-#line 881 "awkgram.y" /* yacc.c:1646 */
+#line 893 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0]));
break_allowed--;
continue_allowed--;
}
-#line 2684 "awkgram.c" /* yacc.c:1646 */
+#line 2696 "awkgram.c" /* yacc.c:1646 */
break;
case 53:
-#line 888 "awkgram.y" /* yacc.c:1646 */
+#line 900 "awkgram.y" /* yacc.c:1646 */
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count));
else
(yyval) = (yyvsp[0]);
+ (yyval) = add_pending_comment((yyval));
}
-#line 2695 "awkgram.c" /* yacc.c:1646 */
+#line 2708 "awkgram.c" /* yacc.c:1646 */
break;
case 54:
-#line 898 "awkgram.y" /* yacc.c:1646 */
+#line 911 "awkgram.y" /* yacc.c:1646 */
{
if (! break_allowed)
error_ln((yyvsp[-1])->source_line,
_("`break' is not allowed outside a loop or switch"));
(yyvsp[-1])->target_jmp = NULL;
(yyval) = list_create((yyvsp[-1]));
+ (yyval) = add_pending_comment((yyval));
}
-#line 2708 "awkgram.c" /* yacc.c:1646 */
+#line 2722 "awkgram.c" /* yacc.c:1646 */
break;
case 55:
-#line 907 "awkgram.y" /* yacc.c:1646 */
+#line 921 "awkgram.y" /* yacc.c:1646 */
{
if (! continue_allowed)
error_ln((yyvsp[-1])->source_line,
_("`continue' is not allowed outside a loop"));
(yyvsp[-1])->target_jmp = NULL;
(yyval) = list_create((yyvsp[-1]));
+ (yyval) = add_pending_comment((yyval));
}
-#line 2721 "awkgram.c" /* yacc.c:1646 */
+#line 2736 "awkgram.c" /* yacc.c:1646 */
break;
case 56:
-#line 916 "awkgram.y" /* yacc.c:1646 */
+#line 931 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule && rule != Rule)
@@ -2729,12 +2744,13 @@ regular_loop:
_("`next' used in %s action"), ruletab[rule]);
(yyvsp[-1])->target_jmp = ip_rec;
(yyval) = list_create((yyvsp[-1]));
+ (yyval) = add_pending_comment((yyval));
}
-#line 2734 "awkgram.c" /* yacc.c:1646 */
+#line 2750 "awkgram.c" /* yacc.c:1646 */
break;
case 57:
-#line 925 "awkgram.y" /* yacc.c:1646 */
+#line 941 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule == BEGIN || rule == END || rule == ENDFILE)
@@ -2744,12 +2760,13 @@ regular_loop:
(yyvsp[-1])->target_newfile = ip_newfile;
(yyvsp[-1])->target_endfile = ip_endfile;
(yyval) = list_create((yyvsp[-1]));
+ (yyval) = add_pending_comment((yyval));
}
-#line 2749 "awkgram.c" /* yacc.c:1646 */
+#line 2766 "awkgram.c" /* yacc.c:1646 */
break;
case 58:
-#line 936 "awkgram.y" /* yacc.c:1646 */
+#line 953 "awkgram.y" /* yacc.c:1646 */
{
/* Initialize the two possible jump targets, the actual target
* is resolved at run-time.
@@ -2763,21 +2780,22 @@ regular_loop:
(yyval)->nexti->memory = dupnode(Nnull_string);
} else
(yyval) = list_append((yyvsp[-1]), (yyvsp[-2]));
+ (yyval) = add_pending_comment((yyval));
}
-#line 2768 "awkgram.c" /* yacc.c:1646 */
+#line 2786 "awkgram.c" /* yacc.c:1646 */
break;
case 59:
-#line 951 "awkgram.y" /* yacc.c:1646 */
+#line 969 "awkgram.y" /* yacc.c:1646 */
{
if (! in_function)
yyerror(_("`return' used outside function context"));
}
-#line 2777 "awkgram.c" /* yacc.c:1646 */
+#line 2795 "awkgram.c" /* yacc.c:1646 */
break;
case 60:
-#line 954 "awkgram.y" /* yacc.c:1646 */
+#line 972 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) == NULL) {
(yyval) = list_create((yyvsp[-3]));
@@ -2797,18 +2815,19 @@ regular_loop:
(yyval) = list_append((yyvsp[-1]), (yyvsp[-3]));
}
+ (yyval) = add_pending_comment((yyval));
}
-#line 2802 "awkgram.c" /* yacc.c:1646 */
+#line 2821 "awkgram.c" /* yacc.c:1646 */
break;
case 62:
-#line 986 "awkgram.y" /* yacc.c:1646 */
+#line 1005 "awkgram.y" /* yacc.c:1646 */
{ in_print = true; in_parens = 0; }
-#line 2808 "awkgram.c" /* yacc.c:1646 */
+#line 2827 "awkgram.c" /* yacc.c:1646 */
break;
case 63:
-#line 987 "awkgram.y" /* yacc.c:1646 */
+#line 1006 "awkgram.y" /* yacc.c:1646 */
{
/*
* Optimization: plain `print' has no expression list, so $3 is null.
@@ -2904,18 +2923,19 @@ regular_print:
}
}
}
+ (yyval) = add_pending_comment((yyval));
}
-#line 2909 "awkgram.c" /* yacc.c:1646 */
+#line 2929 "awkgram.c" /* yacc.c:1646 */
break;
case 64:
-#line 1084 "awkgram.y" /* yacc.c:1646 */
+#line 1104 "awkgram.y" /* yacc.c:1646 */
{ sub_counter = 0; }
-#line 2915 "awkgram.c" /* yacc.c:1646 */
+#line 2935 "awkgram.c" /* yacc.c:1646 */
break;
case 65:
-#line 1085 "awkgram.y" /* yacc.c:1646 */
+#line 1105 "awkgram.y" /* yacc.c:1646 */
{
char *arr = (yyvsp[-2])->lextok;
@@ -2947,12 +2967,13 @@ regular_print:
(yyvsp[-3])->expr_count = sub_counter;
(yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3]));
}
+ (yyval) = add_pending_comment((yyval));
}
-#line 2952 "awkgram.c" /* yacc.c:1646 */
+#line 2973 "awkgram.c" /* yacc.c:1646 */
break;
case 66:
-#line 1122 "awkgram.y" /* yacc.c:1646 */
+#line 1143 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
char *arr = (yyvsp[-1])->lextok;
@@ -2977,53 +2998,57 @@ regular_print:
else if ((yyvsp[-1])->memory == func_table)
fatal(_("`delete' is not allowed with FUNCTAB"));
}
+ (yyval) = add_pending_comment((yyval));
}
-#line 2982 "awkgram.c" /* yacc.c:1646 */
+#line 3004 "awkgram.c" /* yacc.c:1646 */
break;
case 67:
-#line 1148 "awkgram.y" /* yacc.c:1646 */
- { (yyval) = optimize_assignment((yyvsp[0])); }
-#line 2988 "awkgram.c" /* yacc.c:1646 */
+#line 1170 "awkgram.y" /* yacc.c:1646 */
+ {
+ (yyval) = optimize_assignment((yyvsp[0]));
+ (yyval) = add_pending_comment((yyval));
+ }
+#line 3013 "awkgram.c" /* yacc.c:1646 */
break;
case 68:
-#line 1153 "awkgram.y" /* yacc.c:1646 */
+#line 1178 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2994 "awkgram.c" /* yacc.c:1646 */
+#line 3019 "awkgram.c" /* yacc.c:1646 */
break;
case 69:
-#line 1155 "awkgram.y" /* yacc.c:1646 */
+#line 1180 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3000 "awkgram.c" /* yacc.c:1646 */
+#line 3025 "awkgram.c" /* yacc.c:1646 */
break;
case 70:
-#line 1160 "awkgram.y" /* yacc.c:1646 */
+#line 1185 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3006 "awkgram.c" /* yacc.c:1646 */
+#line 3031 "awkgram.c" /* yacc.c:1646 */
break;
case 71:
-#line 1162 "awkgram.y" /* yacc.c:1646 */
+#line 1187 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) == NULL)
(yyval) = list_create((yyvsp[0]));
else
(yyval) = list_prepend((yyvsp[-1]), (yyvsp[0]));
}
-#line 3017 "awkgram.c" /* yacc.c:1646 */
+#line 3042 "awkgram.c" /* yacc.c:1646 */
break;
case 72:
-#line 1169 "awkgram.y" /* yacc.c:1646 */
+#line 1194 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3023 "awkgram.c" /* yacc.c:1646 */
+#line 3048 "awkgram.c" /* yacc.c:1646 */
break;
case 73:
-#line 1174 "awkgram.y" /* yacc.c:1646 */
+#line 1199 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -3035,11 +3060,11 @@ regular_print:
bcfree((yyvsp[-2]));
(yyval) = (yyvsp[-4]);
}
-#line 3039 "awkgram.c" /* yacc.c:1646 */
+#line 3064 "awkgram.c" /* yacc.c:1646 */
break;
case 74:
-#line 1186 "awkgram.y" /* yacc.c:1646 */
+#line 1211 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -3050,17 +3075,17 @@ regular_print:
(yyvsp[-3])->case_stmt = casestmt;
(yyval) = (yyvsp[-3]);
}
-#line 3054 "awkgram.c" /* yacc.c:1646 */
+#line 3079 "awkgram.c" /* yacc.c:1646 */
break;
case 75:
-#line 1200 "awkgram.y" /* yacc.c:1646 */
+#line 1225 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3060 "awkgram.c" /* yacc.c:1646 */
+#line 3085 "awkgram.c" /* yacc.c:1646 */
break;
case 76:
-#line 1202 "awkgram.y" /* yacc.c:1646 */
+#line 1227 "awkgram.y" /* yacc.c:1646 */
{
NODE *n = (yyvsp[0])->memory;
(void) force_number(n);
@@ -3068,26 +3093,26 @@ regular_print:
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3072 "awkgram.c" /* yacc.c:1646 */
+#line 3097 "awkgram.c" /* yacc.c:1646 */
break;
case 77:
-#line 1210 "awkgram.y" /* yacc.c:1646 */
+#line 1235 "awkgram.y" /* yacc.c:1646 */
{
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3081 "awkgram.c" /* yacc.c:1646 */
+#line 3106 "awkgram.c" /* yacc.c:1646 */
break;
case 78:
-#line 1215 "awkgram.y" /* yacc.c:1646 */
+#line 1240 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3087 "awkgram.c" /* yacc.c:1646 */
+#line 3112 "awkgram.c" /* yacc.c:1646 */
break;
case 79:
-#line 1217 "awkgram.y" /* yacc.c:1646 */
+#line 1242 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->memory->type == Node_regex)
(yyvsp[0])->opcode = Op_push_re;
@@ -3095,57 +3120,57 @@ regular_print:
(yyvsp[0])->opcode = Op_push;
(yyval) = (yyvsp[0]);
}
-#line 3099 "awkgram.c" /* yacc.c:1646 */
+#line 3124 "awkgram.c" /* yacc.c:1646 */
break;
case 80:
-#line 1225 "awkgram.y" /* yacc.c:1646 */
+#line 1250 "awkgram.y" /* yacc.c:1646 */
{
assert((yyvsp[0])->memory->type == Node_typedregex);
(yyvsp[0])->opcode = Op_push_re;
(yyval) = (yyvsp[0]);
}
-#line 3109 "awkgram.c" /* yacc.c:1646 */
+#line 3134 "awkgram.c" /* yacc.c:1646 */
break;
case 81:
-#line 1234 "awkgram.y" /* yacc.c:1646 */
+#line 1259 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3115 "awkgram.c" /* yacc.c:1646 */
+#line 3140 "awkgram.c" /* yacc.c:1646 */
break;
case 82:
-#line 1236 "awkgram.y" /* yacc.c:1646 */
+#line 1261 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3121 "awkgram.c" /* yacc.c:1646 */
+#line 3146 "awkgram.c" /* yacc.c:1646 */
break;
case 84:
-#line 1246 "awkgram.y" /* yacc.c:1646 */
+#line 1271 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = (yyvsp[-1]);
}
-#line 3129 "awkgram.c" /* yacc.c:1646 */
+#line 3154 "awkgram.c" /* yacc.c:1646 */
break;
case 85:
-#line 1253 "awkgram.y" /* yacc.c:1646 */
+#line 1278 "awkgram.y" /* yacc.c:1646 */
{
in_print = false;
in_parens = 0;
(yyval) = NULL;
}
-#line 3139 "awkgram.c" /* yacc.c:1646 */
+#line 3164 "awkgram.c" /* yacc.c:1646 */
break;
case 86:
-#line 1258 "awkgram.y" /* yacc.c:1646 */
+#line 1283 "awkgram.y" /* yacc.c:1646 */
{ in_print = false; in_parens = 0; }
-#line 3145 "awkgram.c" /* yacc.c:1646 */
+#line 3170 "awkgram.c" /* yacc.c:1646 */
break;
case 87:
-#line 1259 "awkgram.y" /* yacc.c:1646 */
+#line 1284 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->redir_type == redirect_twoway
&& (yyvsp[0])->lasti->opcode == Op_K_getline_redir
@@ -3153,63 +3178,63 @@ regular_print:
yyerror(_("multistage two-way pipelines don't work"));
(yyval) = list_prepend((yyvsp[0]), (yyvsp[-2]));
}
-#line 3157 "awkgram.c" /* yacc.c:1646 */
+#line 3182 "awkgram.c" /* yacc.c:1646 */
break;
case 88:
-#line 1270 "awkgram.y" /* yacc.c:1646 */
+#line 1295 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL);
}
-#line 3165 "awkgram.c" /* yacc.c:1646 */
+#line 3190 "awkgram.c" /* yacc.c:1646 */
break;
case 89:
-#line 1275 "awkgram.y" /* yacc.c:1646 */
+#line 1300 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0]));
}
-#line 3173 "awkgram.c" /* yacc.c:1646 */
+#line 3198 "awkgram.c" /* yacc.c:1646 */
break;
case 94:
-#line 1292 "awkgram.y" /* yacc.c:1646 */
+#line 1317 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3179 "awkgram.c" /* yacc.c:1646 */
+#line 3204 "awkgram.c" /* yacc.c:1646 */
break;
case 95:
-#line 1294 "awkgram.y" /* yacc.c:1646 */
+#line 1319 "awkgram.y" /* yacc.c:1646 */
{
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3188 "awkgram.c" /* yacc.c:1646 */
+#line 3213 "awkgram.c" /* yacc.c:1646 */
break;
case 96:
-#line 1302 "awkgram.y" /* yacc.c:1646 */
+#line 1327 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3194 "awkgram.c" /* yacc.c:1646 */
+#line 3219 "awkgram.c" /* yacc.c:1646 */
break;
case 97:
-#line 1304 "awkgram.y" /* yacc.c:1646 */
+#line 1329 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3200 "awkgram.c" /* yacc.c:1646 */
+#line 3225 "awkgram.c" /* yacc.c:1646 */
break;
case 98:
-#line 1309 "awkgram.y" /* yacc.c:1646 */
+#line 1334 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->param_count = 0;
(yyval) = list_create((yyvsp[0]));
}
-#line 3209 "awkgram.c" /* yacc.c:1646 */
+#line 3234 "awkgram.c" /* yacc.c:1646 */
break;
case 99:
-#line 1314 "awkgram.y" /* yacc.c:1646 */
+#line 1339 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2]) != NULL && (yyvsp[0]) != NULL) {
(yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1;
@@ -3218,74 +3243,74 @@ regular_print:
} else
(yyval) = NULL;
}
-#line 3222 "awkgram.c" /* yacc.c:1646 */
+#line 3247 "awkgram.c" /* yacc.c:1646 */
break;
case 100:
-#line 1323 "awkgram.y" /* yacc.c:1646 */
+#line 1348 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3228 "awkgram.c" /* yacc.c:1646 */
+#line 3253 "awkgram.c" /* yacc.c:1646 */
break;
case 101:
-#line 1325 "awkgram.y" /* yacc.c:1646 */
+#line 1350 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3234 "awkgram.c" /* yacc.c:1646 */
+#line 3259 "awkgram.c" /* yacc.c:1646 */
break;
case 102:
-#line 1327 "awkgram.y" /* yacc.c:1646 */
+#line 1352 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-2]); }
-#line 3240 "awkgram.c" /* yacc.c:1646 */
+#line 3265 "awkgram.c" /* yacc.c:1646 */
break;
case 103:
-#line 1333 "awkgram.y" /* yacc.c:1646 */
+#line 1358 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3246 "awkgram.c" /* yacc.c:1646 */
+#line 3271 "awkgram.c" /* yacc.c:1646 */
break;
case 104:
-#line 1335 "awkgram.y" /* yacc.c:1646 */
+#line 1360 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3252 "awkgram.c" /* yacc.c:1646 */
+#line 3277 "awkgram.c" /* yacc.c:1646 */
break;
case 105:
-#line 1340 "awkgram.y" /* yacc.c:1646 */
+#line 1365 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3258 "awkgram.c" /* yacc.c:1646 */
+#line 3283 "awkgram.c" /* yacc.c:1646 */
break;
case 106:
-#line 1342 "awkgram.y" /* yacc.c:1646 */
+#line 1367 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3264 "awkgram.c" /* yacc.c:1646 */
+#line 3289 "awkgram.c" /* yacc.c:1646 */
break;
case 107:
-#line 1347 "awkgram.y" /* yacc.c:1646 */
+#line 1372 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3270 "awkgram.c" /* yacc.c:1646 */
+#line 3295 "awkgram.c" /* yacc.c:1646 */
break;
case 108:
-#line 1349 "awkgram.y" /* yacc.c:1646 */
+#line 1374 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3279 "awkgram.c" /* yacc.c:1646 */
+#line 3304 "awkgram.c" /* yacc.c:1646 */
break;
case 109:
-#line 1354 "awkgram.y" /* yacc.c:1646 */
+#line 1379 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3285 "awkgram.c" /* yacc.c:1646 */
+#line 3310 "awkgram.c" /* yacc.c:1646 */
break;
case 110:
-#line 1356 "awkgram.y" /* yacc.c:1646 */
+#line 1381 "awkgram.y" /* yacc.c:1646 */
{
/*
* Returning the expression list instead of NULL lets
@@ -3293,62 +3318,62 @@ regular_print:
*/
(yyval) = (yyvsp[-1]);
}
-#line 3297 "awkgram.c" /* yacc.c:1646 */
+#line 3322 "awkgram.c" /* yacc.c:1646 */
break;
case 111:
-#line 1364 "awkgram.y" /* yacc.c:1646 */
+#line 1389 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3306 "awkgram.c" /* yacc.c:1646 */
+#line 3331 "awkgram.c" /* yacc.c:1646 */
break;
case 112:
-#line 1369 "awkgram.y" /* yacc.c:1646 */
+#line 1394 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = (yyvsp[-2]);
}
-#line 3315 "awkgram.c" /* yacc.c:1646 */
+#line 3340 "awkgram.c" /* yacc.c:1646 */
break;
case 113:
-#line 1377 "awkgram.y" /* yacc.c:1646 */
+#line 1402 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3321 "awkgram.c" /* yacc.c:1646 */
+#line 3346 "awkgram.c" /* yacc.c:1646 */
break;
case 114:
-#line 1379 "awkgram.y" /* yacc.c:1646 */
+#line 1404 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3327 "awkgram.c" /* yacc.c:1646 */
+#line 3352 "awkgram.c" /* yacc.c:1646 */
break;
case 115:
-#line 1384 "awkgram.y" /* yacc.c:1646 */
+#line 1409 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3333 "awkgram.c" /* yacc.c:1646 */
+#line 3358 "awkgram.c" /* yacc.c:1646 */
break;
case 116:
-#line 1386 "awkgram.y" /* yacc.c:1646 */
+#line 1411 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3342 "awkgram.c" /* yacc.c:1646 */
+#line 3367 "awkgram.c" /* yacc.c:1646 */
break;
case 117:
-#line 1391 "awkgram.y" /* yacc.c:1646 */
+#line 1416 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3348 "awkgram.c" /* yacc.c:1646 */
+#line 3373 "awkgram.c" /* yacc.c:1646 */
break;
case 118:
-#line 1393 "awkgram.y" /* yacc.c:1646 */
+#line 1418 "awkgram.y" /* yacc.c:1646 */
{
/*
* Returning the expression list instead of NULL lets
@@ -3356,72 +3381,72 @@ regular_print:
*/
(yyval) = (yyvsp[-1]);
}
-#line 3360 "awkgram.c" /* yacc.c:1646 */
+#line 3385 "awkgram.c" /* yacc.c:1646 */
break;
case 119:
-#line 1401 "awkgram.y" /* yacc.c:1646 */
+#line 1426 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3369 "awkgram.c" /* yacc.c:1646 */
+#line 3394 "awkgram.c" /* yacc.c:1646 */
break;
case 120:
-#line 1406 "awkgram.y" /* yacc.c:1646 */
+#line 1431 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = (yyvsp[-2]);
}
-#line 3378 "awkgram.c" /* yacc.c:1646 */
+#line 3403 "awkgram.c" /* yacc.c:1646 */
break;
case 121:
-#line 1413 "awkgram.y" /* yacc.c:1646 */
+#line 1438 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3384 "awkgram.c" /* yacc.c:1646 */
+#line 3409 "awkgram.c" /* yacc.c:1646 */
break;
case 122:
-#line 1414 "awkgram.y" /* yacc.c:1646 */
+#line 1439 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = list_create((yyvsp[0])); }
-#line 3390 "awkgram.c" /* yacc.c:1646 */
+#line 3415 "awkgram.c" /* yacc.c:1646 */
break;
case 123:
-#line 1420 "awkgram.y" /* yacc.c:1646 */
+#line 1445 "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 3401 "awkgram.c" /* yacc.c:1646 */
+#line 3426 "awkgram.c" /* yacc.c:1646 */
break;
case 124:
-#line 1427 "awkgram.y" /* yacc.c:1646 */
+#line 1452 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_assignment((yyvsp[-2]), list_create((yyvsp[0])), (yyvsp[-1]));
}
-#line 3409 "awkgram.c" /* yacc.c:1646 */
+#line 3434 "awkgram.c" /* yacc.c:1646 */
break;
case 125:
-#line 1431 "awkgram.y" /* yacc.c:1646 */
+#line 1456 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3415 "awkgram.c" /* yacc.c:1646 */
+#line 3440 "awkgram.c" /* yacc.c:1646 */
break;
case 126:
-#line 1433 "awkgram.y" /* yacc.c:1646 */
+#line 1458 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3421 "awkgram.c" /* yacc.c:1646 */
+#line 3446 "awkgram.c" /* yacc.c:1646 */
break;
case 127:
-#line 1435 "awkgram.y" /* yacc.c:1646 */
+#line 1460 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[-1])->source_line,
@@ -3434,11 +3459,11 @@ regular_print:
bcfree((yyvsp[0]));
(yyval) = list_append((yyvsp[-2]), (yyvsp[-1]));
}
-#line 3438 "awkgram.c" /* yacc.c:1646 */
+#line 3463 "awkgram.c" /* yacc.c:1646 */
break;
case 128:
-#line 1448 "awkgram.y" /* yacc.c:1646 */
+#line 1473 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[-1])->source_line,
@@ -3455,11 +3480,11 @@ regular_print:
(yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1]));
}
}
-#line 3459 "awkgram.c" /* yacc.c:1646 */
+#line 3484 "awkgram.c" /* yacc.c:1646 */
break;
case 129:
-#line 1465 "awkgram.y" /* yacc.c:1646 */
+#line 1490 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old)
warning_ln((yyvsp[-1])->source_line,
@@ -3469,91 +3494,91 @@ regular_print:
(yyvsp[-1])->expr_count = 1;
(yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1]));
}
-#line 3473 "awkgram.c" /* yacc.c:1646 */
+#line 3498 "awkgram.c" /* yacc.c:1646 */
break;
case 130:
-#line 1475 "awkgram.y" /* yacc.c:1646 */
+#line 1500 "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 3484 "awkgram.c" /* yacc.c:1646 */
+#line 3509 "awkgram.c" /* yacc.c:1646 */
break;
case 131:
-#line 1482 "awkgram.y" /* yacc.c:1646 */
+#line 1507 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); }
-#line 3490 "awkgram.c" /* yacc.c:1646 */
+#line 3515 "awkgram.c" /* yacc.c:1646 */
break;
case 132:
-#line 1484 "awkgram.y" /* yacc.c:1646 */
+#line 1509 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3496 "awkgram.c" /* yacc.c:1646 */
+#line 3521 "awkgram.c" /* yacc.c:1646 */
break;
case 133:
-#line 1489 "awkgram.y" /* yacc.c:1646 */
+#line 1514 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3502 "awkgram.c" /* yacc.c:1646 */
+#line 3527 "awkgram.c" /* yacc.c:1646 */
break;
case 134:
-#line 1491 "awkgram.y" /* yacc.c:1646 */
+#line 1516 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3508 "awkgram.c" /* yacc.c:1646 */
+#line 3533 "awkgram.c" /* yacc.c:1646 */
break;
case 135:
-#line 1493 "awkgram.y" /* yacc.c:1646 */
+#line 1518 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_assign_quotient;
(yyval) = (yyvsp[0]);
}
-#line 3517 "awkgram.c" /* yacc.c:1646 */
+#line 3542 "awkgram.c" /* yacc.c:1646 */
break;
case 136:
-#line 1501 "awkgram.y" /* yacc.c:1646 */
+#line 1526 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3523 "awkgram.c" /* yacc.c:1646 */
+#line 3548 "awkgram.c" /* yacc.c:1646 */
break;
case 137:
-#line 1503 "awkgram.y" /* yacc.c:1646 */
+#line 1528 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3529 "awkgram.c" /* yacc.c:1646 */
+#line 3554 "awkgram.c" /* yacc.c:1646 */
break;
case 138:
-#line 1508 "awkgram.y" /* yacc.c:1646 */
+#line 1533 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3535 "awkgram.c" /* yacc.c:1646 */
+#line 3560 "awkgram.c" /* yacc.c:1646 */
break;
case 139:
-#line 1510 "awkgram.y" /* yacc.c:1646 */
+#line 1535 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3541 "awkgram.c" /* yacc.c:1646 */
+#line 3566 "awkgram.c" /* yacc.c:1646 */
break;
case 140:
-#line 1515 "awkgram.y" /* yacc.c:1646 */
+#line 1540 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3547 "awkgram.c" /* yacc.c:1646 */
+#line 3572 "awkgram.c" /* yacc.c:1646 */
break;
case 141:
-#line 1517 "awkgram.y" /* yacc.c:1646 */
+#line 1542 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3553 "awkgram.c" /* yacc.c:1646 */
+#line 3578 "awkgram.c" /* yacc.c:1646 */
break;
case 142:
-#line 1519 "awkgram.y" /* yacc.c:1646 */
+#line 1544 "awkgram.y" /* yacc.c:1646 */
{
int count = 2;
bool is_simple_var = false;
@@ -3606,47 +3631,47 @@ regular_print:
max_args = count;
}
}
-#line 3610 "awkgram.c" /* yacc.c:1646 */
+#line 3635 "awkgram.c" /* yacc.c:1646 */
break;
case 144:
-#line 1577 "awkgram.y" /* yacc.c:1646 */
+#line 1602 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3616 "awkgram.c" /* yacc.c:1646 */
+#line 3641 "awkgram.c" /* yacc.c:1646 */
break;
case 145:
-#line 1579 "awkgram.y" /* yacc.c:1646 */
+#line 1604 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3622 "awkgram.c" /* yacc.c:1646 */
+#line 3647 "awkgram.c" /* yacc.c:1646 */
break;
case 146:
-#line 1581 "awkgram.y" /* yacc.c:1646 */
+#line 1606 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3628 "awkgram.c" /* yacc.c:1646 */
+#line 3653 "awkgram.c" /* yacc.c:1646 */
break;
case 147:
-#line 1583 "awkgram.y" /* yacc.c:1646 */
+#line 1608 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3634 "awkgram.c" /* yacc.c:1646 */
+#line 3659 "awkgram.c" /* yacc.c:1646 */
break;
case 148:
-#line 1585 "awkgram.y" /* yacc.c:1646 */
+#line 1610 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3640 "awkgram.c" /* yacc.c:1646 */
+#line 3665 "awkgram.c" /* yacc.c:1646 */
break;
case 149:
-#line 1587 "awkgram.y" /* yacc.c:1646 */
+#line 1612 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3646 "awkgram.c" /* yacc.c:1646 */
+#line 3671 "awkgram.c" /* yacc.c:1646 */
break;
case 150:
-#line 1589 "awkgram.y" /* yacc.c:1646 */
+#line 1614 "awkgram.y" /* yacc.c:1646 */
{
/*
* In BEGINFILE/ENDFILE, allow `getline [var] < file'
@@ -3660,29 +3685,29 @@ regular_print:
_("non-redirected `getline' undefined inside END action"));
(yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input);
}
-#line 3664 "awkgram.c" /* yacc.c:1646 */
+#line 3689 "awkgram.c" /* yacc.c:1646 */
break;
case 151:
-#line 1603 "awkgram.y" /* yacc.c:1646 */
+#line 1628 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postincrement;
(yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3673 "awkgram.c" /* yacc.c:1646 */
+#line 3698 "awkgram.c" /* yacc.c:1646 */
break;
case 152:
-#line 1608 "awkgram.y" /* yacc.c:1646 */
+#line 1633 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postdecrement;
(yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3682 "awkgram.c" /* yacc.c:1646 */
+#line 3707 "awkgram.c" /* yacc.c:1646 */
break;
case 153:
-#line 1613 "awkgram.y" /* yacc.c:1646 */
+#line 1638 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old) {
warning_ln((yyvsp[-1])->source_line,
@@ -3702,64 +3727,64 @@ regular_print:
(yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1]));
}
}
-#line 3706 "awkgram.c" /* yacc.c:1646 */
+#line 3731 "awkgram.c" /* yacc.c:1646 */
break;
case 154:
-#line 1638 "awkgram.y" /* yacc.c:1646 */
+#line 1663 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type);
bcfree((yyvsp[-2]));
}
-#line 3715 "awkgram.c" /* yacc.c:1646 */
+#line 3740 "awkgram.c" /* yacc.c:1646 */
break;
case 155:
-#line 1644 "awkgram.y" /* yacc.c:1646 */
+#line 1669 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3721 "awkgram.c" /* yacc.c:1646 */
+#line 3746 "awkgram.c" /* yacc.c:1646 */
break;
case 156:
-#line 1646 "awkgram.y" /* yacc.c:1646 */
+#line 1671 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3727 "awkgram.c" /* yacc.c:1646 */
+#line 3752 "awkgram.c" /* yacc.c:1646 */
break;
case 157:
-#line 1648 "awkgram.y" /* yacc.c:1646 */
+#line 1673 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3733 "awkgram.c" /* yacc.c:1646 */
+#line 3758 "awkgram.c" /* yacc.c:1646 */
break;
case 158:
-#line 1650 "awkgram.y" /* yacc.c:1646 */
+#line 1675 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3739 "awkgram.c" /* yacc.c:1646 */
+#line 3764 "awkgram.c" /* yacc.c:1646 */
break;
case 159:
-#line 1652 "awkgram.y" /* yacc.c:1646 */
+#line 1677 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3745 "awkgram.c" /* yacc.c:1646 */
+#line 3770 "awkgram.c" /* yacc.c:1646 */
break;
case 160:
-#line 1654 "awkgram.y" /* yacc.c:1646 */
+#line 1679 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3751 "awkgram.c" /* yacc.c:1646 */
+#line 3776 "awkgram.c" /* yacc.c:1646 */
break;
case 161:
-#line 1659 "awkgram.y" /* yacc.c:1646 */
+#line 1684 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3759 "awkgram.c" /* yacc.c:1646 */
+#line 3784 "awkgram.c" /* yacc.c:1646 */
break;
case 162:
-#line 1663 "awkgram.y" /* yacc.c:1646 */
+#line 1688 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->opcode == Op_match_rec) {
(yyvsp[0])->opcode = Op_nomatch;
@@ -3791,37 +3816,37 @@ regular_print:
}
}
}
-#line 3795 "awkgram.c" /* yacc.c:1646 */
+#line 3820 "awkgram.c" /* yacc.c:1646 */
break;
case 163:
-#line 1695 "awkgram.y" /* yacc.c:1646 */
+#line 1720 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3801 "awkgram.c" /* yacc.c:1646 */
+#line 3826 "awkgram.c" /* yacc.c:1646 */
break;
case 164:
-#line 1697 "awkgram.y" /* yacc.c:1646 */
+#line 1722 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3811 "awkgram.c" /* yacc.c:1646 */
+#line 3836 "awkgram.c" /* yacc.c:1646 */
break;
case 165:
-#line 1703 "awkgram.y" /* yacc.c:1646 */
+#line 1728 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3821 "awkgram.c" /* yacc.c:1646 */
+#line 3846 "awkgram.c" /* yacc.c:1646 */
break;
case 166:
-#line 1709 "awkgram.y" /* yacc.c:1646 */
+#line 1734 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
@@ -3834,45 +3859,45 @@ regular_print:
if ((yyval) == NULL)
YYABORT;
}
-#line 3838 "awkgram.c" /* yacc.c:1646 */
+#line 3863 "awkgram.c" /* yacc.c:1646 */
break;
case 169:
-#line 1724 "awkgram.y" /* yacc.c:1646 */
+#line 1749 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[-1])->opcode = Op_preincrement;
(yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1]));
}
-#line 3847 "awkgram.c" /* yacc.c:1646 */
+#line 3872 "awkgram.c" /* yacc.c:1646 */
break;
case 170:
-#line 1729 "awkgram.y" /* yacc.c:1646 */
+#line 1754 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[-1])->opcode = Op_predecrement;
(yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1]));
}
-#line 3856 "awkgram.c" /* yacc.c:1646 */
+#line 3881 "awkgram.c" /* yacc.c:1646 */
break;
case 171:
-#line 1734 "awkgram.y" /* yacc.c:1646 */
+#line 1759 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3864 "awkgram.c" /* yacc.c:1646 */
+#line 3889 "awkgram.c" /* yacc.c:1646 */
break;
case 172:
-#line 1738 "awkgram.y" /* yacc.c:1646 */
+#line 1763 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3872 "awkgram.c" /* yacc.c:1646 */
+#line 3897 "awkgram.c" /* yacc.c:1646 */
break;
case 173:
-#line 1742 "awkgram.y" /* yacc.c:1646 */
+#line 1767 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->lasti->opcode == Op_push_i
&& ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0
@@ -3887,11 +3912,11 @@ regular_print:
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
}
-#line 3891 "awkgram.c" /* yacc.c:1646 */
+#line 3916 "awkgram.c" /* yacc.c:1646 */
break;
case 174:
-#line 1757 "awkgram.y" /* yacc.c:1646 */
+#line 1782 "awkgram.y" /* yacc.c:1646 */
{
/*
* was: $$ = $2
@@ -3901,20 +3926,20 @@ regular_print:
(yyvsp[-1])->memory = make_number(0.0);
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
-#line 3905 "awkgram.c" /* yacc.c:1646 */
+#line 3930 "awkgram.c" /* yacc.c:1646 */
break;
case 175:
-#line 1770 "awkgram.y" /* yacc.c:1646 */
+#line 1795 "awkgram.y" /* yacc.c:1646 */
{
func_use((yyvsp[0])->lasti->func_name, FUNC_USE);
(yyval) = (yyvsp[0]);
}
-#line 3914 "awkgram.c" /* yacc.c:1646 */
+#line 3939 "awkgram.c" /* yacc.c:1646 */
break;
case 176:
-#line 1775 "awkgram.y" /* yacc.c:1646 */
+#line 1800 "awkgram.y" /* yacc.c:1646 */
{
/* indirect function call */
INSTRUCTION *f, *t;
@@ -3948,11 +3973,11 @@ regular_print:
(yyval) = list_prepend((yyvsp[0]), t);
at_seen = false;
}
-#line 3952 "awkgram.c" /* yacc.c:1646 */
+#line 3977 "awkgram.c" /* yacc.c:1646 */
break;
case 177:
-#line 1812 "awkgram.y" /* yacc.c:1646 */
+#line 1837 "awkgram.y" /* yacc.c:1646 */
{
NODE *n;
@@ -3977,49 +4002,49 @@ regular_print:
(yyval) = list_append(t, (yyvsp[-3]));
}
}
-#line 3981 "awkgram.c" /* yacc.c:1646 */
+#line 4006 "awkgram.c" /* yacc.c:1646 */
break;
case 178:
-#line 1840 "awkgram.y" /* yacc.c:1646 */
+#line 1865 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3987 "awkgram.c" /* yacc.c:1646 */
+#line 4012 "awkgram.c" /* yacc.c:1646 */
break;
case 179:
-#line 1842 "awkgram.y" /* yacc.c:1646 */
+#line 1867 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3993 "awkgram.c" /* yacc.c:1646 */
+#line 4018 "awkgram.c" /* yacc.c:1646 */
break;
case 180:
-#line 1847 "awkgram.y" /* yacc.c:1646 */
+#line 1872 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3999 "awkgram.c" /* yacc.c:1646 */
+#line 4024 "awkgram.c" /* yacc.c:1646 */
break;
case 181:
-#line 1849 "awkgram.y" /* yacc.c:1646 */
+#line 1874 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 4005 "awkgram.c" /* yacc.c:1646 */
+#line 4030 "awkgram.c" /* yacc.c:1646 */
break;
case 182:
-#line 1854 "awkgram.y" /* yacc.c:1646 */
+#line 1879 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 4011 "awkgram.c" /* yacc.c:1646 */
+#line 4036 "awkgram.c" /* yacc.c:1646 */
break;
case 183:
-#line 1856 "awkgram.y" /* yacc.c:1646 */
+#line 1881 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 4019 "awkgram.c" /* yacc.c:1646 */
+#line 4044 "awkgram.c" /* yacc.c:1646 */
break;
case 184:
-#line 1863 "awkgram.y" /* yacc.c:1646 */
+#line 1888 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = (yyvsp[0])->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated expressions */
@@ -4033,11 +4058,11 @@ regular_print:
sub_counter++; /* count # of dimensions */
(yyval) = (yyvsp[0]);
}
-#line 4037 "awkgram.c" /* yacc.c:1646 */
+#line 4062 "awkgram.c" /* yacc.c:1646 */
break;
case 185:
-#line 1880 "awkgram.y" /* yacc.c:1646 */
+#line 1905 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *t = (yyvsp[-1]);
if ((yyvsp[-1]) == NULL) {
@@ -4051,31 +4076,31 @@ regular_print:
(yyvsp[0])->sub_count = count_expressions(&t, false);
(yyval) = list_append(t, (yyvsp[0]));
}
-#line 4055 "awkgram.c" /* yacc.c:1646 */
+#line 4080 "awkgram.c" /* yacc.c:1646 */
break;
case 186:
-#line 1897 "awkgram.y" /* yacc.c:1646 */
+#line 1922 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 4061 "awkgram.c" /* yacc.c:1646 */
+#line 4086 "awkgram.c" /* yacc.c:1646 */
break;
case 187:
-#line 1899 "awkgram.y" /* yacc.c:1646 */
+#line 1924 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 4069 "awkgram.c" /* yacc.c:1646 */
+#line 4094 "awkgram.c" /* yacc.c:1646 */
break;
case 188:
-#line 1906 "awkgram.y" /* yacc.c:1646 */
+#line 1931 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 4075 "awkgram.c" /* yacc.c:1646 */
+#line 4100 "awkgram.c" /* yacc.c:1646 */
break;
case 189:
-#line 1911 "awkgram.y" /* yacc.c:1646 */
+#line 1936 "awkgram.y" /* yacc.c:1646 */
{
char *var_name = (yyvsp[0])->lextok;
@@ -4083,22 +4108,22 @@ regular_print:
(yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new);
(yyval) = list_create((yyvsp[0]));
}
-#line 4087 "awkgram.c" /* yacc.c:1646 */
+#line 4112 "awkgram.c" /* yacc.c:1646 */
break;
case 190:
-#line 1919 "awkgram.y" /* yacc.c:1646 */
+#line 1944 "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 4098 "awkgram.c" /* yacc.c:1646 */
+#line 4123 "awkgram.c" /* yacc.c:1646 */
break;
case 191:
-#line 1929 "awkgram.y" /* yacc.c:1646 */
+#line 1954 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = (yyvsp[0])->nexti;
if (ip->opcode == Op_push
@@ -4110,73 +4135,73 @@ regular_print:
} else
(yyval) = (yyvsp[0]);
}
-#line 4114 "awkgram.c" /* yacc.c:1646 */
+#line 4139 "awkgram.c" /* yacc.c:1646 */
break;
case 192:
-#line 1941 "awkgram.y" /* yacc.c:1646 */
+#line 1966 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_append((yyvsp[-1]), (yyvsp[-2]));
if ((yyvsp[0]) != NULL)
mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 4124 "awkgram.c" /* yacc.c:1646 */
+#line 4149 "awkgram.c" /* yacc.c:1646 */
break;
case 193:
-#line 1950 "awkgram.y" /* yacc.c:1646 */
+#line 1975 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postincrement;
}
-#line 4132 "awkgram.c" /* yacc.c:1646 */
+#line 4157 "awkgram.c" /* yacc.c:1646 */
break;
case 194:
-#line 1954 "awkgram.y" /* yacc.c:1646 */
+#line 1979 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postdecrement;
}
-#line 4140 "awkgram.c" /* yacc.c:1646 */
+#line 4165 "awkgram.c" /* yacc.c:1646 */
break;
case 195:
-#line 1957 "awkgram.y" /* yacc.c:1646 */
+#line 1982 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 4146 "awkgram.c" /* yacc.c:1646 */
+#line 4171 "awkgram.c" /* yacc.c:1646 */
break;
case 197:
-#line 1965 "awkgram.y" /* yacc.c:1646 */
+#line 1990 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4152 "awkgram.c" /* yacc.c:1646 */
+#line 4177 "awkgram.c" /* yacc.c:1646 */
break;
case 198:
-#line 1969 "awkgram.y" /* yacc.c:1646 */
+#line 1994 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4158 "awkgram.c" /* yacc.c:1646 */
+#line 4183 "awkgram.c" /* yacc.c:1646 */
break;
case 201:
-#line 1978 "awkgram.y" /* yacc.c:1646 */
+#line 2003 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4164 "awkgram.c" /* yacc.c:1646 */
+#line 4189 "awkgram.c" /* yacc.c:1646 */
break;
case 202:
-#line 1982 "awkgram.y" /* yacc.c:1646 */
+#line 2007 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); yyerrok; }
-#line 4170 "awkgram.c" /* yacc.c:1646 */
+#line 4195 "awkgram.c" /* yacc.c:1646 */
break;
case 203:
-#line 1986 "awkgram.y" /* yacc.c:1646 */
+#line 2011 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4176 "awkgram.c" /* yacc.c:1646 */
+#line 4201 "awkgram.c" /* yacc.c:1646 */
break;
-#line 4180 "awkgram.c" /* yacc.c:1646 */
+#line 4205 "awkgram.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -4404,7 +4429,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 1988 "awkgram.y" /* yacc.c:1906 */
+#line 2013 "awkgram.y" /* yacc.c:1906 */
struct token {
@@ -5585,6 +5610,10 @@ get_comment(int flag)
} else
break;
}
+
+ if (comment != NULL)
+ prior_comment = comment;
+
comment = bcalloc(Op_comment, 1, sl);
comment->source_file = source;
comment->memory = make_str_node(tokstart, tok - tokstart, 0);
@@ -5602,20 +5631,20 @@ split_comment(void)
int l;
NODE *n;
- p = comment->memory->stptr;
- l = comment->memory->stlen - 3;
+ p = comment_to_save->memory->stptr;
+ l = comment_to_save->memory->stlen - 3;
/* have at least two comments so split at last blank line (\n\n) */
while (l >= 0) {
if (p[l] == '\n' && p[l+1] == '\n') {
- function_comment = comment;
+ function_comment = comment_to_save;
n = function_comment->memory;
function_comment->memory = make_str_node(p + l + 2, n->stlen - l - 2, 0);
/* create program comment */
program_comment = bcalloc(Op_comment, 1, sourceline);
- program_comment->source_file = comment->source_file;
+ program_comment->source_file = comment_to_save->source_file;
p[l + 2] = 0;
program_comment->memory = make_str_node(p, l + 2, 0);
- comment = NULL;
+ comment_to_save = NULL;
freenode(n);
break;
}
@@ -8393,6 +8422,26 @@ list_merge(INSTRUCTION *l1, INSTRUCTION *l2)
return l1;
}
+/* add_pending_comment --- add a pending comment to a statement */
+
+static inline INSTRUCTION *
+add_pending_comment(INSTRUCTION *stmt)
+{
+ INSTRUCTION *ret = stmt;
+
+ if (prior_comment != NULL) {
+ if (function_comment != prior_comment)
+ ret = list_append(stmt, prior_comment);
+ prior_comment = NULL;
+ } else if (comment != NULL && comment->memory->comment_type == EOL_COMMENT) {
+ if (function_comment != comment)
+ ret = list_append(stmt, comment);
+ comment = NULL;
+ }
+
+ return ret;
+}
+
/* See if name is a special token. */
int
diff --git a/awkgram.y b/awkgram.y
index 593eddd8..0f92786b 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -151,6 +151,8 @@ static INSTRUCTION *ip_beginfile;
INSTRUCTION *main_beginfile;
static INSTRUCTION *comment = NULL;
+static INSTRUCTION *prior_comment = NULL;
+static INSTRUCTION *comment_to_save = NULL;
static INSTRUCTION *program_comment = NULL;
static INSTRUCTION *function_comment = NULL;
static INSTRUCTION *block_comment = NULL;
@@ -162,6 +164,7 @@ static inline INSTRUCTION *list_create(INSTRUCTION *x);
static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x);
static inline INSTRUCTION *list_prepend(INSTRUCTION *l, INSTRUCTION *x);
static inline INSTRUCTION *list_merge(INSTRUCTION *l1, INSTRUCTION *l2);
+static inline INSTRUCTION *add_pending_comment(INSTRUCTION *stmt);
extern double fmod(double x, double y);
@@ -439,13 +442,22 @@ function_prologue
* than one such comments, treat the last as a function
* comment.
*/
- if (comment != NULL && func_first
- && strstr(comment->memory->stptr, "\n\n") != NULL)
+ if (prior_comment != NULL) {
+ comment_to_save = prior_comment;
+ prior_comment = NULL;
+ } else if (comment != NULL) {
+ comment_to_save = comment;
+ comment = NULL;
+ } else
+ comment_to_save = NULL;
+
+ if (comment_to_save != NULL && func_first
+ && strstr(comment_to_save->memory->stptr, "\n\n") != NULL)
split_comment();
/* save any other pre-function comment as function comment */
- if (comment != NULL) {
- function_comment = comment;
- comment = NULL;
+ if (comment_to_save != NULL) {
+ function_comment = comment_to_save;
+ comment_to_save = NULL;
}
func_first = false;
$1->source_file = source;
@@ -890,6 +902,7 @@ regular_loop:
$$ = list_prepend($1, instruction(Op_exec_count));
else
$$ = $1;
+ $$ = add_pending_comment($$);
}
;
@@ -901,6 +914,7 @@ non_compound_stmt
_("`break' is not allowed outside a loop or switch"));
$1->target_jmp = NULL;
$$ = list_create($1);
+ $$ = add_pending_comment($$);
}
| LEX_CONTINUE statement_term
@@ -910,6 +924,7 @@ non_compound_stmt
_("`continue' is not allowed outside a loop"));
$1->target_jmp = NULL;
$$ = list_create($1);
+ $$ = add_pending_comment($$);
}
| LEX_NEXT statement_term
@@ -920,6 +935,7 @@ non_compound_stmt
_("`next' used in %s action"), ruletab[rule]);
$1->target_jmp = ip_rec;
$$ = list_create($1);
+ $$ = add_pending_comment($$);
}
| LEX_NEXTFILE statement_term
{
@@ -931,6 +947,7 @@ non_compound_stmt
$1->target_newfile = ip_newfile;
$1->target_endfile = ip_endfile;
$$ = list_create($1);
+ $$ = add_pending_comment($$);
}
| LEX_EXIT opt_exp statement_term
{
@@ -946,6 +963,7 @@ non_compound_stmt
$$->nexti->memory = dupnode(Nnull_string);
} else
$$ = list_append($2, $1);
+ $$ = add_pending_comment($$);
}
| LEX_RETURN
{
@@ -970,6 +988,7 @@ non_compound_stmt
$$ = list_append($3, $1);
}
+ $$ = add_pending_comment($$);
}
| simple_stmt statement_term
;
@@ -1079,6 +1098,7 @@ regular_print:
}
}
}
+ $$ = add_pending_comment($$);
}
| LEX_DELETE NAME { sub_counter = 0; } delete_subscript_list
@@ -1113,6 +1133,7 @@ regular_print:
$1->expr_count = sub_counter;
$$ = list_append(list_append($4, $2), $1);
}
+ $$ = add_pending_comment($$);
}
| LEX_DELETE '(' NAME ')'
/*
@@ -1143,9 +1164,13 @@ regular_print:
else if ($3->memory == func_table)
fatal(_("`delete' is not allowed with FUNCTAB"));
}
+ $$ = add_pending_comment($$);
}
| exp
- { $$ = optimize_assignment($1); }
+ {
+ $$ = optimize_assignment($1);
+ $$ = add_pending_comment($$);
+ }
;
opt_simple_stmt
@@ -3165,6 +3190,10 @@ get_comment(int flag)
} else
break;
}
+
+ if (comment != NULL)
+ prior_comment = comment;
+
comment = bcalloc(Op_comment, 1, sl);
comment->source_file = source;
comment->memory = make_str_node(tokstart, tok - tokstart, 0);
@@ -3182,20 +3211,20 @@ split_comment(void)
int l;
NODE *n;
- p = comment->memory->stptr;
- l = comment->memory->stlen - 3;
+ p = comment_to_save->memory->stptr;
+ l = comment_to_save->memory->stlen - 3;
/* have at least two comments so split at last blank line (\n\n) */
while (l >= 0) {
if (p[l] == '\n' && p[l+1] == '\n') {
- function_comment = comment;
+ function_comment = comment_to_save;
n = function_comment->memory;
function_comment->memory = make_str_node(p + l + 2, n->stlen - l - 2, 0);
/* create program comment */
program_comment = bcalloc(Op_comment, 1, sourceline);
- program_comment->source_file = comment->source_file;
+ program_comment->source_file = comment_to_save->source_file;
p[l + 2] = 0;
program_comment->memory = make_str_node(p, l + 2, 0);
- comment = NULL;
+ comment_to_save = NULL;
freenode(n);
break;
}
@@ -5973,6 +6002,26 @@ list_merge(INSTRUCTION *l1, INSTRUCTION *l2)
return l1;
}
+/* add_pending_comment --- add a pending comment to a statement */
+
+static inline INSTRUCTION *
+add_pending_comment(INSTRUCTION *stmt)
+{
+ INSTRUCTION *ret = stmt;
+
+ if (prior_comment != NULL) {
+ if (function_comment != prior_comment)
+ ret = list_append(stmt, prior_comment);
+ prior_comment = NULL;
+ } else if (comment != NULL && comment->memory->comment_type == EOL_COMMENT) {
+ if (function_comment != comment)
+ ret = list_append(stmt, comment);
+ comment = NULL;
+ }
+
+ return ret;
+}
+
/* See if name is a special token. */
int
diff --git a/profile.c b/profile.c
index 43875600..f55ad287 100644
--- a/profile.c
+++ b/profile.c
@@ -26,7 +26,7 @@
#include "awk.h"
static void pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags);
-static void end_line(INSTRUCTION *ip);
+static INSTRUCTION *end_line(INSTRUCTION *ip);
static void pp_parenthesize(NODE *n);
static void parenthesize(int type, NODE *left, NODE *right);
static char *pp_list(int nargs, const char *paren, const char *delim);
@@ -207,6 +207,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
char *tmp;
int rule;
static int rule_count[MAXRULE];
+ static bool skip_comment = false;
for (pc = startp; pc != endp; pc = pc->nexti) {
if (pc->source_line > 0)
@@ -214,8 +215,13 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
/* skip leading EOL comment as it has already been printed */
if (pc->opcode == Op_comment
- && pc->memory->comment_type == EOL_COMMENT)
+ && pc->memory->comment_type == EOL_COMMENT
+ && skip_comment) {
+ skip_comment = false;
continue;
+ }
+ skip_comment = false;
+
switch (pc->opcode) {
case Op_rule:
/*
@@ -246,6 +252,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
}
fprintf(prof_fp, "%s {", ruletab[rule]);
end_line(pc);
+ skip_comment = true;
} else {
if (do_profile && ! rule_count[rule]++)
fprintf(prof_fp, _("\t# Rule(s)\n\n"));
@@ -268,6 +275,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
fprintf(prof_fp, " # %ld", ip1->exec_count);
end_line(ip1);
+ skip_comment = true;
} else {
fprintf(prof_fp, "{\n");
ip1 = (pc + 1)->firsti;
@@ -366,7 +374,7 @@ cleanup:
pp_free(t2);
pp_free(t1);
if ((flags & IN_FOR_HEADER) == 0)
- end_line(pc);
+ pc = end_line(pc);
break;
default:
@@ -492,7 +500,7 @@ cleanup:
pp_free(t2);
pp_free(t1);
if ((flags & IN_FOR_HEADER) == 0)
- end_line(pc);
+ pc = end_line(pc);
break;
case Op_concat:
@@ -513,7 +521,7 @@ cleanup:
} else
fprintf(prof_fp, "%s %s", op2str(Op_K_delete), array);
if ((flags & IN_FOR_HEADER) == 0)
- end_line(pc);
+ pc = end_line(pc);
pp_free(t1);
}
break;
@@ -625,7 +633,7 @@ cleanup:
fprintf(prof_fp, "%s%s", op2str(pc->opcode), tmp);
efree(tmp);
if ((flags & IN_FOR_HEADER) == 0)
- end_line(pc);
+ pc = end_line(pc);
break;
case Op_push_re:
@@ -734,7 +742,8 @@ cleanup:
case Op_K_break:
case Op_K_nextfile:
case Op_K_next:
- fprintf(prof_fp, "%s\n", op2str(pc->opcode));
+ fprintf(prof_fp, "%s", op2str(pc->opcode));
+ pc = end_line(pc);
break;
case Op_K_return:
@@ -742,8 +751,10 @@ cleanup:
t1 = pp_pop();
if (is_binary(t1->type))
pp_parenthesize(t1);
- if (pc->source_line > 0) /* don't print implicit 'return' at end of function */
- fprintf(prof_fp, "%s %s\n", op2str(pc->opcode), t1->pp_str);
+ if (pc->source_line > 0) { /* don't print implicit 'return' at end of function */
+ fprintf(prof_fp, "%s %s", op2str(pc->opcode), t1->pp_str);
+ pc = end_line(pc);
+ }
pp_free(t1);
break;
@@ -751,7 +762,7 @@ cleanup:
t1 = pp_pop();
fprintf(prof_fp, "%s", t1->pp_str);
if ((flags & IN_FOR_HEADER) == 0)
- end_line(pc);
+ pc = end_line(pc);
pp_free(t1);
break;
@@ -878,10 +889,13 @@ cleanup:
indent(pc->stmt_start->exec_count);
if (pc->opcode == Op_K_case) {
t1 = pp_pop();
- fprintf(prof_fp, "%s %s:\n", op2str(pc->opcode), t1->pp_str);
+ fprintf(prof_fp, "%s %s:", op2str(pc->opcode), t1->pp_str);
+ pc = end_line(pc);
pp_free(t1);
- } else
- fprintf(prof_fp, "%s:\n", op2str(pc->opcode));
+ } else {
+ fprintf(prof_fp, "%s:", op2str(pc->opcode));
+ pc = end_line(pc);
+ }
indent_in();
pprint(pc->stmt_start->nexti, pc->stmt_end->nexti, NO_PPRINT_FLAGS);
indent_out();
@@ -996,17 +1010,21 @@ cleanup:
/* end_line --- end pretty print line with new line or on-line comment */
-void
+INSTRUCTION *
end_line(INSTRUCTION *ip)
{
+ INSTRUCTION *ret = ip;
+
if (ip->nexti->opcode == Op_comment
&& ip->nexti->memory->comment_type == EOL_COMMENT) {
fprintf(prof_fp, "\t");
print_comment(ip->nexti, -1);
- ip = ip->nexti->nexti;
+ ret = ip->nexti;
}
else
fprintf(prof_fp, "\n");
+
+ return ret;
}
/* pp_string_fp --- printy print a string to the fp */
@@ -1736,7 +1754,12 @@ pp_func(INSTRUCTION *pc, void *data ATTRIBUTE_UNUSED)
if (j < pcount - 1)
fprintf(prof_fp, ", ");
}
- fprintf(prof_fp, ")\n");
+ if (fp->opcode == Op_comment
+ && fp->memory->comment_type == EOL_COMMENT) {
+ fprintf(prof_fp, ")");
+ fp = end_line(fp);
+ } else
+ fprintf(prof_fp, ")\n");
if (do_profile)
indent(0);
fprintf(prof_fp, "{\n");
diff --git a/test/profile5.ok b/test/profile5.ok
index 95c77401..272336b3 100644
--- a/test/profile5.ok
+++ b/test/profile5.ok
@@ -67,7 +67,7 @@ BEGIN {
for (; i < 256; i++) {
_QSTR[_CHR[i]] = _QSTRQ[_CHR[i]]
}
- _QSTR["\\"] = "\\\\"
+ _QSTR["\\"] = "\\\\" #; _QSTR["\""]="\\\""
#_____________________________________________________________________________
_CHR["CR"] = "\r"
@@ -704,6 +704,7 @@ END {
#_______________________________________________________________________
function W(p, p0, p1)
{
+ #####################################################
if (isarray(p0)) {
delete p0[p]
if (isarray(p1)) {
@@ -815,6 +816,7 @@ function _BASE(c, t, P, A)
#____________________________________________________________________________
function _DS(c, t, P, a, A)
{
+ ######################################################
switch (c) {
case "_lib_CMDLN":
#___________________________________________________________
@@ -840,6 +842,7 @@ function _DS(c, t, P, a, A)
#______________________________________________________________________________________________
function _END()
{
+ #################################################################################
}
########################################################
@@ -914,6 +917,7 @@ function _ERRLOG(c, t, P, a, b, A)
#______________________________________________________________________________________________
function _EXIT()
{
+ ################################################################################
}
########################################################
@@ -992,13 +996,15 @@ function _FILEIO(c, t, P, A)
}
}
-#_____________________________________________________________________________
+############################################################
function _FILEVER(c, t, P, a, A)
{
+ #################################################
switch (c) {
case "_lib_CMDLN":
#___________________________________________________________
return t
+ #_____________________________________________________________________________
#_____________________________________________________
case "_lib_APPLY":
return
@@ -1031,6 +1037,7 @@ function _INIT(f)
#___________________________________________________________________________________
function _INITBASE()
{
+ ################################################################
_egawk_utilpath = ENVIRON["EGAWK_PATH"] "BIN\\UTIL\\"
}
@@ -1072,6 +1079,7 @@ function _INSTRUC(c, t, P)
#_____________________________________________________________________________
function _N(F, v, p)
{
+ ###########################################################
for (p in _UIDS) {
delete _UIDS[p]
return _nN_i0(p, F, v)
@@ -1111,6 +1119,7 @@ function _SHORTCUT(c, t, P)
#______________________________________________________________________________________________
function _START(t, i, A)
{
+ #########################################################################
_torexp_init()
test_uid()
return
@@ -1273,6 +1282,7 @@ function _W(p, A, v)
#_______________________________________________________________________
function _Zexparr(S, s, t, i)
{
+ ##############################################
t = ""
if (isarray(S)) {
for (i in S) {
@@ -1324,6 +1334,7 @@ function _Zexparr_i3(t)
#_______________________________________________________________________
function _Zimparr(D, t, A, B)
{
+ ##############################################
if (isarray(D)) {
split(t, A, /\x10/, B)
t = _Zimparr_i0(A, B, _Zimparr_i1(D, A, B, 1))
@@ -1374,6 +1385,7 @@ function _Zimparr_i2(t)
#_____________________________________________________________________________
function _Zimport(t, p, A, c, i, n, B)
{
+ ##############################################
if (p) {
c = split(t, B, /\x0A/)
for (i = 1; i <= c; i++) {
@@ -1446,6 +1458,7 @@ function _accmpu(A, a, n)
#_______________________________________________________________________
function _add(S, sf, D, df)
{
+ ################################################
if (sf in S) {
if (isarray(S[sf])) {
if (df in D) {
@@ -1469,6 +1482,7 @@ function _add(S, sf, D, df)
#_________________________________________________________________
function _addarr(D, S)
{
+ #############################################
if (isarray(S)) {
_addarr_i0(D, S)
}
@@ -1493,6 +1507,7 @@ function _addarr_i0(D, S, i)
#_______________________________________________________________________
function _addarrmask(D, S, M)
{
+ #############################################
for (_addarrmaski0 in M) {
if (_addarrmaski0 in S) {
if (isarray(S[_addarrmaski0])) {
@@ -1525,12 +1540,14 @@ function _addarrmask(D, S, M)
#_______________________________________________________________________
function _addf(A, f)
{
+ #####################################################
A["B"][""] = A["F"][A["B"][f] = A["B"][""]] = f
}
#___________________________________________________________
function _addfile(f, d, a, b)
{
+ ##################################
if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") {
ERRNO = "Filename error"
return
@@ -1556,6 +1573,7 @@ function _addfile(f, d, a, b)
#_____________________________________________________________________________
function _addlib(f)
{
+ ###########################################################
_addf(_LIBAPI, f)
}
@@ -1566,20 +1584,24 @@ function _addlib(f)
#_______________________________________________________________________
function _addlist(A, v)
{
+ ##################################################
A[++A[0]] = v
}
-#_______________________________________________________________________
+############################################
function _bearray(A)
{
+ ####################################################
if (isarray(A) || A == 0 && A == "") {
return 1
+ #_______________________________________________________________________
}
}
#_________________________________________________________________
function _bframe(A, t, p)
{
+ ###########################################
return _bframe_i0(A, t, p, A[""])
}
@@ -1611,6 +1633,7 @@ function _bframe_i0(A, t, p, f)
#_______________________________________________________________________
function _cfguid(p, optr, pfx, sfx, hstrcnt, lstrchr)
{
+ #################### 0 #
delete _UIDOBL[p]
if (_isptr(optr)) {
if (optr == p) {
@@ -1677,6 +1700,7 @@ function _cfguidl(p, H, L, hi, h, hl, li)
#____________________________________________________________________________________________________
function _check(p)
{
+ ####################################################################################
_dll_check(p)
_file_check(p)
_serv_check(p)
@@ -1686,12 +1710,14 @@ function _check(p)
#_______________________________________________________________________
function _chrline(t, ts, w, s)
{
+ #############################################
return ((t = " " _tabtospc(t, ts) ((t ? (t ~ /[ \t]$/ ? "" : " ") : ""))) _getchrln((s ? s : "_"), ((w ? w : _CON_WIDTH - 1)) - length(t)) _CHR["EOL"])
}
#_____________________________________________________________________________
function _cmd(c, i, A)
{
+ #######################################################
_fio_cmda = RS
RS = ".{1,}"
_fio_cmdb = BINMODE
@@ -1709,6 +1735,7 @@ function _cmd(c, i, A)
#_______________________________________________________________________
function _cmparr(A0, A1, R, a, i)
{
+ ##########################################
a = 0
delete R
for (i in A0) {
@@ -1732,6 +1759,7 @@ function _cmparr(A0, A1, R, a, i)
#_____________________________________________________________________________
function _con(t, ts, a, b, c, d, i, r, A, B)
{
+ ##########################################
d = RLENGTH
if ((c = split(r = t, A, /\x0D?\x0A/, B)) > 0) {
a = BINMODE
@@ -1773,6 +1801,7 @@ function _con(t, ts, a, b, c, d, i, r, A, B)
#_______________________________________________________________________
function _conin(t, a, b)
{
+ #################################################
_constatpush()
_constat()
a = BINMODE
@@ -1794,12 +1823,14 @@ function _conin(t, a, b)
#_______________________________________________________________________
function _conl(t, ts)
{
+ ####################################################
return _con(t ((t ~ /\x0A$/ ? "" : _CHR["EOL"])), ts)
}
#_______________________________________________________________________
function _conline(t, ts)
{
+ #################################################
return _con(_chrline(t, ts))
}
@@ -1816,6 +1847,7 @@ function _conlq(t, ts)
#_______________________________________________________________________
function _constat(t, ts, ln, a)
{
+ ###########################################
if (_constatstrln > (ln = length(t = _constatgtstr(_constatstr = _tabtospc(t, ts), _CON_WIDTH - 1 - _conlastrln)))) {
t = t _getchrln(" ", _constatstrln - ln)
}
@@ -1852,6 +1884,7 @@ function _constatgtstr(t, ln, a, b)
#_______________________________________________________________________
function _constatpop()
{
+ ##################################################
if (_CONSTATPUSH[0] > 0) {
return _constat(_CONSTATPUSH[_CONSTATPUSH[0]--])
}
@@ -1861,6 +1894,7 @@ function _constatpop()
#_______________________________________________________________________
function _constatpush(t, ts)
{
+ #############################################
_CONSTATPUSH[++_CONSTATPUSH[0]] = _constatstr
if (t) {
_constat(t, ts)
@@ -1877,6 +1911,7 @@ function _creport(p, t, f, z)
#_________________________________________________________________________________________
function _defdir(pp, n, f, v, p)
{
+ #############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defdir"))]["NAME"] = n
_[p]["DIR"] = f
return p
@@ -1885,6 +1920,7 @@ function _defdir(pp, n, f, v, p)
#_________________________________________________________________________________________
function _defdll(pp, n, rn, p)
{
+ ##############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defdll"))]["NAME"] = n
_[p]["REGPATH"] = _[pp]["REGPATH"] rn
_[p]["ERRHOST"] = pp
@@ -1921,6 +1957,7 @@ function _defescarr(D, r, S, i, c, t)
#_________________________________________________________________________________________
function _defile(pp, n, f, v, p)
{
+ #############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defile"))]["NAME"] = n
_[p]["FILE"] = f
if (! (v == 0 && v == "")) {
@@ -1932,12 +1969,14 @@ function _defile(pp, n, f, v, p)
#_______________________________________________________________________
function _defn(f, c, v)
{
+ ###################################################
FUNCTAB[c f] = v
}
#_________________________________________________________________________________________
function _defreg(pp, n, f, v, p)
{
+ #############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defreg"))]["NAME"] = n
_[p]["REGPATH"] = f
if (! (v == 0 && v == "")) {
@@ -1948,6 +1987,7 @@ function _defreg(pp, n, f, v, p)
#_______________________________________________________________________________________________
function _defsolution(pp, n, rn, p)
{
+ ###############################################################
_[p = _wLCHLD(pp, _n("TYPE", "solution"))]["NAME"] = n
_[p]["REGPATH"] = rn
_[p]["ERRHOST"] = pp
@@ -1957,6 +1997,7 @@ function _defsolution(pp, n, rn, p)
#_________________________________________________________________________________________
function _defsrv(pp, n, f, v, p)
{
+ #############################################################
_[p = _wLCHLD(pp, _n("TYPE", "defsrv"))]["NAME"] = n
_[p]["SERVNAME"] = f
return p
@@ -1965,6 +2006,7 @@ function _defsrv(pp, n, f, v, p)
#_______________________________________________________________________
function _del(f, c, a, A)
{
+ #################################################
if (match(f, /\\[ \t]*$/)) {
if ((c = toupper(_filerd(f))) && length(f) == FLENGTH) {
_cmd("rd " c " /S /Q 2>NUL")
@@ -1993,6 +2035,7 @@ function _del(f, c, a, A)
#_______________________________________________________________________
function _delay(t, a)
{
+ ###################################################
for (a = 1; a <= t; a++) {
_delayms()
}
@@ -2001,6 +2044,7 @@ function _delay(t, a)
#_________________________________________________________________
function _delayms(a)
{
+ #############################################
for (a = 1; a <= _delay_perfmsdelay; a++) {
}
}
@@ -2008,6 +2052,7 @@ function _delayms(a)
#_______________________________________________________________________
function _deletepfx(A, f, B, le, i)
{
+ ########################################
le = length(f)
for (i in A) {
if (substr(toupper(i), 1, le) == f) {
@@ -2020,6 +2065,7 @@ function _deletepfx(A, f, B, le, i)
#_________________________________________________________________
function _delf(A, f)
{
+ ###############################################
A["B"][A["F"][A["B"][f]] = A["F"][f]] = A["B"][f]
delete A["F"][f]
delete A["B"][f]
@@ -2028,6 +2074,7 @@ function _delf(A, f)
#_______________________________________________________________________
function _deluid(p)
{
+ ################################################# 1 #
if (p in _CLASSPTR) {
_deluida0 = _CLASSPTR[p]
if (_deluida0 in _UIDOBL) {
@@ -2041,6 +2088,7 @@ function _deluid(p)
#_______________________________________________________________________
function _dir(A, rd, i, r, f, ds, pf, B, C)
{
+ ####################################
delete A
gsub(/(^[ \t]*)|([ \t]*$)/, "", rd)
if (rd == "") {
@@ -2070,6 +2118,7 @@ function _dir(A, rd, i, r, f, ds, pf, B, C)
#_________________________________________________________________
function _dirtree(A, f, B)
{
+ #########################################
gsub(/(^[ \t]*)|([ \t]*$)/, "", f)
delete A
A[""]
@@ -2137,6 +2186,7 @@ function _dll_check_i0(p, R, pp, p2, i, i2, r, f, v, rs, d, tv, tf)
}
}
}
+ #{ rs=_missfl=1; _[p]["." gensub(/^([^\\]+\\)+(.*)\..../,"\\2","G",i)]=R[i] } }
if (rs) {
if ((i = ".Install Path") in _[p] && (i = ".Product Version") in _[p]) {
_[p]["STATUS"] = "PRESENT"
@@ -2228,6 +2278,7 @@ function _drawuid(p, cn, ch, o)
#_______________________________________________________________________
function _dumparr(A, t, lv, a)
{
+ ############################################
b = PROCINFO["sorted_in"]
PROCINFO["sorted_in"] = "_lengthsort"
if (isarray(A)) {
@@ -2292,6 +2343,7 @@ function _dumparr_i1(A, lv, ls, ln, t, t2, i, a, f)
#_____________________________________________________________________________
function _dumpobj(p, f, t, s)
{
+ ###################################################
s = _dumpobj_i0(p, f, t = t "." p "{")
if (p = _rFCHLD(p)) {
return (s = s _dumpobjm(p, f, (s ? _getchrln(" ", length(t) - 1) : t " ")))
@@ -2359,12 +2411,14 @@ function _dumpobj_i4(t)
#_________________________________________________________________
function _dumpobj_nc(p, f, t)
{
+ #######################################
return _dumpobj_i0(p, f, t "." p "{ ")
}
#_________________________________________________________________
function _dumpobjm(p, f, t, s, t2)
{
+ ###################################
t2 = _getchrln(" ", length(t))
do {
s = s _dumpobj(p, f, t)
@@ -2376,6 +2430,7 @@ function _dumpobjm(p, f, t, s, t2)
#_________________________________________________________________
function _dumpobjm_nc(p, f, t, s, t2)
{
+ ################################
t2 = _getchrln(" ", length(t))
do {
s = s _dumpobj_nc(p, f, t)
@@ -2452,6 +2507,7 @@ function _endpass(t)
#_______________________________________________________________________
function _err(t, a, b)
{
+ ###################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -2466,12 +2522,14 @@ function _err(t, a, b)
#_________________________________________________________________
function _errnl(t)
{
+ ################################################
return _err(t ((t ~ /\x0A$/ ? "" : _CHR["EOL"])))
}
#_______________________________________________________________________
function _error(t, d, A)
{
+ #################################################
if (_ERRLOG_EF) {
A["TYPE"] = "ERROR"
A["TEXT"] = t
@@ -2482,12 +2540,14 @@ function _error(t, d, A)
#_______________________________________________________________________
function _exit(c)
{
+ #######################################################
exit c
}
#_____________________________________________________________________________
function _export_data(t, i, A)
{
+ #################################################
A["DATA"] = t
A["ID"] = i
_expout("_DATA: " _Zexparr(A) "\n")
@@ -2499,6 +2559,7 @@ function _export_data(t, i, A)
#_____________________________________________________________________________
function _expout(t, d, a, b)
{
+ ####################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -2521,6 +2582,7 @@ function _expout(t, d, a, b)
function _extfn_init()
{
+ ##############################################################
_formatstrs_init()
_formatstrd_init()
_formatrexp_init()
@@ -2553,6 +2615,7 @@ function _faccr_i0(A, t, p, P, f, r)
#_______________________________________________________________________
function _fatal(t, d, A)
{
+ #################################################
if (_ERRLOG_FF) {
A["TYPE"] = "FATAL"
A["TEXT"] = t
@@ -2583,10 +2646,12 @@ function _ffaccr(A, t, p, P)
return _faccr_i0(A["F"], t, p, P)
}
-#_______________________________________________________________________
+##################
function _fframe(A, t, p)
{
+ #################################################
return _fframe_i0(A, t, p, A[""])
+ #_______________________________________________________________________
}
#___________________________________________________________
@@ -2598,6 +2663,7 @@ function _fframe_i0(A, t, p, f)
#_________________________________________________________________
function _file(f)
{
+ #################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2644,6 +2710,7 @@ function _file_check_i0(p, pp, p1, p2, f, v)
#_________________________________________________________________
function _filed(f, dd, d)
{
+ ##########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2668,6 +2735,7 @@ function _filed(f, dd, d)
#_________________________________________________________________
function _filen(f)
{
+ ################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2677,6 +2745,7 @@ function _filen(f)
#_________________________________________________________________
function _filene(f)
{
+ ###############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2686,6 +2755,7 @@ function _filene(f)
#_________________________________________________________________
function _filenotexist(f, a)
{
+ ######################################
if (f == "") {
return ""
}
@@ -2703,6 +2773,7 @@ function _filenotexist(f, a)
#_______________________________________________________________________
function _filepath(f, dd)
{
+ ################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2712,6 +2783,7 @@ function _filepath(f, dd)
#_________________________________________________________________
function _filer(f, dd)
{
+ #############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2727,6 +2799,7 @@ function _filer(f, dd)
#_________________________________________________________________
function _filerd(f, dd)
{
+ ############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2736,6 +2809,7 @@ function _filerd(f, dd)
#_________________________________________________________________
function _filerdn(f, dd)
{
+ ###########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2745,6 +2819,7 @@ function _filerdn(f, dd)
#_________________________________________________________________
function _filerdne(f, dd)
{
+ ##########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2815,6 +2890,7 @@ function _filerdnehnd(st, c, r, d, n, A)
#_______________________________________________________________________
function _filexist(f, a)
{
+ ################################################
if (f == "") {
return ""
}
@@ -2833,6 +2909,7 @@ function _filexist(f, a)
#_______________________________________________________________________
function _fn(f, p0, p1, p2)
{
+ ################################################
if (f in FUNCTAB) {
return @f(p0, p1, p2)
}
@@ -2841,6 +2918,7 @@ function _fn(f, p0, p1, p2)
#_______________________________________________________________________
function _foreach(A, f, r, p0, p1, p2, i, p)
{
+ ####################################
if (isarray(A)) {
_TMP0[p = _n()]["."] = 1
_foreach_i0(A, f, _TMP0[p], p0, p1, p2)
@@ -2909,14 +2987,15 @@ function _formatstrd_init()
_FORMATSTRDESC["\t"] = "\\t"
}
-####################################################################################
-
-
-
-
-#___________________________________________________________________________________
+#__________________________________________________________________________________
function _formatstrs(t)
{
+ ####################################################################################
+
+
+
+
+ #___________________________________________________________________________________
_formatstrq0 = split(t, _FORMATSTRA, /['\x00-\x1F\x80-\xFF]/, _FORMATSTRB)
_formatstrs0 = ""
for (t = 1; t < _formatstrq0; t++) {
@@ -2978,6 +3057,7 @@ function _gen(D, t)
#_____________________________________________________________________________
function _gensubfn(t, r, f, p0, A)
{
+ ###############################################
if (match(t, r, A)) {
return (substr(t, 1, RSTART - 1) (@f(_th0(substr(t, RSTART, RLENGTH), t = substr(t, RSTART + RLENGTH)), A, p0)) _gensubfn(t, r, f, p0))
}
@@ -2987,6 +3067,7 @@ function _gensubfn(t, r, f, p0, A)
#_____________________________________________________________________________
function _get_errout(p)
{
+ #######################################################
return _tframe("_get_errout_i0", p)
}
@@ -3041,6 +3122,7 @@ function _get_errout_i3(p, t, ts, cl, cp, cr, a, b)
#_____________________________________________________________________________
function _get_logout(p)
{
+ #######################################################
return _tframe("_get_logout_i0", p)
}
@@ -3064,6 +3146,7 @@ function _get_logout_i0(p, t, n, a)
#_______________________________________________________________________
function _getchrln(s, w)
{
+ #################################################
if (s == "") {
return
}
@@ -3089,12 +3172,14 @@ function _getchrln(s, w)
#_______________________________________________________________________
function _getdate()
{
+ #####################################################
return strftime("%F")
}
#_____________________________________________________________________________
function _getfilepath(t, f, al, b, A)
{
+ ############################################
ERRNO = ""
if (match(t, /^[ \t]*(("([^"]*)"[ \t]*)|([`']([^']*)'[ \t]*)|(([^ \t]+)[ \t]*))/, A)) {
al = RLENGTH
@@ -3113,6 +3198,7 @@ function _getfilepath(t, f, al, b, A)
function _getfilever(f)
{
+ #############################################################
split(_cmd(_fileverpath " \"" f "\""), _GETFILEVERA0, /[ \t]+/)
if (_GETFILEVERA0[5]) {
return _GETFILEVERA0[5]
@@ -3122,12 +3208,14 @@ function _getfilever(f)
#_________________________________________________________________
function _getime()
{
+ ################################################
return strftime("%H:%M:%S")
}
#_________________________________________________________________
function _getmpdir(f, dd)
{
+ ##########################################
if (! dd || ! (dd = _filerd(dd))) {
dd = _FILEIO_TMPRD
}
@@ -3140,6 +3228,7 @@ function _getmpdir(f, dd)
#_________________________________________________________________
function _getmpfile(f, dd)
{
+ #########################################
if (! dd || ! (dd = _filerd(dd))) {
dd = _FILEIO_TMPRD
}
@@ -3152,6 +3241,7 @@ function _getmpfile(f, dd)
#_______________________________________________________________________
function _getperf(o, t, a)
{
+ ###############################################
(o == "" ? ++_getperf_opcurr : _getperf_opcurr = o)
if ((a = _getsecond()) != _getperf_last) {
_getperf_opsec = (_getperf_opcurr - _getperf_opstart) / ((_getperf_last = a) - _getperf_start)
@@ -3247,12 +3337,14 @@ function _getreg_i1(D, r, R, a, i, il, ir, rc, B)
#_________________________________________________________________
function _getsecond()
{
+ #############################################
return systime()
}
#___________________________________________________________
function _getsecondsync(a, c, b, c2)
{
+ ##########################
a = systime()
while (a == systime()) {
++c
@@ -3263,6 +3355,7 @@ function _getsecondsync(a, c, b, c2)
#_______________________________________________________________________
function _getuid(p)
{
+ ################################################# 1 #
if (p in _UIDOBL) {
for (_tptr in _UIDOBLV[_getuida0 = _UIDOBL[p]]) {
delete _UIDOBLV[_getuida0][_tptr]
@@ -3295,6 +3388,7 @@ function _handle8494(t)
#_____________________________________________________________________________
function _hexnum(n, l)
{
+ #########################################################
if (l + 0 < 1) {
l = 2
}
@@ -3304,6 +3398,7 @@ function _hexnum(n, l)
#_________________________________________________________________
function _igetperf(t, s, o)
{
+ ######################################### # t-test period in seconds(==0 ? no period; s(=true/false)-output/not output status; o-qnt of ops before test start
if (t == 0 && t == "" && s == 0 && s == "" && o == 0 && o == "") {
if (_getperf_fn !~ /not$/ && _constatstr == _getperf_stat) {
_constat(_getperf_statstr)
@@ -3334,6 +3429,7 @@ function _import_data(t, p, p2, a)
#_______________________________________________________________________
function _info(t, d, A)
{
+ ##################################################
if (_ERRLOG_IF) {
A["TYPE"] = "INFO"
A["TEXT"] = t
@@ -3405,6 +3501,7 @@ function _initsys()
#_______________________________________________________________________
function _inituid(p, cs, dptr, pfx, sfx, hstr, lstr, A)
{
+ ################### 1 #
if (cs == 0 && cs == "") {
cs = p
p = _getuid()
@@ -3464,6 +3561,7 @@ function _inituidefault(h, l, H, L)
#_______________________________________________________________________
function _ins(S, sf, D, df)
{
+ ################################################
if (sf in S) {
if (isarray(S[sf])) {
if (df in D) {
@@ -3487,19 +3585,22 @@ function _ins(S, sf, D, df)
#_________________________________________________________________
function _insf(A, f)
{
+ ###############################################
A["F"][""] = A["B"][A["F"][f] = A["F"][""]] = f
}
#_________________________________________________________________
function _insframe(A, f)
{
+ ###########################################
A[f] = A[""]
A[""] = f
}
-#_________________________________________________________________
+########################
function _inspass(A, f)
{
+ #_________________________________________________________________
A[f] = A[""]
A[""] = f
}
@@ -3509,6 +3610,7 @@ function _inspass(A, f)
#_______________________________________________________________________
function _isptr(p)
{
+ ################################################## 1 #
if (isarray(p)) {
is = _NOP
it = "A"
@@ -3529,6 +3631,7 @@ function _isptr(p)
#_______________________________________________________________________
function _istr(p)
{
+ ################################################### 1 #
if (isarray(p)) {
is = _NOP
it = "A"
@@ -3545,6 +3648,7 @@ function _istr(p)
#_________________________________________________________________
function _lengthsort(i1, v1, i2, v2)
{
+ ##############################
return ((length(i1) < length(i2) ? -1 : (length(i1) > length(i2) ? 1 : (i1 < i2 ? -1 : 1))))
}
@@ -3587,12 +3691,14 @@ function _lib_NAMEVER()
#_____________________________________________________________________________
function _ln(t)
{
+ ###############################################################
return ((t ~ /\x0A$/ ? t : t _CHR["EOL"]))
}
#_________________________________________________________________
function _log(A, p, a, B)
{
+ ###########################################
if (isarray(A)) {
A["TIME"] = _getime()
A["DATE"] = _getdate()
@@ -3613,6 +3719,7 @@ function _log(A, p, a, B)
#_________________________________________________________________
function _lspctab(t, ts, l, l1, l2, A)
{
+ ################################
while (match(t, /^(\t*)( *)((\t*)(.*))$/, A)) {
if (A[1, "length"] >= l) {
return substr(t, l + 1)
@@ -3654,6 +3761,7 @@ function _macsfx94(F, D, C, p1, p2, p3)
#_______________________________________________________________________
function _movarr(D, S)
{
+ ###################################################
delete D
D[""]
delete D[""]
@@ -3771,6 +3879,7 @@ function _mpusub(F, D, C, d, p1, p2, p3, q)
#_______________________________________________________________________
function _n(F, v, p)
{
+ #####################################################
for (p in _UIDSDEL) {
delete _UIDSDEL[p]
delete _ptr[p]
@@ -3827,6 +3936,7 @@ function _nN_i0(p, F, v)
#_________________________________________________________________
function _newclrdir(f)
{
+ ############################################
if ((f = _filerd(f)) == "") {
return
}
@@ -3839,6 +3949,7 @@ function _newclrdir(f)
#_______________________________________________________________________
function _newdir(f)
{
+ #####################################################
if ((f = _filerd(f)) == "") {
return
}
@@ -3849,9 +3960,10 @@ function _newdir(f)
return f
}
-#_______________________________________________________________________
+##############################
function _nop(p0, p1, p2, p3)
{
+ #_______________________________________________________________________
}
#_____________________________________________________
@@ -3872,6 +3984,7 @@ function _nop(p0, p1, p2, p3)
#_________________________________________________________________
function _nretarr(A, i, v, r, q)
{
+ #####################################
if ((i = (i == "" ? 1 : i + 0)) <= (q = A[_ARRLEN])) {
if (i <= (r = q - 16)) {
_ARRSTR = A[i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i]
@@ -3891,6 +4004,7 @@ function _nretarr(A, i, v, r, q)
#___________________________________________________________
function _nretarrd(A, i, v, r, q)
{
+ ##############################
if ((i = (i == "" ? 1 : i + 0)) <= (q = A[_ARRLEN])) {
if (i <= (r = q - 16)) {
_ARRSTR = A[i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i] A[++i]
@@ -3915,6 +4029,7 @@ function _nretarrd(A, i, v, r, q)
#___________________________________________________________________________________
function _out(t, a, b)
{
+ ###############################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -3929,6 +4044,7 @@ function _out(t, a, b)
#_________________________________________________________________
function _outnl(t)
{
+ ################################################
return _out(t ((t ~ /\x0A$/ ? "" : _CHR["EOL"])))
}
@@ -3983,6 +4099,7 @@ function _p8(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
#_______________________________________________________________________
function _pass(A, f, t, p2, i, a)
{
+ ###########################################
a = _endpass_v0
_endpass_v0 = ""
i = 1
@@ -4005,6 +4122,7 @@ function _pass(A, f, t, p2, i, a)
#_____________________________________________________________________________
function _patharr0(D, q, i, h, A, B)
{
+ ##############################################
delete D
if (0 < (q = split(gensub(/\\/, "/", "G", gensub(/ *([:$\\\/]) */, "\\1", "G", gensub(/(^[ \t]+)|([ \t]+$)/, "", "G", q))), A, /\/+/, B))) {
if (2 > (h = length(B[1]))) {
@@ -4145,6 +4263,7 @@ function _pr8(s1, s2, s3, s4, s5, s6, s7, s8, p1, p2, p3, p4, p5, p6, p7, p8)
#_________________________________________________________________
function _printarr(A, t, lv, r, a)
{
+ ####################################
a = PROCINFO["sorted_in"]
PROCINFO["sorted_in"] = "_lengthsort"
_printarrexp = (r ? r : "")
@@ -4244,6 +4363,7 @@ function _qparam_i0(p0, p1, p2, p3, p4, p5, p6, p7)
#_______________________________________________________________________
function _qstr(t, c, A, B)
{
+ ################################################
c = ""
for (t = split(t, A, /[\x00-\x1F\\"]/, B); t >= 0; t--) {
c = _QSTR[B[t]] A[t + 1] c
@@ -4254,18 +4374,21 @@ function _qstr(t, c, A, B)
#_________________________________________________________________
function _qstrq(t)
{
+ ################################################
gsub(/\\/, "\\\\", t)
gsub(/"/, "\\\"", t)
return t
}
-#_____________________________________________________________________________
+################################################################
function _rEG(c, t, P, a, A)
{
+ #####################################################
switch (c) {
case "_lib_CMDLN":
#___________________________________________________________
return t
+ #_____________________________________________________________________________
#_____________________________________________________
case "_lib_APPLY":
return
@@ -4287,6 +4410,7 @@ function _rEG(c, t, P, a, A)
#_______________________________________________________________________
function _rFBRO(p)
{
+ ######################################################
if (p) {
if (p in _tPARENT) {
return _tFCHLD[_tPARENT[p]]
@@ -4302,18 +4426,21 @@ function _rFBRO(p)
#_______________________________________________________________________
function _rFCHLD(p)
{
+ #####################################################
if (p && p in _tFCHLD) {
return _tFCHLD[p]
}
return ""
}
-#_______________________________________________________________________
+######################## p="", !v
function _rLBRO(p)
{
+ ######################################################
if (p) {
if (p in _tPARENT) {
return _tLCHLD[_tPARENT[p]]
+ #_______________________________________________________________________
}
while (p in _tNEXT) {
p = _tNEXT[p]
@@ -4323,11 +4450,13 @@ function _rLBRO(p)
return p
}
-#_______________________________________________________________________
+######################## p=""
function _rLCHLD(p)
{
+ #####################################################
if (p && p in _tLCHLD) {
return _tLCHLD[p]
+ #_______________________________________________________________________
}
return ""
}
@@ -4335,42 +4464,51 @@ function _rLCHLD(p)
#_______________________________________________________________________
function _rLINK(p)
{
+ ######################################################
return ((p in _tLINK ? _tLINK[p] : ""))
}
-#_______________________________________________________________________
+######################## p=""
function _rNEXT(p)
{
+ ######################################################
if (p && p in _tNEXT) {
return _tNEXT[p]
+ #_______________________________________________________________________
}
return ""
}
-#_______________________________________________________________________
+######################## p=""
function _rPARENT(p)
{
+ ####################################################
if (p && p in _tPARENT) {
return _tPARENT[p]
+ #_______________________________________________________________________
}
return ""
}
-#_______________________________________________________________________
+######################## p=""
function _rPREV(p)
{
+ ######################################################
if (p && p in _tPREV) {
return _tPREV[p]
+ #_______________________________________________________________________
}
return ""
}
-#_______________________________________________________________________
+######################## p=""
function _rQBRO(p, c, p1)
{
+ ################################################
if (p) {
if (p in _tPARENT) {
return _tQCHLD[_tPARENT[p]]
+ #_______________________________________________________________________
}
c = 1
p1 = p
@@ -4387,11 +4525,13 @@ function _rQBRO(p, c, p1)
return p
}
-#_______________________________________________________________________
+######################## p=""
function _rQCHLD(p)
{
+ #####################################################
if (p && p in _tQCHLD) {
return _tQCHLD[p]
+ #_______________________________________________________________________
}
return ""
}
@@ -4402,6 +4542,7 @@ function _rQCHLD(p)
#_____________________________________________________________________________
function _rSQFIRST(g, p, A)
{
+ #####################################################
if (isarray(A)) {
return _rSQFIRSTA(g, p, A)
}
@@ -4413,6 +4554,7 @@ function _rSQFIRST(g, p, A)
#_________________________________________________________________
function _rSQFIRSTA(g, p, A)
{
+ ########################################
_SQTOPTR[g] = p
_SQSTACK[g][0] = 0
if ((p = _rsqgetptr(g, p)) in A) {
@@ -4424,6 +4566,7 @@ function _rSQFIRSTA(g, p, A)
#_______________________________________________________________________
function _rSQNEXT(g, p, A)
{
+ ################################################
if (isarray(A)) {
return _rSQNEXTA(g, p, A)
}
@@ -4433,6 +4576,7 @@ function _rSQNEXT(g, p, A)
#_________________________________________________________________
function _rSQNEXTA(g, p, A)
{
+ #########################################
if (p == _SQTOPTR[g]) {
if (_SQSTACK[g][0] > 0) {
_SQTOPTR[g] = _SQSTACK[g][_SQSTACK[g][0]--]
@@ -4478,6 +4622,7 @@ function _rd_shortcut(D, f)
#_______________________________________________________________________
function _rdfile(f, i, A)
{
+ ################################################
if ((f = _filerdne(f)) == "" || _filene(f) == "") {
ERRNO = "Filename error"
return
@@ -4530,6 +4675,7 @@ function _rdfile(f, i, A)
# fn _getsecondsync()
function _rdreg(D, p)
{
+ ################################################################
_rdregp0 = "reg query \"" p "\" /S /reg:64 2>NUL"
_rdregfld = _rdregkey = 0
_rdregq0 = split(gensub(/[\x0D?\x0A]{2,}/, _CHR["EOL"], "G", _cmd(_rdregp0)), _RDREGA0, /\x0D?\x0A/)
@@ -4664,6 +4810,7 @@ function _registryinit()
#_____________________________________________________________________________
function _regpath0(D, i, s, q, S)
{
+ ############################################ 0 #
if (i = _patharr0(S, i)) {
if ("name" in S) {
D["name"] = S["name"]
@@ -4687,6 +4834,7 @@ function _regpath0(D, i, s, q, S)
#_________________________________________________________________________________________
function _report(p)
{
+ #######################################################################
_report_t0 = _reportparnt = ""
_report_i0(p)
_tframe("_report_i0", p)
@@ -4784,6 +4932,7 @@ function _reporterr(p, t3, pp, t, t2)
#_____________________________________________________________________________
function _retarr(A, i, p, a, q)
{
+ ##################################################
if (isarray(A)) {
i = (i == "" ? 0 : i + 0)
q = A[_ARRLEN] + 0
@@ -4807,6 +4956,7 @@ function _retarr_i0(A, q, i, a)
#_________________________________________________________________
function _retarrd(A, v, i)
{
+ #########################################
if (1 in A) {
return (A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8] A[9] A[10] A[11] A[12] A[13] A[14] A[15] A[16] (((i = 17) in A ? _retarrd_i0(A, i) v : v)))
}
@@ -4844,6 +4994,7 @@ function _rexpfnend(t)
#_____________________________________________________________________________
function _rexpstr(r, i, c, A)
{
+ ###################################################
c = split(r, A, "")
r = ""
for (i = 1; i <= c; i++) {
@@ -4885,6 +5036,7 @@ function _rpp(q, D, S)
#_________________________________________________________________________________________
function _rrdreg(DD, p, k, t, v, c, i, q, tT, A, B, C, D)
{
+ ############################################# old; regedit
if (! _registrytmpfile) {
_registryinit()
}
@@ -5000,13 +5152,15 @@ function _rxpfn(R, t, p, i, f, A)
return _rexpfnend(t)
}
-#_____________________________________________________________________________
+##############################################################
function _sHARE(c, t, P, a, A)
{
+ ###################################################
switch (c) {
case "_lib_CMDLN":
#___________________________________________________________
return t
+ #_____________________________________________________________________________
#_____________________________________________________
case "_lib_APPLY":
return
@@ -5025,13 +5179,15 @@ function _sHARE(c, t, P, a, A)
}
}
-#_____________________________________________________________________________
+################################################################
function _sYS(c, t, P, a, A)
{
+ #####################################################
switch (c) {
case "_lib_CMDLN":
#___________________________________________________________
return t
+ #_____________________________________________________________________________
#_____________________________________________________
case "_lib_APPLY":
return
@@ -5074,6 +5230,7 @@ function _serv_check_i0(p, p0, p1, p2, p3, i, q, c)
#_______________________________________________________________________
function _setarrsort(f, a)
{
+ ##############################################
a = PROCINFO["sorted_in"]
if (! f) {
delete PROCINFO["sorted_in"]
@@ -5086,6 +5243,7 @@ function _setarrsort(f, a)
#_______________________________________________________________________
function _setmpath(p, a)
{
+ ################################################
ERRNO = ""
if (p && (a = _filerd(p))) {
if (_FILEIO_TMPRD) {
@@ -5123,6 +5281,7 @@ function _setmpath(p, a)
function _sharelist(D, h, q, c, l, A, B)
{
+ #################################################
delete D
c = _sharextool " \\\\" ((h == "" ? h = ENVIRON["COMPUTERNAME"] : h)) " 2>&1"
if (match(c = _cmd(c), /\x0AShare[^\x0A]*Remark/)) {
@@ -5142,6 +5301,7 @@ function _sharelist(D, h, q, c, l, A, B)
#_____________________________________________________________________________
function _sharepath(h, s, A)
{
+ ###################################################
s = _sharextool " \\\\" ((h == "" ? h = ENVIRON["COMPUTERNAME"] : h)) "\\\"" s "\" 2>&1"
if (match(s = _cmd(s), /\x0APath[ \t]+([^\x0D\x0A]+)/, _SHAREPATHA0)) {
return gensub(/[ \t\\\/]*$/, "\\\\", 1, _SHAREPATHA0[1])
@@ -5151,39 +5311,47 @@ function _sharepath(h, s, A)
function _shortcut(D, S)
{
+ #############################################################
if (isarray(D)) {
if (isarray(S)) {
_addarrmask(D, S, _SHORTCUTWSTRUC)
} else if (S == 0 && S == "") {
+ # array,array2* - copy from array2 to array shorcut-specific elements
_addarrmask(D, _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
} else if (_isnotfileptr(S)) {
+ # array* - define shortcut-specific elements in array by default values
_addarrmask(D, _[S], _SHORTCUTWSTRUC)
} else if (_rd_shortcut(D, S)) {
- return
+ return # array,ptr* - copy from array _[ptr] to array shorcut-specific elements
}
} else if (D == 0 && D == "") {
- return _NOP
+ return _NOP # array,filepath* - define in array shortcut-specific elements by reading its from shortcut file filepath(load shortcut)
+ # -* - no action(return -)
} else if (_isnotfileptr(D)) {
if (isarray(S)) {
_addarrmask(_[D], S, _SHORTCUTWSTRUC)
} else if (S == 0 && S == "") {
+ # ptr,array* - copy from array to array _[ptr] shorcut-specific elements
_addarrmask(_[D], _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
} else if (_isnotfileptr(S)) {
+ # ptr* - define shortcut-specifc elements in array _[ptr] by default values
_addarrmask(_[D], _[S], _SHORTCUTWSTRUC)
} else if (_rd_shortcut(_[D], S)) {
- return
+ return # ptr,ptr2* - copy from array _[ptr2] to array _[ptr] shorcut-specific elements
}
} else {
+ # ptr,filepath* - define in array _[ptr] shortcut-specific elements by reading its from shortcut file filepath(load shortcut)
if (isarray(S) && _wr_shortcut(D, S)) {
- return
+ return # filepath,array* - [over]write shorcut file filepath; shortcut parameters will be defined by shortcut-specific elements in array(save shortcut)
} else if (S == 0 && S == "" && _wr_shortcut(D, _SHORTCUTDEFAULT)) {
- return
+ return # filepath* - [over]write shorcut file filepath; shortcut parameters will be defined by default values
} else if (_isnotfileptr(S) && _wr_shortcut(D, _[S])) {
- return
+ return # filepath,ptr* - [over]write shorcut file filepath; shortcut parameters will be defined by shortcut-specific elements in array _[ptr](save shortcut)
} else if (_rd_shortcut(_SHRTCUTA1, S) || _wr_shortcut(D, _SHRTCUTA1)) {
return
}
}
+ # filepath,filepath2* - [over]write shorcut file filepath; shortcut parameters will be defined from shortcut file filepath2(copy shortcut)
return 1
}
@@ -5367,6 +5535,7 @@ function _splitpath_test()
#_______________________________________________________________________
function _splitstr(A, t, r)
{
+ ########################################### 1 #
if (_istr(t)) {
if (_splitstr_i0(A, t) > 0) {
return _splitstrp0
@@ -5542,6 +5711,7 @@ function _subseqon(B, r, F, f, s, e, q, i, A)
function _sysinfo(D, h)
{
+ ##############################################################
h = "wmic /NODE: \"" h "\" OS 2>NUL"
if (split(_cmd(h), _SYSINFOA0, /[\x0D\x0A]+/) == 3) {
_sysinfol0 = length(h = _SYSINFOA0[2]) + 1
@@ -5584,6 +5754,7 @@ function _tOBJ(c, t, P)
#_______________________________________________________________________
function _tOBJ_CLEANUP(p)
{
+ ##############################################
for (p in UIDSDEL) {
delete _ptr[p]
delete _tPREV[p]
@@ -5602,6 +5773,7 @@ function _tOBJ_CLEANUP(p)
#_______________________________________________________________________
function _tabtospc(t, ts, xc, a, c, n, A, B)
{
+ ##################################
if (! ts) {
ts = _TAB_STEP_DEFAULT
}
@@ -5638,6 +5810,7 @@ function _tapi(p, f, p0, p1, p2, p3, c)
#_____________________________________________________________________________
function _tbframe(f, p, p0, p1)
{
+ ##################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tbframe_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -5656,6 +5829,7 @@ function _tbframe_i0(f, p, p0, p1, a)
#_______________________________________________________________________
function _tbframex(f, p, p0, p1)
{
+ ###########################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tbframex_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -5674,6 +5848,7 @@ function _tbframex_i0(f, p, p0, p1)
#_____________________________________________________________________________
function _tbpass(f, p, p0, p1)
{
+ ###################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tbpass_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -5692,6 +5867,7 @@ function _tbpass_i0(f, p, p0, p1, a)
#_____________________________________________________________________________
function _tbpassx(f, p, p0, p1)
{
+ ##################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tbpassx_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -5710,6 +5886,7 @@ function _tbpassx_i0(f, p, p0, p1)
#_____________________________________________________________________________
function _tbrochld(p, f, pp)
{
+ ################################################### # TEST!!!
if (p) {
if (p in _tFCHLD) {
f = _tFCHLD[p]
@@ -5793,30 +5970,35 @@ function _tbrochld(p, f, pp)
#_________________________________________________________________
function _tbrunframe(f, p, p0, p1)
{
+ ###################################
return _tbframe((f ? f : "_trunframe_i0"), p, p0, p1)
}
#_________________________________________________________________
function _tbrunframex(f, p, p0, p1)
{
+ ##################################
return _tbframex((f ? f : "_trunframe_i0"), p, p0, p1)
}
#_________________________________________________________________
function _tbrunpass(f, p, p0, p1)
{
+ ####################################
return _tbpass((f ? f : "_trunframe_i0"), p, p0, p1)
}
#_________________________________________________________________
function _tbrunpassx(f, p, p0, p1)
{
+ ###################################
return _tbpassx((f ? f : "_trunframe_i0"), p, p0, p1)
}
#_____________________________________________________________________________
function _tdel(p, i)
{
+ ##########################################################
if (p in _) {
_texclude(p)
for (i in _ptr[p]) {
@@ -5872,6 +6054,7 @@ function _tdel_i1(A, i)
#_____________________________________________________________________________
function _tdelete(p, v)
{
+ ####################################################### # REMAKE EXCLUDE
if (p) {
_wLCHLD(_tDELPTR, p)
}
@@ -5881,6 +6064,7 @@ function _tdelete(p, v)
#_________________________________________________________________
function _tdelitem(p)
{
+ #############################################
if (p) {
if ("HOST" in _PTR[p] && "ITEMNAME" in _[p]) {
return _wLCHLD(_PTR[_PTR[p]["HOST"]]["ITEM"][_[p]["ITEMNAME"]], p)
@@ -5893,6 +6077,7 @@ function _tdelitem(p)
#_______________________________________________________________________
function _tend(a, b)
{
+ #####################################################
if (b == "") {
return (_t_ENDF[_t_ENDF[0]] = a)
} else {
@@ -5903,6 +6088,7 @@ function _tend(a, b)
#_____________________________________________________________________________
function _texclude(p, v, pp)
{
+ ################################################### # TEST!!!
if (p in _) {
if (p in _tPARENT) {
pp = _tPARENT[p]
@@ -5945,6 +6131,7 @@ function _texclude(p, v, pp)
#_____________________________________________________________________________
function _tframe(fF, p, p0, p1, p2)
{
+ ###############################################
delete _t_ENDF[++_t_ENDF[0]]
p = (_isptr(p) ? (isarray(fF) ? _tframe_i1(fF, p, p0, p1, p2) : _tframe_i0(fF, p, p0, p1, p2)) : "")
--_t_ENDF[0]
@@ -5954,6 +6141,7 @@ function _tframe(fF, p, p0, p1, p2)
#_____________________________________________________________________________
function _tframe0(f, p, p0, p1, p2, p3, A)
{
+ #########################################
if (_isptr(p)) {
if (isarray(f)) {
return _tframe0_i0(f, p)
@@ -6020,6 +6208,7 @@ function _tframe0_i2(A, m, p)
#_________________________________________________________________
function _tframe1(f, p, p0, p1, p2, p3, A)
{
+ #############################
if (_isptr(p)) {
if (isarray(f)) {
return _tframe1_i0(f, p, p0)
@@ -6075,6 +6264,7 @@ function _tframe1_i2(A, m, p, p0)
#_________________________________________________________________
function _tframe2(f, p, p0, p1, p2, p3, A)
{
+ #############################
if (_isptr(p)) {
if (isarray(f)) {
return _tframe2_i0(f, p, p0, p1)
@@ -6130,6 +6320,7 @@ function _tframe2_i2(A, m, p, p0, p1)
#_________________________________________________________________
function _tframe3(f, p, p0, p1, p2, p3, A)
{
+ #############################
if (_isptr(p)) {
if (isarray(f)) {
return _tframe3_i0(f, p, p0, p1, p2)
@@ -6185,6 +6376,7 @@ function _tframe3_i2(A, m, p, p0, p1, p2)
#_________________________________________________________________
function _tframe4(f, p, p0, p1, p2, p3, A)
{
+ #############################
if (_isptr(p)) {
if (isarray(f)) {
return _tframe4_i0(f, p, p0, p1, p2, p3)
@@ -6258,6 +6450,7 @@ function _tframe_i1(F, p, p0, p1, p2, a)
#_______________________________________________________________________
function _tframex(f, p, p0, p1)
{
+ ############################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tframex_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -6367,6 +6560,7 @@ function _tgenuid_init(a, b, A)
#_______________________________________________________________________
function _tgetitem(p, n, a, b)
{
+ ############################################
if (p) {
if (isarray(_PTR[p]["ITEM"]) && n in _PTR[p]["ITEM"]) {
a = _PTR[p]["ITEM"][n]
@@ -6385,6 +6579,7 @@ function _tgetitem(p, n, a, b)
#_________________________________________________________________
function _tgetsp(p)
{
+ ###############################################
return _tSTACK[p][0]
}
@@ -6396,33 +6591,38 @@ function _th0(p, p1, p2, p3)
return p
}
-#_________________________________________________________________
+##########################################
function _th1(p0, p, p2, p3)
{
+ #_________________________________________________________________
return p
}
-#_________________________________________________________________
+##############################
function _th10(p0, p1)
{
+ #_________________________________________________________________
return (p1 p0)
}
-#_________________________________________________________________
+##############################
function _th2(p0, p1, r, p3)
{
+ #_________________________________________________________________
return p
}
-#_________________________________________________________________
+##############################
function _th3(p0, p1, p2, r)
{
+ #_________________________________________________________________
return p
}
#_________________________________________________________________
function _tifend(l)
{
+ ###############################################
return ((_t_ENDF[0] + l in _t_ENDF ? (_t_ENDF[_t_ENDF[0] + l] ? _t_ENDF[_t_ENDF[0] + l] : 1) : ""))
}
@@ -6592,6 +6792,7 @@ function _tlist_i1(L, p)
#_________________________________________________________________
function _tmbframe(f, p, p0, p1, t)
{
+ ##################################
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
t = t _tbframe_i0(f, p, p0, p1, p = (p in _tPREV ? _tPREV[p] : ""))
}
@@ -6601,6 +6802,7 @@ function _tmbframe(f, p, p0, p1, t)
#_________________________________________________________________
function _tmbframex(f, p, p0, p1, t)
{
+ #################################
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
t = t _tbframex_i0(f, p, p0, p1)
p = (p in _tPREV ? _tPREV[p] : "")
@@ -6611,6 +6813,7 @@ function _tmbframex(f, p, p0, p1, t)
#_________________________________________________________________
function _tmbpass(f, p, p0, p1)
{
+ ######################################
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
p0 = _tbpass_i0(f, p, p0, p1, p = (p in _tPREV ? _tPREV[p] : ""))
}
@@ -6620,6 +6823,7 @@ function _tmbpass(f, p, p0, p1)
#_________________________________________________________________
function _tmbpassx(f, p, p0, p1)
{
+ #####################################
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
p0 = _tbpassx_i0(f, p, p0, p1)
p = (p in _tPREV ? _tPREV[p] : "")
@@ -6630,6 +6834,7 @@ function _tmbpassx(f, p, p0, p1)
#_________________________________________________________________
function _tmframe(f, p, p0, p1, p2)
{
+ ###################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tmframe_i0(f, p, p0, p1, p2) : "")
--_t_ENDF[0]
@@ -6657,6 +6862,7 @@ function _tmframe_i1(F, p, p0, p1, p2, t)
#_________________________________________________________________
function _tmframex(f, p, p0, p1, t)
{
+ ##################################
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
t = t _tframex_i0(f, p, p0, p1)
p = (p in _tNEXT ? _tNEXT[p] : "")
@@ -6667,6 +6873,7 @@ function _tmframex(f, p, p0, p1, t)
#_________________________________________________________________
function _tmpass(f, p, p0, p1)
{
+ #######################################
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
p0 = _tbpass_i0(f, p, p0, p1, p = (p in _tNEXT ? _tNEXT[p] : ""))
}
@@ -6676,6 +6883,7 @@ function _tmpass(f, p, p0, p1)
#_________________________________________________________________
function _tmpassx(f, p, p0, p1)
{
+ ######################################
while (p && ! (_t_ENDF[0] in _t_ENDF)) {
p0 = _tbpassx_i0(f, p, p0, p1)
p = (p in _tNEXT ? _tNEXT[p] : "")
@@ -6719,6 +6927,7 @@ function _torexp_rexp(t)
#_____________________________________________________________________________
function _tpass(f, p, p0, p1)
{
+ ####################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tpass_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -6737,6 +6946,7 @@ function _tpass_i0(f, p, p0, p1, a)
#_____________________________________________________________________________
function _tpassx(f, p, p0, p1)
{
+ ###################################################
delete _t_ENDF[++_t_ENDF[0]]
f = (p ? _tpassx_i0(f, p, p0, p1) : "")
--_t_ENDF[0]
@@ -6755,6 +6965,7 @@ function _tpassx_i0(f, p, p0, p1)
#_________________________________________________________________
function _tpop(p, aA, a)
{
+ ###########################################
if ((a = _tSTACK[p][0]) > 0) {
_tSTACK[p][0]--
if (isarray(_tSTACK[p][a])) {
@@ -6770,6 +6981,7 @@ function _tpop(p, aA, a)
#_____________________________________________________________________________
function _tpush(p, aA, a)
{
+ ######################################################
if (isarray(aA)) {
delete _tSTACK[p][a = ++_tSTACK[p][0]]
_tSTACK[p][a][""]
@@ -6808,6 +7020,7 @@ function _tr(n, cs, H)
#_______________________________________________________________________
function _trace(t, d, A)
{
+ #################################################
if (_ERRLOG_TF) {
A["TYPE"] = "TRACE"
A["TEXT"] = t
@@ -6818,6 +7031,7 @@ function _trace(t, d, A)
#_________________________________________________________________
function _trunframe(f, p, p0, p1, p2)
{
+ #################################
return _tframe((f ? f : "_trunframe_i0"), p, p0, p1, p2)
}
@@ -6833,24 +7047,28 @@ function _trunframe_i0(p, p0, p1, p2, f)
#_________________________________________________________________
function _trunframex(f, p, p0, p1)
{
+ ###################################
return _tframex((f ? f : "_trunframe_i0"), p, p0, p1)
}
#_________________________________________________________________
function _trunpass(f, p, p0, p1)
{
+ #####################################
return _tpass((f ? f : "_trunframe_i0"), p, p0, p1)
}
#_________________________________________________________________
function _trunpassx(f, p, p0, p1)
{
+ ####################################
return _tpassx((f ? f : "_trunframe_i0"), p, p0, p1)
}
#_________________________________________________________________
function _tsetsp(p, v)
{
+ #############################################
return (_tSTACK[p][0] = v)
}
@@ -7031,6 +7249,7 @@ function _typa(p, A)
#_______________________________________________________________________
function _tzend(a, b)
{
+ #####################################################
if (b == 0 && b == "") {
return (_TEND[_TEND[_ARRLEN]] = a)
} else {
@@ -7170,6 +7389,7 @@ function _unstr(t)
#_________________________________________________________________
function _untmp(f, a)
{
+ #############################################
if (f = filepath(f)) {
if (match(f, /\\$/)) {
_deletepfx(_FILEIO_RDTMP, a = toupper(f))
@@ -7221,6 +7441,7 @@ function _var(v, t)
#_______________________________________________________________________
function _verb(t, d, A)
{
+ ##################################################
if (_ERRLOG_VF) {
A["TYPE"] = "VERB"
A["TEXT"] = t
@@ -7231,6 +7452,7 @@ function _verb(t, d, A)
#_________________________________________________________________
function _wFBRO(p, v, a)
{
+ ###########################################
if (p) {
if (v) {
for (a = p; a in _tPARENT; ) {
@@ -7238,6 +7460,7 @@ function _wFBRO(p, v, a)
return v
}
}
+ ######################## v is parentesis of p
if (p in _tPARENT) {
p = _tPARENT[p]
if (v in _tNEXT) {
@@ -7328,14 +7551,16 @@ function _wFBRO(p, v, a)
if (v == 0) {
return v
}
+ ######################## p=ptr, v=0
return v
}
} else {
+ ######################## p=ptr, v=""
if (p == 0) {
- return v
+ return v ######################## p=0
}
if (v) {
- return _texclude(v)
+ return _texclude(v) ######################## p="", v=ptr - exclude v
}
return v
}
@@ -7344,16 +7569,19 @@ function _wFBRO(p, v, a)
#_________________________________________________________________
function _wFCHLD(p, v, a)
{
+ ##########################################
if (p) {
if (v) {
if (p == v) {
return v
}
+ ######################## p=v=ptr
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
return v
}
}
+ ######################## v is parentesis of p
if (v in _tNEXT) {
if (v in _tPREV) {
_tPREV[_tNEXT[a] = _tNEXT[v]] = a = _tPREV[v]
@@ -7409,6 +7637,7 @@ function _wFCHLD(p, v, a)
} else {
if (v == 0) {
if (p in _tFCHLD) {
+ ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -7421,8 +7650,9 @@ function _wFCHLD(p, v, a)
return v
}
} else {
+ ######################## p=ptr, v="" > ignore action
if (p == 0) {
- return v
+ return v ######################## p=0
}
return v
}
@@ -7431,6 +7661,7 @@ function _wFCHLD(p, v, a)
#_________________________________________________________________
function _wLBRO(p, v, a)
{
+ ###########################################
if (p) {
if (v) {
for (a = p; a in _tPARENT; ) {
@@ -7438,6 +7669,7 @@ function _wLBRO(p, v, a)
return v
}
}
+ ######################## v is parentesis of p
if (p in _tPARENT) {
p = _tPARENT[p]
if (v in _tPREV) {
@@ -7528,14 +7760,16 @@ function _wLBRO(p, v, a)
if (v == 0) {
return v
}
+ ######################## p=ptr, v=0
return v
}
} else {
+ ######################## p=ptr, v=""
if (p == 0) {
- return v
+ return v ######################## p=0
}
if (v) {
- return _texclude(v)
+ return _texclude(v) ######################## p="", v=ptr - exclude v
}
return v
}
@@ -7544,16 +7778,19 @@ function _wLBRO(p, v, a)
#_________________________________________________________________
function _wLCHLD(p, v, a)
{
+ ##########################################
if (p) {
if (v) {
if (p == v) {
return v
}
+ ######################## p=v=ptr
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
return v
}
}
+ ######################## v is parentesis of p
if (v in _tPREV) {
if (v in _tNEXT) {
_tNEXT[_tPREV[a] = _tPREV[v]] = a = _tNEXT[v]
@@ -7609,6 +7846,7 @@ function _wLCHLD(p, v, a)
} else {
if (v == 0) {
if (p in _tFCHLD) {
+ ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -7621,8 +7859,9 @@ function _wLCHLD(p, v, a)
return v
}
} else {
+ ######################## p=ptr, v="" > ignore action
if (p == 0) {
- return v
+ return v ######################## p=0
}
return v
}
@@ -7631,22 +7870,26 @@ function _wLCHLD(p, v, a)
#_________________________________________________________________
function _wLINK(p, v)
{
+ ##############################################
return (_tLINK[p] = v)
}
#_________________________________________________________________
function _wNEXT(p, v, a, b)
{
+ #########################################
if (p) {
if (v) {
if (p == v) {
return v
}
+ ######################## p=v=ptr
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
return v
}
}
+ ######################## v is parentesis of p
if (v in _tPREV) {
if (p == (a = _tPREV[v])) {
return v
@@ -7695,14 +7938,16 @@ function _wNEXT(p, v, a, b)
if (v == 0) {
return v
}
+ ######################## p=ptr, v=0
return v
}
} else {
+ ######################## p=ptr, v=""
if (p == 0) {
- return v
+ return v ######################## p=0
}
if (v) {
- return _texclude(v)
+ return _texclude(v) ######################## p="", v=ptr - exclude v
}
return v
}
@@ -7711,22 +7956,26 @@ function _wNEXT(p, v, a, b)
#_________________________________________________________________
function _wPARENT(p, v)
{
+ ############################################
return v
}
#_________________________________________________________________
function _wPREV(p, v, a, b)
{
+ #########################################
if (p) {
if (v) {
if (p == v) {
return v
}
+ ######################## p=v=ptr
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
return v
}
}
+ ######################## v is parentesis of p
if (v in _tNEXT) {
if (p == (a = _tNEXT[v])) {
return v
@@ -7775,14 +8024,16 @@ function _wPREV(p, v, a, b)
if (v == 0) {
return v
}
+ ######################## p=ptr, v=0
return v
}
} else {
+ ######################## p=ptr, v=""
if (p == 0) {
- return v
+ return v ######################## p=0
}
if (v) {
- return _texclude(v)
+ return _texclude(v) ######################## p="", v=ptr - exclude v
}
return v
}
@@ -7791,17 +8042,21 @@ function _wPREV(p, v, a, b)
#_________________________________________________________________
function _wQBRO(p, v)
{
+ ##############################################
return v
}
#_________________________________________________________________
function _wQCHLD(p, v)
{
+ #############################################
if (p) {
if (v) {
} else {
+ ######################## p=ptr, v=ptr
if (v == 0) {
if (p in _tFCHLD) {
+ ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -7814,9 +8069,11 @@ function _wQCHLD(p, v)
return v
}
} else {
+ ######################## p=ptr, v="" > ignore action
if (p == 0) {
return v
}
+ ######################## p=0
return v
}
}
@@ -7824,6 +8081,7 @@ function _wQCHLD(p, v)
#_______________________________________________________________________
function _warning(t, d, A)
{
+ ###############################################
if (_ERRLOG_WF) {
A["TYPE"] = "WARNING"
A["TEXT"] = t
@@ -7875,6 +8133,7 @@ function _wr_shortcut(f, S)
#_________________________________________________________________
function _wrfile(f, d, a, b)
{
+ #########################################
if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") {
ERRNO = "Filename error"
return
@@ -7900,6 +8159,7 @@ function _wrfile(f, d, a, b)
#___________________________________________________________
function _wrfile1(f, d, a, b)
{
+ ##################################
if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") {
ERRNO = "Filename error"
return
@@ -7925,6 +8185,7 @@ function _wrfile1(f, d, a, b)
#_______________________________________________________________________
function _yexport(p)
{
+ #####################################################
return _tframe("_yexport_i0", p)
}
@@ -7945,6 +8206,7 @@ function _yexport_i0(p, p0, p1, p2)
#_________________________________________________________________
function cmp_str_idx(i1, v1, i2, v2)
{
+ ##############################
return ((i1 < i2 ? -1 : 1))
}
@@ -8099,6 +8361,7 @@ function hujf(a, b, c)
#___________________________________________________________
function ncmp_str_idx(i1, v1, i2, v2)
{
+ #######################
return ((i1 < i2 ? 1 : -1))
}
@@ -8225,4 +8488,5 @@ function zorr(A, i, r)
#_____________________________________________________________________________
function zzer()
{
+ ################################################################
}