aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog28
-rw-r--r--awkgram.c899
-rw-r--r--awkgram.y117
-rw-r--r--profile.c108
-rw-r--r--test/ChangeLog10
-rw-r--r--test/Makefile.am9
-rw-r--r--test/Makefile.in9
-rw-r--r--test/profile10.awk42
-rw-r--r--test/profile10.ok40
-rw-r--r--test/profile5.ok399
10 files changed, 1106 insertions, 555 deletions
diff --git a/ChangeLog b/ChangeLog
index 52965d59..5d169108 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2016-03-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile.c (pprint): Improve handling of comment after
+ and if statement without an else.
+
+2016-03-19 Arnold D. Robbins <arnold@skeeve.com>
+
+ Considerable improvements to handling of comments when pretty
+ printing, particularly for end-of-line comments.
+
+ * awkgram.y (prior_comment, comment_to_save): New variables.
+ (add_pending_comment): New function.
+ (grammar): Jump through lots more hoops to capture comments.
+ Due to shift-reduce parsing, there can be up to two comments
+ captured and waiting to be saved; be sure to get them both and
+ at the right times. This is difficult since comments have no
+ real syntactic exisitence. Call add_pending_comment on most of
+ the simple statements.
+ (get_comment): Save a pre-existing comment in prior_comment.
+ (split_comment): Use comment_to_save instead of `comment'.
+ * profile.c (end_line): Change to return the instruction after
+ the comment that gets printed; adjust return type.
+ (pprint): Add skip_comment static variable. Adjust logic for
+ skipping an end-of-line comment; only do it if skip_comment is
+ true. This is set to true in places where we can't use the
+ return value from end_line(). Call end_line() in many more places.
+ (pp_func): Handle end-of-line comments after a function header.
+
2016-03-17 Arnold D. Robbins <arnold@skeeve.com>
* debug.c (print_instruction): For Op_comment, improve notation as
diff --git a/awkgram.c b/awkgram.c
index d50040b3..a11498fe 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, 482, 481, 515, 537, 539, 544,
+ 554, 601, 606, 607, 611, 613, 615, 622, 712, 754,
+ 796, 909, 916, 923, 934, 944, 954, 964, 976, 993,
+ 992, 1017, 1029, 1029, 1128, 1128, 1162, 1193, 1202, 1203,
+ 1209, 1210, 1217, 1222, 1234, 1248, 1250, 1258, 1263, 1265,
+ 1273, 1282, 1284, 1293, 1294, 1302, 1307, 1307, 1318, 1322,
+ 1330, 1331, 1334, 1336, 1341, 1342, 1351, 1352, 1357, 1362,
+ 1371, 1373, 1375, 1382, 1383, 1389, 1390, 1395, 1397, 1402,
+ 1404, 1412, 1417, 1426, 1427, 1432, 1434, 1439, 1441, 1449,
+ 1454, 1462, 1463, 1468, 1475, 1479, 1481, 1483, 1496, 1513,
+ 1523, 1530, 1532, 1537, 1539, 1541, 1549, 1551, 1556, 1558,
+ 1563, 1565, 1567, 1623, 1625, 1627, 1629, 1631, 1633, 1635,
+ 1637, 1651, 1656, 1661, 1686, 1692, 1694, 1696, 1698, 1700,
+ 1702, 1707, 1711, 1743, 1745, 1751, 1757, 1770, 1771, 1772,
+ 1777, 1782, 1786, 1790, 1805, 1818, 1823, 1860, 1889, 1890,
+ 1896, 1897, 1902, 1904, 1911, 1928, 1945, 1947, 1954, 1959,
+ 1967, 1977, 1989, 1998, 2002, 2006, 2010, 2014, 2018, 2021,
+ 2023, 2027, 2031, 2035
};
#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,23 @@ 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 +2227,17 @@ yyreduce:
(yyval) = (yyvsp[-6]);
want_param_names = FUNC_BODY;
}
-#line 2218 "awkgram.c" /* yacc.c:1646 */
+#line 2231 "awkgram.c" /* yacc.c:1646 */
break;
case 34:
-#line 469 "awkgram.y" /* yacc.c:1646 */
+#line 482 "awkgram.y" /* yacc.c:1646 */
{ want_regexp = true; }
-#line 2224 "awkgram.c" /* yacc.c:1646 */
+#line 2237 "awkgram.c" /* yacc.c:1646 */
break;
case 35:
-#line 471 "awkgram.y" /* yacc.c:1646 */
+#line 484 "awkgram.y" /* yacc.c:1646 */
{
NODE *n, *exp;
char *re;
@@ -2253,11 +2266,11 @@ yyreduce:
(yyval)->opcode = Op_match_rec;
(yyval)->memory = n;
}
-#line 2257 "awkgram.c" /* yacc.c:1646 */
+#line 2270 "awkgram.c" /* yacc.c:1646 */
break;
case 36:
-#line 503 "awkgram.y" /* yacc.c:1646 */
+#line 516 "awkgram.y" /* yacc.c:1646 */
{
NODE *n, *exp;
char *re;
@@ -2277,47 +2290,70 @@ yyreduce:
(yyval)->opcode = Op_push_re;
(yyval)->memory = n;
}
-#line 2281 "awkgram.c" /* yacc.c:1646 */
+#line 2294 "awkgram.c" /* yacc.c:1646 */
break;
case 37:
-#line 525 "awkgram.y" /* yacc.c:1646 */
+#line 538 "awkgram.y" /* yacc.c:1646 */
{ bcfree((yyvsp[0])); }
-#line 2287 "awkgram.c" /* yacc.c:1646 */
+#line 2300 "awkgram.c" /* yacc.c:1646 */
break;
case 39:
-#line 531 "awkgram.y" /* yacc.c:1646 */
+#line 544 "awkgram.y" /* yacc.c:1646 */
{
- if (comment != NULL) {
+ if (prior_comment != NULL) {
+ (yyval) = list_create(prior_comment);
+ prior_comment = NULL;
+ } else if (comment != NULL) {
(yyval) = list_create(comment);
comment = NULL;
- } else (yyval) = NULL;
+ } else
+ (yyval) = NULL;
}
-#line 2298 "awkgram.c" /* yacc.c:1646 */
+#line 2315 "awkgram.c" /* yacc.c:1646 */
break;
case 40:
-#line 538 "awkgram.y" /* yacc.c:1646 */
+#line 555 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0]) == NULL) {
- if (comment == NULL)
- (yyval) = (yyvsp[-1]);
- else {
+ if (prior_comment != NULL) {
+ (yyval) = list_append((yyvsp[-1]), prior_comment);
+ prior_comment = NULL;
+ if (comment != NULL) {
+ (yyval) = list_append((yyval), comment);
+ comment = NULL;
+ }
+ } else if (comment != NULL) {
(yyval) = list_append((yyvsp[-1]), comment);
comment = NULL;
- }
+ } else
+ (yyval) = (yyvsp[-1]);
} else {
add_lint((yyvsp[0]), LINT_no_effect);
if ((yyvsp[-1]) == NULL) {
- if (comment == NULL)
- (yyval) = (yyvsp[0]);
- else {
+ if (prior_comment != NULL) {
+ (yyval) = list_append((yyvsp[0]), prior_comment);
+ prior_comment = NULL;
+ if (comment != NULL) {
+ (yyval) = list_append((yyval), comment);
+ comment = NULL;
+ }
+ } else if (comment != NULL) {
(yyval) = list_append((yyvsp[0]), comment);
comment = NULL;
- }
+ } else
+ (yyval) = (yyvsp[0]);
} else {
- if (comment != NULL) {
+ if (prior_comment != NULL) {
+ list_append((yyvsp[0]), prior_comment);
+ prior_comment = NULL;
+ if (comment != NULL) {
+ list_append((yyvsp[0]), comment);
+ comment = NULL;
+ }
+ } else if (comment != NULL) {
list_append((yyvsp[0]), comment);
comment = NULL;
}
@@ -2326,40 +2362,40 @@ yyreduce:
}
yyerrok;
}
-#line 2330 "awkgram.c" /* yacc.c:1646 */
+#line 2366 "awkgram.c" /* yacc.c:1646 */
break;
case 41:
-#line 566 "awkgram.y" /* yacc.c:1646 */
+#line 602 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2336 "awkgram.c" /* yacc.c:1646 */
+#line 2372 "awkgram.c" /* yacc.c:1646 */
break;
case 44:
-#line 576 "awkgram.y" /* yacc.c:1646 */
+#line 612 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2342 "awkgram.c" /* yacc.c:1646 */
+#line 2378 "awkgram.c" /* yacc.c:1646 */
break;
case 45:
-#line 578 "awkgram.y" /* yacc.c:1646 */
+#line 614 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 2348 "awkgram.c" /* yacc.c:1646 */
+#line 2384 "awkgram.c" /* yacc.c:1646 */
break;
case 46:
-#line 580 "awkgram.y" /* yacc.c:1646 */
+#line 616 "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 2395 "awkgram.c" /* yacc.c:1646 */
break;
case 47:
-#line 587 "awkgram.y" /* yacc.c:1646 */
+#line 623 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
INSTRUCTION *ip, *nextc, *tbreak;
@@ -2449,11 +2485,11 @@ yyreduce:
break_allowed--;
fix_break_continue(ip, tbreak, NULL);
}
-#line 2453 "awkgram.c" /* yacc.c:1646 */
+#line 2489 "awkgram.c" /* yacc.c:1646 */
break;
case 48:
-#line 677 "awkgram.y" /* yacc.c:1646 */
+#line 713 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@ -2495,11 +2531,11 @@ yyreduce:
continue_allowed--;
fix_break_continue(ip, tbreak, tcont);
}
-#line 2499 "awkgram.c" /* yacc.c:1646 */
+#line 2535 "awkgram.c" /* yacc.c:1646 */
break;
case 49:
-#line 719 "awkgram.y" /* yacc.c:1646 */
+#line 755 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@ -2541,11 +2577,11 @@ yyreduce:
} /* else
$1 and $4 are NULLs */
}
-#line 2545 "awkgram.c" /* yacc.c:1646 */
+#line 2581 "awkgram.c" /* yacc.c:1646 */
break;
case 50:
-#line 761 "awkgram.y" /* yacc.c:1646 */
+#line 797 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip;
char *var_name = (yyvsp[-5])->lextok;
@@ -2658,70 +2694,73 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
-#line 2662 "awkgram.c" /* yacc.c:1646 */
+#line 2698 "awkgram.c" /* yacc.c:1646 */
break;
case 51:
-#line 874 "awkgram.y" /* yacc.c:1646 */
+#line 910 "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 2709 "awkgram.c" /* yacc.c:1646 */
break;
case 52:
-#line 881 "awkgram.y" /* yacc.c:1646 */
+#line 917 "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 2720 "awkgram.c" /* yacc.c:1646 */
break;
case 53:
-#line 888 "awkgram.y" /* yacc.c:1646 */
+#line 924 "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 2732 "awkgram.c" /* yacc.c:1646 */
break;
case 54:
-#line 898 "awkgram.y" /* yacc.c:1646 */
+#line 935 "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 2746 "awkgram.c" /* yacc.c:1646 */
break;
case 55:
-#line 907 "awkgram.y" /* yacc.c:1646 */
+#line 945 "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 2760 "awkgram.c" /* yacc.c:1646 */
break;
case 56:
-#line 916 "awkgram.y" /* yacc.c:1646 */
+#line 955 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule && rule != Rule)
@@ -2729,12 +2768,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 2774 "awkgram.c" /* yacc.c:1646 */
break;
case 57:
-#line 925 "awkgram.y" /* yacc.c:1646 */
+#line 965 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule == BEGIN || rule == END || rule == ENDFILE)
@@ -2744,12 +2784,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 2790 "awkgram.c" /* yacc.c:1646 */
break;
case 58:
-#line 936 "awkgram.y" /* yacc.c:1646 */
+#line 977 "awkgram.y" /* yacc.c:1646 */
{
/* Initialize the two possible jump targets, the actual target
* is resolved at run-time.
@@ -2763,21 +2804,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 2810 "awkgram.c" /* yacc.c:1646 */
break;
case 59:
-#line 951 "awkgram.y" /* yacc.c:1646 */
+#line 993 "awkgram.y" /* yacc.c:1646 */
{
if (! in_function)
yyerror(_("`return' used outside function context"));
}
-#line 2777 "awkgram.c" /* yacc.c:1646 */
+#line 2819 "awkgram.c" /* yacc.c:1646 */
break;
case 60:
-#line 954 "awkgram.y" /* yacc.c:1646 */
+#line 996 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) == NULL) {
(yyval) = list_create((yyvsp[-3]));
@@ -2797,18 +2839,19 @@ regular_loop:
(yyval) = list_append((yyvsp[-1]), (yyvsp[-3]));
}
+ (yyval) = add_pending_comment((yyval));
}
-#line 2802 "awkgram.c" /* yacc.c:1646 */
+#line 2845 "awkgram.c" /* yacc.c:1646 */
break;
case 62:
-#line 986 "awkgram.y" /* yacc.c:1646 */
+#line 1029 "awkgram.y" /* yacc.c:1646 */
{ in_print = true; in_parens = 0; }
-#line 2808 "awkgram.c" /* yacc.c:1646 */
+#line 2851 "awkgram.c" /* yacc.c:1646 */
break;
case 63:
-#line 987 "awkgram.y" /* yacc.c:1646 */
+#line 1030 "awkgram.y" /* yacc.c:1646 */
{
/*
* Optimization: plain `print' has no expression list, so $3 is null.
@@ -2904,18 +2947,19 @@ regular_print:
}
}
}
+ (yyval) = add_pending_comment((yyval));
}
-#line 2909 "awkgram.c" /* yacc.c:1646 */
+#line 2953 "awkgram.c" /* yacc.c:1646 */
break;
case 64:
-#line 1084 "awkgram.y" /* yacc.c:1646 */
+#line 1128 "awkgram.y" /* yacc.c:1646 */
{ sub_counter = 0; }
-#line 2915 "awkgram.c" /* yacc.c:1646 */
+#line 2959 "awkgram.c" /* yacc.c:1646 */
break;
case 65:
-#line 1085 "awkgram.y" /* yacc.c:1646 */
+#line 1129 "awkgram.y" /* yacc.c:1646 */
{
char *arr = (yyvsp[-2])->lextok;
@@ -2947,12 +2991,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 2997 "awkgram.c" /* yacc.c:1646 */
break;
case 66:
-#line 1122 "awkgram.y" /* yacc.c:1646 */
+#line 1167 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
char *arr = (yyvsp[-1])->lextok;
@@ -2977,53 +3022,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 3028 "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 1194 "awkgram.y" /* yacc.c:1646 */
+ {
+ (yyval) = optimize_assignment((yyvsp[0]));
+ (yyval) = add_pending_comment((yyval));
+ }
+#line 3037 "awkgram.c" /* yacc.c:1646 */
break;
case 68:
-#line 1153 "awkgram.y" /* yacc.c:1646 */
+#line 1202 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2994 "awkgram.c" /* yacc.c:1646 */
+#line 3043 "awkgram.c" /* yacc.c:1646 */
break;
case 69:
-#line 1155 "awkgram.y" /* yacc.c:1646 */
+#line 1204 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3000 "awkgram.c" /* yacc.c:1646 */
+#line 3049 "awkgram.c" /* yacc.c:1646 */
break;
case 70:
-#line 1160 "awkgram.y" /* yacc.c:1646 */
+#line 1209 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3006 "awkgram.c" /* yacc.c:1646 */
+#line 3055 "awkgram.c" /* yacc.c:1646 */
break;
case 71:
-#line 1162 "awkgram.y" /* yacc.c:1646 */
+#line 1211 "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 3066 "awkgram.c" /* yacc.c:1646 */
break;
case 72:
-#line 1169 "awkgram.y" /* yacc.c:1646 */
+#line 1218 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3023 "awkgram.c" /* yacc.c:1646 */
+#line 3072 "awkgram.c" /* yacc.c:1646 */
break;
case 73:
-#line 1174 "awkgram.y" /* yacc.c:1646 */
+#line 1223 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -3035,11 +3084,11 @@ regular_print:
bcfree((yyvsp[-2]));
(yyval) = (yyvsp[-4]);
}
-#line 3039 "awkgram.c" /* yacc.c:1646 */
+#line 3088 "awkgram.c" /* yacc.c:1646 */
break;
case 74:
-#line 1186 "awkgram.y" /* yacc.c:1646 */
+#line 1235 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -3050,17 +3099,17 @@ regular_print:
(yyvsp[-3])->case_stmt = casestmt;
(yyval) = (yyvsp[-3]);
}
-#line 3054 "awkgram.c" /* yacc.c:1646 */
+#line 3103 "awkgram.c" /* yacc.c:1646 */
break;
case 75:
-#line 1200 "awkgram.y" /* yacc.c:1646 */
+#line 1249 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3060 "awkgram.c" /* yacc.c:1646 */
+#line 3109 "awkgram.c" /* yacc.c:1646 */
break;
case 76:
-#line 1202 "awkgram.y" /* yacc.c:1646 */
+#line 1251 "awkgram.y" /* yacc.c:1646 */
{
NODE *n = (yyvsp[0])->memory;
(void) force_number(n);
@@ -3068,26 +3117,26 @@ regular_print:
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3072 "awkgram.c" /* yacc.c:1646 */
+#line 3121 "awkgram.c" /* yacc.c:1646 */
break;
case 77:
-#line 1210 "awkgram.y" /* yacc.c:1646 */
+#line 1259 "awkgram.y" /* yacc.c:1646 */
{
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3081 "awkgram.c" /* yacc.c:1646 */
+#line 3130 "awkgram.c" /* yacc.c:1646 */
break;
case 78:
-#line 1215 "awkgram.y" /* yacc.c:1646 */
+#line 1264 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3087 "awkgram.c" /* yacc.c:1646 */
+#line 3136 "awkgram.c" /* yacc.c:1646 */
break;
case 79:
-#line 1217 "awkgram.y" /* yacc.c:1646 */
+#line 1266 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->memory->type == Node_regex)
(yyvsp[0])->opcode = Op_push_re;
@@ -3095,57 +3144,57 @@ regular_print:
(yyvsp[0])->opcode = Op_push;
(yyval) = (yyvsp[0]);
}
-#line 3099 "awkgram.c" /* yacc.c:1646 */
+#line 3148 "awkgram.c" /* yacc.c:1646 */
break;
case 80:
-#line 1225 "awkgram.y" /* yacc.c:1646 */
+#line 1274 "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 3158 "awkgram.c" /* yacc.c:1646 */
break;
case 81:
-#line 1234 "awkgram.y" /* yacc.c:1646 */
+#line 1283 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3115 "awkgram.c" /* yacc.c:1646 */
+#line 3164 "awkgram.c" /* yacc.c:1646 */
break;
case 82:
-#line 1236 "awkgram.y" /* yacc.c:1646 */
+#line 1285 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3121 "awkgram.c" /* yacc.c:1646 */
+#line 3170 "awkgram.c" /* yacc.c:1646 */
break;
case 84:
-#line 1246 "awkgram.y" /* yacc.c:1646 */
+#line 1295 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = (yyvsp[-1]);
}
-#line 3129 "awkgram.c" /* yacc.c:1646 */
+#line 3178 "awkgram.c" /* yacc.c:1646 */
break;
case 85:
-#line 1253 "awkgram.y" /* yacc.c:1646 */
+#line 1302 "awkgram.y" /* yacc.c:1646 */
{
in_print = false;
in_parens = 0;
(yyval) = NULL;
}
-#line 3139 "awkgram.c" /* yacc.c:1646 */
+#line 3188 "awkgram.c" /* yacc.c:1646 */
break;
case 86:
-#line 1258 "awkgram.y" /* yacc.c:1646 */
+#line 1307 "awkgram.y" /* yacc.c:1646 */
{ in_print = false; in_parens = 0; }
-#line 3145 "awkgram.c" /* yacc.c:1646 */
+#line 3194 "awkgram.c" /* yacc.c:1646 */
break;
case 87:
-#line 1259 "awkgram.y" /* yacc.c:1646 */
+#line 1308 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->redir_type == redirect_twoway
&& (yyvsp[0])->lasti->opcode == Op_K_getline_redir
@@ -3153,63 +3202,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 3206 "awkgram.c" /* yacc.c:1646 */
break;
case 88:
-#line 1270 "awkgram.y" /* yacc.c:1646 */
+#line 1319 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL);
}
-#line 3165 "awkgram.c" /* yacc.c:1646 */
+#line 3214 "awkgram.c" /* yacc.c:1646 */
break;
case 89:
-#line 1275 "awkgram.y" /* yacc.c:1646 */
+#line 1324 "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 3222 "awkgram.c" /* yacc.c:1646 */
break;
case 94:
-#line 1292 "awkgram.y" /* yacc.c:1646 */
+#line 1341 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3179 "awkgram.c" /* yacc.c:1646 */
+#line 3228 "awkgram.c" /* yacc.c:1646 */
break;
case 95:
-#line 1294 "awkgram.y" /* yacc.c:1646 */
+#line 1343 "awkgram.y" /* yacc.c:1646 */
{
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3188 "awkgram.c" /* yacc.c:1646 */
+#line 3237 "awkgram.c" /* yacc.c:1646 */
break;
case 96:
-#line 1302 "awkgram.y" /* yacc.c:1646 */
+#line 1351 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3194 "awkgram.c" /* yacc.c:1646 */
+#line 3243 "awkgram.c" /* yacc.c:1646 */
break;
case 97:
-#line 1304 "awkgram.y" /* yacc.c:1646 */
+#line 1353 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3200 "awkgram.c" /* yacc.c:1646 */
+#line 3249 "awkgram.c" /* yacc.c:1646 */
break;
case 98:
-#line 1309 "awkgram.y" /* yacc.c:1646 */
+#line 1358 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->param_count = 0;
(yyval) = list_create((yyvsp[0]));
}
-#line 3209 "awkgram.c" /* yacc.c:1646 */
+#line 3258 "awkgram.c" /* yacc.c:1646 */
break;
case 99:
-#line 1314 "awkgram.y" /* yacc.c:1646 */
+#line 1363 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2]) != NULL && (yyvsp[0]) != NULL) {
(yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1;
@@ -3218,74 +3267,74 @@ regular_print:
} else
(yyval) = NULL;
}
-#line 3222 "awkgram.c" /* yacc.c:1646 */
+#line 3271 "awkgram.c" /* yacc.c:1646 */
break;
case 100:
-#line 1323 "awkgram.y" /* yacc.c:1646 */
+#line 1372 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3228 "awkgram.c" /* yacc.c:1646 */
+#line 3277 "awkgram.c" /* yacc.c:1646 */
break;
case 101:
-#line 1325 "awkgram.y" /* yacc.c:1646 */
+#line 1374 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3234 "awkgram.c" /* yacc.c:1646 */
+#line 3283 "awkgram.c" /* yacc.c:1646 */
break;
case 102:
-#line 1327 "awkgram.y" /* yacc.c:1646 */
+#line 1376 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-2]); }
-#line 3240 "awkgram.c" /* yacc.c:1646 */
+#line 3289 "awkgram.c" /* yacc.c:1646 */
break;
case 103:
-#line 1333 "awkgram.y" /* yacc.c:1646 */
+#line 1382 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3246 "awkgram.c" /* yacc.c:1646 */
+#line 3295 "awkgram.c" /* yacc.c:1646 */
break;
case 104:
-#line 1335 "awkgram.y" /* yacc.c:1646 */
+#line 1384 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3252 "awkgram.c" /* yacc.c:1646 */
+#line 3301 "awkgram.c" /* yacc.c:1646 */
break;
case 105:
-#line 1340 "awkgram.y" /* yacc.c:1646 */
+#line 1389 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3258 "awkgram.c" /* yacc.c:1646 */
+#line 3307 "awkgram.c" /* yacc.c:1646 */
break;
case 106:
-#line 1342 "awkgram.y" /* yacc.c:1646 */
+#line 1391 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3264 "awkgram.c" /* yacc.c:1646 */
+#line 3313 "awkgram.c" /* yacc.c:1646 */
break;
case 107:
-#line 1347 "awkgram.y" /* yacc.c:1646 */
+#line 1396 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3270 "awkgram.c" /* yacc.c:1646 */
+#line 3319 "awkgram.c" /* yacc.c:1646 */
break;
case 108:
-#line 1349 "awkgram.y" /* yacc.c:1646 */
+#line 1398 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3279 "awkgram.c" /* yacc.c:1646 */
+#line 3328 "awkgram.c" /* yacc.c:1646 */
break;
case 109:
-#line 1354 "awkgram.y" /* yacc.c:1646 */
+#line 1403 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3285 "awkgram.c" /* yacc.c:1646 */
+#line 3334 "awkgram.c" /* yacc.c:1646 */
break;
case 110:
-#line 1356 "awkgram.y" /* yacc.c:1646 */
+#line 1405 "awkgram.y" /* yacc.c:1646 */
{
/*
* Returning the expression list instead of NULL lets
@@ -3293,62 +3342,62 @@ regular_print:
*/
(yyval) = (yyvsp[-1]);
}
-#line 3297 "awkgram.c" /* yacc.c:1646 */
+#line 3346 "awkgram.c" /* yacc.c:1646 */
break;
case 111:
-#line 1364 "awkgram.y" /* yacc.c:1646 */
+#line 1413 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3306 "awkgram.c" /* yacc.c:1646 */
+#line 3355 "awkgram.c" /* yacc.c:1646 */
break;
case 112:
-#line 1369 "awkgram.y" /* yacc.c:1646 */
+#line 1418 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = (yyvsp[-2]);
}
-#line 3315 "awkgram.c" /* yacc.c:1646 */
+#line 3364 "awkgram.c" /* yacc.c:1646 */
break;
case 113:
-#line 1377 "awkgram.y" /* yacc.c:1646 */
+#line 1426 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3321 "awkgram.c" /* yacc.c:1646 */
+#line 3370 "awkgram.c" /* yacc.c:1646 */
break;
case 114:
-#line 1379 "awkgram.y" /* yacc.c:1646 */
+#line 1428 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3327 "awkgram.c" /* yacc.c:1646 */
+#line 3376 "awkgram.c" /* yacc.c:1646 */
break;
case 115:
-#line 1384 "awkgram.y" /* yacc.c:1646 */
+#line 1433 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3333 "awkgram.c" /* yacc.c:1646 */
+#line 3382 "awkgram.c" /* yacc.c:1646 */
break;
case 116:
-#line 1386 "awkgram.y" /* yacc.c:1646 */
+#line 1435 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3342 "awkgram.c" /* yacc.c:1646 */
+#line 3391 "awkgram.c" /* yacc.c:1646 */
break;
case 117:
-#line 1391 "awkgram.y" /* yacc.c:1646 */
+#line 1440 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3348 "awkgram.c" /* yacc.c:1646 */
+#line 3397 "awkgram.c" /* yacc.c:1646 */
break;
case 118:
-#line 1393 "awkgram.y" /* yacc.c:1646 */
+#line 1442 "awkgram.y" /* yacc.c:1646 */
{
/*
* Returning the expression list instead of NULL lets
@@ -3356,72 +3405,72 @@ regular_print:
*/
(yyval) = (yyvsp[-1]);
}
-#line 3360 "awkgram.c" /* yacc.c:1646 */
+#line 3409 "awkgram.c" /* yacc.c:1646 */
break;
case 119:
-#line 1401 "awkgram.y" /* yacc.c:1646 */
+#line 1450 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3369 "awkgram.c" /* yacc.c:1646 */
+#line 3418 "awkgram.c" /* yacc.c:1646 */
break;
case 120:
-#line 1406 "awkgram.y" /* yacc.c:1646 */
+#line 1455 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = (yyvsp[-2]);
}
-#line 3378 "awkgram.c" /* yacc.c:1646 */
+#line 3427 "awkgram.c" /* yacc.c:1646 */
break;
case 121:
-#line 1413 "awkgram.y" /* yacc.c:1646 */
+#line 1462 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3384 "awkgram.c" /* yacc.c:1646 */
+#line 3433 "awkgram.c" /* yacc.c:1646 */
break;
case 122:
-#line 1414 "awkgram.y" /* yacc.c:1646 */
+#line 1463 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = list_create((yyvsp[0])); }
-#line 3390 "awkgram.c" /* yacc.c:1646 */
+#line 3439 "awkgram.c" /* yacc.c:1646 */
break;
case 123:
-#line 1420 "awkgram.y" /* yacc.c:1646 */
+#line 1469 "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 3450 "awkgram.c" /* yacc.c:1646 */
break;
case 124:
-#line 1427 "awkgram.y" /* yacc.c:1646 */
+#line 1476 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_assignment((yyvsp[-2]), list_create((yyvsp[0])), (yyvsp[-1]));
}
-#line 3409 "awkgram.c" /* yacc.c:1646 */
+#line 3458 "awkgram.c" /* yacc.c:1646 */
break;
case 125:
-#line 1431 "awkgram.y" /* yacc.c:1646 */
+#line 1480 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3415 "awkgram.c" /* yacc.c:1646 */
+#line 3464 "awkgram.c" /* yacc.c:1646 */
break;
case 126:
-#line 1433 "awkgram.y" /* yacc.c:1646 */
+#line 1482 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3421 "awkgram.c" /* yacc.c:1646 */
+#line 3470 "awkgram.c" /* yacc.c:1646 */
break;
case 127:
-#line 1435 "awkgram.y" /* yacc.c:1646 */
+#line 1484 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[-1])->source_line,
@@ -3434,11 +3483,11 @@ regular_print:
bcfree((yyvsp[0]));
(yyval) = list_append((yyvsp[-2]), (yyvsp[-1]));
}
-#line 3438 "awkgram.c" /* yacc.c:1646 */
+#line 3487 "awkgram.c" /* yacc.c:1646 */
break;
case 128:
-#line 1448 "awkgram.y" /* yacc.c:1646 */
+#line 1497 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[-1])->source_line,
@@ -3455,11 +3504,11 @@ regular_print:
(yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1]));
}
}
-#line 3459 "awkgram.c" /* yacc.c:1646 */
+#line 3508 "awkgram.c" /* yacc.c:1646 */
break;
case 129:
-#line 1465 "awkgram.y" /* yacc.c:1646 */
+#line 1514 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old)
warning_ln((yyvsp[-1])->source_line,
@@ -3469,91 +3518,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 3522 "awkgram.c" /* yacc.c:1646 */
break;
case 130:
-#line 1475 "awkgram.y" /* yacc.c:1646 */
+#line 1524 "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 3533 "awkgram.c" /* yacc.c:1646 */
break;
case 131:
-#line 1482 "awkgram.y" /* yacc.c:1646 */
+#line 1531 "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 3539 "awkgram.c" /* yacc.c:1646 */
break;
case 132:
-#line 1484 "awkgram.y" /* yacc.c:1646 */
+#line 1533 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3496 "awkgram.c" /* yacc.c:1646 */
+#line 3545 "awkgram.c" /* yacc.c:1646 */
break;
case 133:
-#line 1489 "awkgram.y" /* yacc.c:1646 */
+#line 1538 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3502 "awkgram.c" /* yacc.c:1646 */
+#line 3551 "awkgram.c" /* yacc.c:1646 */
break;
case 134:
-#line 1491 "awkgram.y" /* yacc.c:1646 */
+#line 1540 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3508 "awkgram.c" /* yacc.c:1646 */
+#line 3557 "awkgram.c" /* yacc.c:1646 */
break;
case 135:
-#line 1493 "awkgram.y" /* yacc.c:1646 */
+#line 1542 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_assign_quotient;
(yyval) = (yyvsp[0]);
}
-#line 3517 "awkgram.c" /* yacc.c:1646 */
+#line 3566 "awkgram.c" /* yacc.c:1646 */
break;
case 136:
-#line 1501 "awkgram.y" /* yacc.c:1646 */
+#line 1550 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3523 "awkgram.c" /* yacc.c:1646 */
+#line 3572 "awkgram.c" /* yacc.c:1646 */
break;
case 137:
-#line 1503 "awkgram.y" /* yacc.c:1646 */
+#line 1552 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3529 "awkgram.c" /* yacc.c:1646 */
+#line 3578 "awkgram.c" /* yacc.c:1646 */
break;
case 138:
-#line 1508 "awkgram.y" /* yacc.c:1646 */
+#line 1557 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3535 "awkgram.c" /* yacc.c:1646 */
+#line 3584 "awkgram.c" /* yacc.c:1646 */
break;
case 139:
-#line 1510 "awkgram.y" /* yacc.c:1646 */
+#line 1559 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3541 "awkgram.c" /* yacc.c:1646 */
+#line 3590 "awkgram.c" /* yacc.c:1646 */
break;
case 140:
-#line 1515 "awkgram.y" /* yacc.c:1646 */
+#line 1564 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3547 "awkgram.c" /* yacc.c:1646 */
+#line 3596 "awkgram.c" /* yacc.c:1646 */
break;
case 141:
-#line 1517 "awkgram.y" /* yacc.c:1646 */
+#line 1566 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3553 "awkgram.c" /* yacc.c:1646 */
+#line 3602 "awkgram.c" /* yacc.c:1646 */
break;
case 142:
-#line 1519 "awkgram.y" /* yacc.c:1646 */
+#line 1568 "awkgram.y" /* yacc.c:1646 */
{
int count = 2;
bool is_simple_var = false;
@@ -3606,47 +3655,47 @@ regular_print:
max_args = count;
}
}
-#line 3610 "awkgram.c" /* yacc.c:1646 */
+#line 3659 "awkgram.c" /* yacc.c:1646 */
break;
case 144:
-#line 1577 "awkgram.y" /* yacc.c:1646 */
+#line 1626 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3616 "awkgram.c" /* yacc.c:1646 */
+#line 3665 "awkgram.c" /* yacc.c:1646 */
break;
case 145:
-#line 1579 "awkgram.y" /* yacc.c:1646 */
+#line 1628 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3622 "awkgram.c" /* yacc.c:1646 */
+#line 3671 "awkgram.c" /* yacc.c:1646 */
break;
case 146:
-#line 1581 "awkgram.y" /* yacc.c:1646 */
+#line 1630 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3628 "awkgram.c" /* yacc.c:1646 */
+#line 3677 "awkgram.c" /* yacc.c:1646 */
break;
case 147:
-#line 1583 "awkgram.y" /* yacc.c:1646 */
+#line 1632 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3634 "awkgram.c" /* yacc.c:1646 */
+#line 3683 "awkgram.c" /* yacc.c:1646 */
break;
case 148:
-#line 1585 "awkgram.y" /* yacc.c:1646 */
+#line 1634 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3640 "awkgram.c" /* yacc.c:1646 */
+#line 3689 "awkgram.c" /* yacc.c:1646 */
break;
case 149:
-#line 1587 "awkgram.y" /* yacc.c:1646 */
+#line 1636 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3646 "awkgram.c" /* yacc.c:1646 */
+#line 3695 "awkgram.c" /* yacc.c:1646 */
break;
case 150:
-#line 1589 "awkgram.y" /* yacc.c:1646 */
+#line 1638 "awkgram.y" /* yacc.c:1646 */
{
/*
* In BEGINFILE/ENDFILE, allow `getline [var] < file'
@@ -3660,29 +3709,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 3713 "awkgram.c" /* yacc.c:1646 */
break;
case 151:
-#line 1603 "awkgram.y" /* yacc.c:1646 */
+#line 1652 "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 3722 "awkgram.c" /* yacc.c:1646 */
break;
case 152:
-#line 1608 "awkgram.y" /* yacc.c:1646 */
+#line 1657 "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 3731 "awkgram.c" /* yacc.c:1646 */
break;
case 153:
-#line 1613 "awkgram.y" /* yacc.c:1646 */
+#line 1662 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old) {
warning_ln((yyvsp[-1])->source_line,
@@ -3702,64 +3751,64 @@ regular_print:
(yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1]));
}
}
-#line 3706 "awkgram.c" /* yacc.c:1646 */
+#line 3755 "awkgram.c" /* yacc.c:1646 */
break;
case 154:
-#line 1638 "awkgram.y" /* yacc.c:1646 */
+#line 1687 "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 3764 "awkgram.c" /* yacc.c:1646 */
break;
case 155:
-#line 1644 "awkgram.y" /* yacc.c:1646 */
+#line 1693 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3721 "awkgram.c" /* yacc.c:1646 */
+#line 3770 "awkgram.c" /* yacc.c:1646 */
break;
case 156:
-#line 1646 "awkgram.y" /* yacc.c:1646 */
+#line 1695 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3727 "awkgram.c" /* yacc.c:1646 */
+#line 3776 "awkgram.c" /* yacc.c:1646 */
break;
case 157:
-#line 1648 "awkgram.y" /* yacc.c:1646 */
+#line 1697 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3733 "awkgram.c" /* yacc.c:1646 */
+#line 3782 "awkgram.c" /* yacc.c:1646 */
break;
case 158:
-#line 1650 "awkgram.y" /* yacc.c:1646 */
+#line 1699 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3739 "awkgram.c" /* yacc.c:1646 */
+#line 3788 "awkgram.c" /* yacc.c:1646 */
break;
case 159:
-#line 1652 "awkgram.y" /* yacc.c:1646 */
+#line 1701 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3745 "awkgram.c" /* yacc.c:1646 */
+#line 3794 "awkgram.c" /* yacc.c:1646 */
break;
case 160:
-#line 1654 "awkgram.y" /* yacc.c:1646 */
+#line 1703 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3751 "awkgram.c" /* yacc.c:1646 */
+#line 3800 "awkgram.c" /* yacc.c:1646 */
break;
case 161:
-#line 1659 "awkgram.y" /* yacc.c:1646 */
+#line 1708 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3759 "awkgram.c" /* yacc.c:1646 */
+#line 3808 "awkgram.c" /* yacc.c:1646 */
break;
case 162:
-#line 1663 "awkgram.y" /* yacc.c:1646 */
+#line 1712 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->opcode == Op_match_rec) {
(yyvsp[0])->opcode = Op_nomatch;
@@ -3791,37 +3840,37 @@ regular_print:
}
}
}
-#line 3795 "awkgram.c" /* yacc.c:1646 */
+#line 3844 "awkgram.c" /* yacc.c:1646 */
break;
case 163:
-#line 1695 "awkgram.y" /* yacc.c:1646 */
+#line 1744 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3801 "awkgram.c" /* yacc.c:1646 */
+#line 3850 "awkgram.c" /* yacc.c:1646 */
break;
case 164:
-#line 1697 "awkgram.y" /* yacc.c:1646 */
+#line 1746 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3811 "awkgram.c" /* yacc.c:1646 */
+#line 3860 "awkgram.c" /* yacc.c:1646 */
break;
case 165:
-#line 1703 "awkgram.y" /* yacc.c:1646 */
+#line 1752 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3821 "awkgram.c" /* yacc.c:1646 */
+#line 3870 "awkgram.c" /* yacc.c:1646 */
break;
case 166:
-#line 1709 "awkgram.y" /* yacc.c:1646 */
+#line 1758 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
@@ -3834,45 +3883,45 @@ regular_print:
if ((yyval) == NULL)
YYABORT;
}
-#line 3838 "awkgram.c" /* yacc.c:1646 */
+#line 3887 "awkgram.c" /* yacc.c:1646 */
break;
case 169:
-#line 1724 "awkgram.y" /* yacc.c:1646 */
+#line 1773 "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 3896 "awkgram.c" /* yacc.c:1646 */
break;
case 170:
-#line 1729 "awkgram.y" /* yacc.c:1646 */
+#line 1778 "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 3905 "awkgram.c" /* yacc.c:1646 */
break;
case 171:
-#line 1734 "awkgram.y" /* yacc.c:1646 */
+#line 1783 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3864 "awkgram.c" /* yacc.c:1646 */
+#line 3913 "awkgram.c" /* yacc.c:1646 */
break;
case 172:
-#line 1738 "awkgram.y" /* yacc.c:1646 */
+#line 1787 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3872 "awkgram.c" /* yacc.c:1646 */
+#line 3921 "awkgram.c" /* yacc.c:1646 */
break;
case 173:
-#line 1742 "awkgram.y" /* yacc.c:1646 */
+#line 1791 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->lasti->opcode == Op_push_i
&& ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0
@@ -3887,11 +3936,11 @@ regular_print:
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
}
-#line 3891 "awkgram.c" /* yacc.c:1646 */
+#line 3940 "awkgram.c" /* yacc.c:1646 */
break;
case 174:
-#line 1757 "awkgram.y" /* yacc.c:1646 */
+#line 1806 "awkgram.y" /* yacc.c:1646 */
{
/*
* was: $$ = $2
@@ -3901,20 +3950,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 3954 "awkgram.c" /* yacc.c:1646 */
break;
case 175:
-#line 1770 "awkgram.y" /* yacc.c:1646 */
+#line 1819 "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 3963 "awkgram.c" /* yacc.c:1646 */
break;
case 176:
-#line 1775 "awkgram.y" /* yacc.c:1646 */
+#line 1824 "awkgram.y" /* yacc.c:1646 */
{
/* indirect function call */
INSTRUCTION *f, *t;
@@ -3948,11 +3997,11 @@ regular_print:
(yyval) = list_prepend((yyvsp[0]), t);
at_seen = false;
}
-#line 3952 "awkgram.c" /* yacc.c:1646 */
+#line 4001 "awkgram.c" /* yacc.c:1646 */
break;
case 177:
-#line 1812 "awkgram.y" /* yacc.c:1646 */
+#line 1861 "awkgram.y" /* yacc.c:1646 */
{
NODE *n;
@@ -3977,49 +4026,49 @@ regular_print:
(yyval) = list_append(t, (yyvsp[-3]));
}
}
-#line 3981 "awkgram.c" /* yacc.c:1646 */
+#line 4030 "awkgram.c" /* yacc.c:1646 */
break;
case 178:
-#line 1840 "awkgram.y" /* yacc.c:1646 */
+#line 1889 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3987 "awkgram.c" /* yacc.c:1646 */
+#line 4036 "awkgram.c" /* yacc.c:1646 */
break;
case 179:
-#line 1842 "awkgram.y" /* yacc.c:1646 */
+#line 1891 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3993 "awkgram.c" /* yacc.c:1646 */
+#line 4042 "awkgram.c" /* yacc.c:1646 */
break;
case 180:
-#line 1847 "awkgram.y" /* yacc.c:1646 */
+#line 1896 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3999 "awkgram.c" /* yacc.c:1646 */
+#line 4048 "awkgram.c" /* yacc.c:1646 */
break;
case 181:
-#line 1849 "awkgram.y" /* yacc.c:1646 */
+#line 1898 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 4005 "awkgram.c" /* yacc.c:1646 */
+#line 4054 "awkgram.c" /* yacc.c:1646 */
break;
case 182:
-#line 1854 "awkgram.y" /* yacc.c:1646 */
+#line 1903 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 4011 "awkgram.c" /* yacc.c:1646 */
+#line 4060 "awkgram.c" /* yacc.c:1646 */
break;
case 183:
-#line 1856 "awkgram.y" /* yacc.c:1646 */
+#line 1905 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 4019 "awkgram.c" /* yacc.c:1646 */
+#line 4068 "awkgram.c" /* yacc.c:1646 */
break;
case 184:
-#line 1863 "awkgram.y" /* yacc.c:1646 */
+#line 1912 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = (yyvsp[0])->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated expressions */
@@ -4033,11 +4082,11 @@ regular_print:
sub_counter++; /* count # of dimensions */
(yyval) = (yyvsp[0]);
}
-#line 4037 "awkgram.c" /* yacc.c:1646 */
+#line 4086 "awkgram.c" /* yacc.c:1646 */
break;
case 185:
-#line 1880 "awkgram.y" /* yacc.c:1646 */
+#line 1929 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *t = (yyvsp[-1]);
if ((yyvsp[-1]) == NULL) {
@@ -4051,31 +4100,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 4104 "awkgram.c" /* yacc.c:1646 */
break;
case 186:
-#line 1897 "awkgram.y" /* yacc.c:1646 */
+#line 1946 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 4061 "awkgram.c" /* yacc.c:1646 */
+#line 4110 "awkgram.c" /* yacc.c:1646 */
break;
case 187:
-#line 1899 "awkgram.y" /* yacc.c:1646 */
+#line 1948 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 4069 "awkgram.c" /* yacc.c:1646 */
+#line 4118 "awkgram.c" /* yacc.c:1646 */
break;
case 188:
-#line 1906 "awkgram.y" /* yacc.c:1646 */
+#line 1955 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 4075 "awkgram.c" /* yacc.c:1646 */
+#line 4124 "awkgram.c" /* yacc.c:1646 */
break;
case 189:
-#line 1911 "awkgram.y" /* yacc.c:1646 */
+#line 1960 "awkgram.y" /* yacc.c:1646 */
{
char *var_name = (yyvsp[0])->lextok;
@@ -4083,22 +4132,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 4136 "awkgram.c" /* yacc.c:1646 */
break;
case 190:
-#line 1919 "awkgram.y" /* yacc.c:1646 */
+#line 1968 "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 4147 "awkgram.c" /* yacc.c:1646 */
break;
case 191:
-#line 1929 "awkgram.y" /* yacc.c:1646 */
+#line 1978 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = (yyvsp[0])->nexti;
if (ip->opcode == Op_push
@@ -4110,73 +4159,73 @@ regular_print:
} else
(yyval) = (yyvsp[0]);
}
-#line 4114 "awkgram.c" /* yacc.c:1646 */
+#line 4163 "awkgram.c" /* yacc.c:1646 */
break;
case 192:
-#line 1941 "awkgram.y" /* yacc.c:1646 */
+#line 1990 "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 4173 "awkgram.c" /* yacc.c:1646 */
break;
case 193:
-#line 1950 "awkgram.y" /* yacc.c:1646 */
+#line 1999 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postincrement;
}
-#line 4132 "awkgram.c" /* yacc.c:1646 */
+#line 4181 "awkgram.c" /* yacc.c:1646 */
break;
case 194:
-#line 1954 "awkgram.y" /* yacc.c:1646 */
+#line 2003 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postdecrement;
}
-#line 4140 "awkgram.c" /* yacc.c:1646 */
+#line 4189 "awkgram.c" /* yacc.c:1646 */
break;
case 195:
-#line 1957 "awkgram.y" /* yacc.c:1646 */
+#line 2006 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 4146 "awkgram.c" /* yacc.c:1646 */
+#line 4195 "awkgram.c" /* yacc.c:1646 */
break;
case 197:
-#line 1965 "awkgram.y" /* yacc.c:1646 */
+#line 2014 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4152 "awkgram.c" /* yacc.c:1646 */
+#line 4201 "awkgram.c" /* yacc.c:1646 */
break;
case 198:
-#line 1969 "awkgram.y" /* yacc.c:1646 */
+#line 2018 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4158 "awkgram.c" /* yacc.c:1646 */
+#line 4207 "awkgram.c" /* yacc.c:1646 */
break;
case 201:
-#line 1978 "awkgram.y" /* yacc.c:1646 */
+#line 2027 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4164 "awkgram.c" /* yacc.c:1646 */
+#line 4213 "awkgram.c" /* yacc.c:1646 */
break;
case 202:
-#line 1982 "awkgram.y" /* yacc.c:1646 */
+#line 2031 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); yyerrok; }
-#line 4170 "awkgram.c" /* yacc.c:1646 */
+#line 4219 "awkgram.c" /* yacc.c:1646 */
break;
case 203:
-#line 1986 "awkgram.y" /* yacc.c:1646 */
+#line 2035 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 4176 "awkgram.c" /* yacc.c:1646 */
+#line 4225 "awkgram.c" /* yacc.c:1646 */
break;
-#line 4180 "awkgram.c" /* yacc.c:1646 */
+#line 4229 "awkgram.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -4404,7 +4453,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 1988 "awkgram.y" /* yacc.c:1906 */
+#line 2037 "awkgram.y" /* yacc.c:1906 */
struct token {
@@ -5585,6 +5634,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 +5655,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 +8446,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..73111312 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,23 @@ 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;
@@ -529,31 +542,54 @@ a_slash
statements
: /* empty */
{
- if (comment != NULL) {
+ if (prior_comment != NULL) {
+ $$ = list_create(prior_comment);
+ prior_comment = NULL;
+ } else if (comment != NULL) {
$$ = list_create(comment);
comment = NULL;
- } else $$ = NULL;
+ } else
+ $$ = NULL;
}
| statements statement
{
if ($2 == NULL) {
- if (comment == NULL)
- $$ = $1;
- else {
+ if (prior_comment != NULL) {
+ $$ = list_append($1, prior_comment);
+ prior_comment = NULL;
+ if (comment != NULL) {
+ $$ = list_append($$, comment);
+ comment = NULL;
+ }
+ } else if (comment != NULL) {
$$ = list_append($1, comment);
comment = NULL;
- }
+ } else
+ $$ = $1;
} else {
add_lint($2, LINT_no_effect);
if ($1 == NULL) {
- if (comment == NULL)
- $$ = $2;
- else {
+ if (prior_comment != NULL) {
+ $$ = list_append($2, prior_comment);
+ prior_comment = NULL;
+ if (comment != NULL) {
+ $$ = list_append($$, comment);
+ comment = NULL;
+ }
+ } else if (comment != NULL) {
$$ = list_append($2, comment);
comment = NULL;
- }
+ } else
+ $$ = $2;
} else {
- if (comment != NULL) {
+ if (prior_comment != NULL) {
+ list_append($2, prior_comment);
+ prior_comment = NULL;
+ if (comment != NULL) {
+ list_append($2, comment);
+ comment = NULL;
+ }
+ } else if (comment != NULL) {
list_append($2, comment);
comment = NULL;
}
@@ -890,6 +926,7 @@ regular_loop:
$$ = list_prepend($1, instruction(Op_exec_count));
else
$$ = $1;
+ $$ = add_pending_comment($$);
}
;
@@ -901,6 +938,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 +948,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 +959,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 +971,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 +987,7 @@ non_compound_stmt
$$->nexti->memory = dupnode(Nnull_string);
} else
$$ = list_append($2, $1);
+ $$ = add_pending_comment($$);
}
| LEX_RETURN
{
@@ -970,6 +1012,7 @@ non_compound_stmt
$$ = list_append($3, $1);
}
+ $$ = add_pending_comment($$);
}
| simple_stmt statement_term
;
@@ -1079,6 +1122,7 @@ regular_print:
}
}
}
+ $$ = add_pending_comment($$);
}
| LEX_DELETE NAME { sub_counter = 0; } delete_subscript_list
@@ -1113,6 +1157,7 @@ regular_print:
$1->expr_count = sub_counter;
$$ = list_append(list_append($4, $2), $1);
}
+ $$ = add_pending_comment($$);
}
| LEX_DELETE '(' NAME ')'
/*
@@ -1143,9 +1188,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 +3214,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 +3235,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 +6026,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..3eca03bd 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;
@@ -774,28 +785,33 @@ cleanup:
fprintf(prof_fp, "%s (", op2str(pc->opcode));
pprint(pc->nexti, ip1->while_body, NO_PPRINT_FLAGS);
t1 = pp_pop();
- fprintf(prof_fp, "%s) {\n", t1->pp_str);
+ fprintf(prof_fp, "%s) {", t1->pp_str);
pp_free(t1);
+ ip1->while_body = end_line(ip1->while_body);
indent_in();
pprint(ip1->while_body->nexti, pc->target_break, NO_PPRINT_FLAGS);
indent_out();
indent(SPACEOVER);
- fprintf(prof_fp, "}\n");
- pc = pc->target_break;
+ fprintf(prof_fp, "}");
+ pc = end_line(pc->target_break);
break;
case Op_K_do:
ip1 = pc + 1;
indent(pc->nexti->exec_count);
- fprintf(prof_fp, "%s {\n", op2str(pc->opcode));
+ fprintf(prof_fp, "%s {", op2str(pc->opcode));
+ end_line(pc->nexti);
+ skip_comment = true;
indent_in();
pprint(pc->nexti->nexti, ip1->doloop_cond, NO_PPRINT_FLAGS);
indent_out();
pprint(ip1->doloop_cond, pc->target_break, NO_PPRINT_FLAGS);
indent(SPACEOVER);
t1 = pp_pop();
- fprintf(prof_fp, "} %s (%s)\n", op2str(Op_K_while), t1->pp_str);
+ fprintf(prof_fp, "} %s (%s)", op2str(Op_K_while), t1->pp_str);
pp_free(t1);
+ end_line(pc->target_break);
+ skip_comment = true;
pc = pc->target_break;
break;
@@ -825,12 +841,16 @@ cleanup:
pprint(pc->target_continue, pc->target_break, IN_FOR_HEADER);
}
- fprintf(prof_fp, ") {\n");
+ fprintf(prof_fp, ") {");
+ end_line(ip1->forloop_body);
+ skip_comment = true;
indent_in();
pprint(ip1->forloop_body->nexti, pc->target_continue, NO_PPRINT_FLAGS);
indent_out();
indent(SPACEOVER);
- fprintf(prof_fp, "}\n");
+ fprintf(prof_fp, "}");
+ end_line(pc->target_break);
+ skip_comment = true;
pc = pc->target_break;
break;
@@ -848,14 +868,18 @@ cleanup:
else
item = m->vname;
indent(ip1->forloop_body->exec_count);
- fprintf(prof_fp, "%s (%s%s%s) {\n", op2str(Op_K_arrayfor),
+ fprintf(prof_fp, "%s (%s%s%s) {", op2str(Op_K_arrayfor),
item, op2str(Op_in_array), array);
+ end_line(ip1->forloop_body);
+ skip_comment = true;
indent_in();
pp_free(t1);
pprint(ip1->forloop_body->nexti, pc->target_break, NO_PPRINT_FLAGS);
indent_out();
indent(SPACEOVER);
- fprintf(prof_fp, "}\n");
+ fprintf(prof_fp, "}");
+ end_line(pc->target_break);
+ skip_comment = true;
pc = pc->target_break;
}
break;
@@ -878,10 +902,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();
@@ -897,14 +924,19 @@ cleanup:
ip1 = pc->branch_if;
if (ip1->exec_count > 0)
fprintf(prof_fp, " # %ld", ip1->exec_count);
- end_line(pc);
+ ip1 = end_line(ip1);
indent_in();
pprint(ip1->nexti, pc->branch_else, NO_PPRINT_FLAGS);
indent_out();
pc = pc->branch_else;
if (pc->nexti->opcode == Op_no_op) { /* no following else */
indent(SPACEOVER);
- fprintf(prof_fp, "}\n");
+ fprintf(prof_fp, "}");
+ if (pc->nexti->nexti->opcode != Op_comment
+ || pc->nexti->nexti->memory->comment_type == FULL_COMMENT)
+ fprintf(prof_fp, "\n");
+ /* else
+ It will be printed at the top. */
}
/*
* See next case; turn off the flag so that the
@@ -933,13 +965,22 @@ cleanup:
&& pc->branch_end == pc->nexti->nexti->branch_else->lasti) {
pprint(pc->nexti, pc->branch_end, IN_ELSE_IF);
} else {
- fprintf(prof_fp, "{\n");
+ fprintf(prof_fp, "{");
+ end_line(pc);
+ skip_comment = true;
indent_in();
pprint(pc->nexti, pc->branch_end, NO_PPRINT_FLAGS);
indent_out();
indent(SPACEOVER);
- fprintf(prof_fp, "}\n");
+ fprintf(prof_fp, "}");
+ end_line(pc->branch_end);
+ skip_comment = true;
}
+ /*
+ * Don't do end_line() here, we get multiple blank lines after
+ * the final else in a chain of else-ifs since they all point
+ * to the same branch_end.
+ */
pc = pc->branch_end;
break;
@@ -996,17 +1037,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 +1781,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/ChangeLog b/test/ChangeLog
index 66bed645..c5536f01 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,13 @@
+2016-03-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile5.ok, profile10.awk, profile10.ok: Adjust after code changes.
+
+2016-03-19 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile5.ok: Adjust after code changes.
+ * Makefile.am (profile10): New test.
+ * profile10.awk, profile10.ok: New files.
+
2016-02-18 Arnold D. Robbins <arnold@skeeve.com>
* profile2.ok, profile5.ok: Adjust after code changes.
diff --git a/test/Makefile.am b/test/Makefile.am
index 2147d34b..776dfbd0 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -778,6 +778,8 @@ EXTRA_DIST = \
profile8.ok \
profile9.awk \
profile9.ok \
+ profile10.awk \
+ profile10.ok \
prt1eval.awk \
prt1eval.ok \
prtoeval.awk \
@@ -1134,7 +1136,7 @@ GAWK_EXT_TESTS = \
nonfatal1 nonfatal2 nonfatal3 \
patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \
profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 \
- profile8 profile9 pty1 \
+ profile8 profile9 profile10 pty1 \
rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \
rsstart2 rsstart3 rstest6 shadow shadowbuiltin \
sortfor sortu split_after_fpat \
@@ -1869,6 +1871,11 @@ profile9:
@$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+profile10:
+ @echo $@
+ @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
posix2008sub:
@echo $@
@$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1
diff --git a/test/Makefile.in b/test/Makefile.in
index 927be043..7c3a5a00 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1035,6 +1035,8 @@ EXTRA_DIST = \
profile8.ok \
profile9.awk \
profile9.ok \
+ profile10.awk \
+ profile10.ok \
prt1eval.awk \
prt1eval.ok \
prtoeval.awk \
@@ -1390,7 +1392,7 @@ GAWK_EXT_TESTS = \
nonfatal1 nonfatal2 nonfatal3 \
patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge procinfs \
profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7 \
- profile8 profile9 pty1 \
+ profile8 profile9 profile10 pty1 \
rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \
rsstart2 rsstart3 rstest6 shadow shadowbuiltin \
sortfor sortu split_after_fpat \
@@ -2308,6 +2310,11 @@ profile9:
@$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+profile10:
+ @echo $@
+ @$(AWK) --pretty-print=_$@ -f "$(srcdir)"/$@.awk > /dev/null
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
posix2008sub:
@echo $@
@$(AWK) --posix -f "$(srcdir)"/$@.awk > _$@ 2>&1
diff --git a/test/profile10.awk b/test/profile10.awk
new file mode 100644
index 00000000..b78ae447
--- /dev/null
+++ b/test/profile10.awk
@@ -0,0 +1,42 @@
+BEGIN { # Comment 0
+ if (1) { # Comment 1
+ print "ABC" # Comment2
+ } else { # Comment 3
+ print "XYZ" # Comment 4
+ } # Comment 5
+
+ while (c == d) { # Comment 6
+ print "DEF" # Comment 7
+ } # Comment 8
+
+ do { # Comment 9
+ print "GHI" # Comment 10
+ } while (e == f) # Comment 11
+
+ for (i in data) { # Comment 12
+ print "JKL" # Comment 13
+ } # Comment 14
+
+ for (z = 1; z <= 10; z++) { # Comment 15
+ print "MNO" # Comment 16
+ } # Comment 17
+
+ switch (q) { # Comment 18
+ case "a": # Comment 19
+ case "b":
+ # Comment 20
+ break # Comment 21
+ default: # Comment 22
+ break # Comment 23
+ } # Comment 24
+
+ if (1) {
+ print "foo"
+ } # Comment 25
+
+ if (2) {
+ print "bar"
+ }
+ # Comment 26
+}
+# Comment 27
diff --git a/test/profile10.ok b/test/profile10.ok
new file mode 100644
index 00000000..13f0b67b
--- /dev/null
+++ b/test/profile10.ok
@@ -0,0 +1,40 @@
+BEGIN { # Comment 0
+ if (1) { # Comment 1
+ print "ABC" # Comment2
+ } else { # Comment 3
+ print "XYZ" # Comment 4
+ } # Comment 5
+ while (c == d) { # Comment 6
+ print "DEF" # Comment 7
+ } # Comment 8
+ do { # Comment 9
+ print "GHI" # Comment 10
+ } while (e == f) # Comment 11
+ for (i in data) { # Comment 12
+ print "JKL" # Comment 13
+ } # Comment 14
+ for (z = 1; z <= 10; z++) { # Comment 15
+ print "MNO" # Comment 16
+ } # Comment 17
+ switch (q) {
+ case "a":
+ # Comment 18
+ case "b":
+ # Comment 19
+ break # Comment 20
+ # Comment 21
+ default:
+ # Comment 22
+ break # Comment 23
+ }
+ # Comment 24
+ if (1) {
+ print "foo"
+ } # Comment 25
+ if (2) {
+ print "bar"
+ }
+ # Comment 26
+}
+
+# Comment 27
diff --git a/test/profile5.ok b/test/profile5.ok
index 95c77401..1ffaf438 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,23 @@ function _addlib(f)
#_______________________________________________________________________
function _addlist(A, v)
{
+ ##################################################
A[++A[0]] = v
}
-#_______________________________________________________________________
+############################################
function _bearray(A)
{
+ #_______________________________________________________________________
if (isarray(A) || A == 0 && A == "") {
- return 1
+ return 1 ####################################################
}
}
#_________________________________________________________________
function _bframe(A, t, p)
{
+ ###########################################
return _bframe_i0(A, t, p, A[""])
}
@@ -1611,6 +1632,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 +1699,7 @@ function _cfguidl(p, H, L, hi, h, hl, li)
#____________________________________________________________________________________________________
function _check(p)
{
+ ####################################################################################
_dll_check(p)
_file_check(p)
_serv_check(p)
@@ -1686,12 +1709,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 +1734,7 @@ function _cmd(c, i, A)
#_______________________________________________________________________
function _cmparr(A0, A1, R, a, i)
{
+ ##########################################
a = 0
delete R
for (i in A0) {
@@ -1732,6 +1758,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 +1800,7 @@ function _con(t, ts, a, b, c, d, i, r, A, B)
#_______________________________________________________________________
function _conin(t, a, b)
{
+ #################################################
_constatpush()
_constat()
a = BINMODE
@@ -1794,12 +1822,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 +1846,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 +1883,7 @@ function _constatgtstr(t, ln, a, b)
#_______________________________________________________________________
function _constatpop()
{
+ ##################################################
if (_CONSTATPUSH[0] > 0) {
return _constat(_CONSTATPUSH[_CONSTATPUSH[0]--])
}
@@ -1861,6 +1893,7 @@ function _constatpop()
#_______________________________________________________________________
function _constatpush(t, ts)
{
+ #############################################
_CONSTATPUSH[++_CONSTATPUSH[0]] = _constatstr
if (t) {
_constat(t, ts)
@@ -1877,6 +1910,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 +1919,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 +1956,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 +1968,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 +1986,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 +1996,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 +2005,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 +2034,7 @@ function _del(f, c, a, A)
#_______________________________________________________________________
function _delay(t, a)
{
+ ###################################################
for (a = 1; a <= t; a++) {
_delayms()
}
@@ -2001,6 +2043,7 @@ function _delay(t, a)
#_________________________________________________________________
function _delayms(a)
{
+ #############################################
for (a = 1; a <= _delay_perfmsdelay; a++) {
}
}
@@ -2008,6 +2051,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 +2064,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 +2073,7 @@ function _delf(A, f)
#_______________________________________________________________________
function _deluid(p)
{
+ ################################################# 1 #
if (p in _CLASSPTR) {
_deluida0 = _CLASSPTR[p]
if (_deluida0 in _UIDOBL) {
@@ -2041,6 +2087,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 +2117,7 @@ function _dir(A, rd, i, r, f, ds, pf, B, C)
#_________________________________________________________________
function _dirtree(A, f, B)
{
+ #########################################
gsub(/(^[ \t]*)|([ \t]*$)/, "", f)
delete A
A[""]
@@ -2136,7 +2184,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 +2276,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 +2341,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 +2409,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 +2428,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 +2505,7 @@ function _endpass(t)
#_______________________________________________________________________
function _err(t, a, b)
{
+ ###################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -2466,12 +2520,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 +2538,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 +2557,7 @@ function _export_data(t, i, A)
#_____________________________________________________________________________
function _expout(t, d, a, b)
{
+ ####################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -2521,6 +2580,7 @@ function _expout(t, d, a, b)
function _extfn_init()
{
+ ##############################################################
_formatstrs_init()
_formatstrd_init()
_formatrexp_init()
@@ -2553,6 +2613,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 +2644,11 @@ 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[""])
+ #_______________________________________________________________________
+ return _fframe_i0(A, t, p, A[""]) #################################################
}
#___________________________________________________________
@@ -2598,6 +2660,7 @@ function _fframe_i0(A, t, p, f)
#_________________________________________________________________
function _file(f)
{
+ #################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2644,6 +2707,7 @@ function _file_check_i0(p, pp, p1, p2, f, v)
#_________________________________________________________________
function _filed(f, dd, d)
{
+ ##########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2668,6 +2732,7 @@ function _filed(f, dd, d)
#_________________________________________________________________
function _filen(f)
{
+ ################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2677,6 +2742,7 @@ function _filen(f)
#_________________________________________________________________
function _filene(f)
{
+ ###############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2686,6 +2752,7 @@ function _filene(f)
#_________________________________________________________________
function _filenotexist(f, a)
{
+ ######################################
if (f == "") {
return ""
}
@@ -2703,6 +2770,7 @@ function _filenotexist(f, a)
#_______________________________________________________________________
function _filepath(f, dd)
{
+ ################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2712,6 +2780,7 @@ function _filepath(f, dd)
#_________________________________________________________________
function _filer(f, dd)
{
+ #############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2727,6 +2796,7 @@ function _filer(f, dd)
#_________________________________________________________________
function _filerd(f, dd)
{
+ ############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2736,6 +2806,7 @@ function _filerd(f, dd)
#_________________________________________________________________
function _filerdn(f, dd)
{
+ ###########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2745,6 +2816,7 @@ function _filerdn(f, dd)
#_________________________________________________________________
function _filerdne(f, dd)
{
+ ##########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2815,6 +2887,7 @@ function _filerdnehnd(st, c, r, d, n, A)
#_______________________________________________________________________
function _filexist(f, a)
{
+ ################################################
if (f == "") {
return ""
}
@@ -2833,6 +2906,7 @@ function _filexist(f, a)
#_______________________________________________________________________
function _fn(f, p0, p1, p2)
{
+ ################################################
if (f in FUNCTAB) {
return @f(p0, p1, p2)
}
@@ -2841,6 +2915,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 +2984,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 +3054,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 +3064,7 @@ function _gensubfn(t, r, f, p0, A)
#_____________________________________________________________________________
function _get_errout(p)
{
+ #######################################################
return _tframe("_get_errout_i0", p)
}
@@ -3041,6 +3119,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 +3143,7 @@ function _get_logout_i0(p, t, n, a)
#_______________________________________________________________________
function _getchrln(s, w)
{
+ #################################################
if (s == "") {
return
}
@@ -3089,12 +3169,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 +3195,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 +3205,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 +3225,7 @@ function _getmpdir(f, dd)
#_________________________________________________________________
function _getmpfile(f, dd)
{
+ #########################################
if (! dd || ! (dd = _filerd(dd))) {
dd = _FILEIO_TMPRD
}
@@ -3152,6 +3238,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 +3334,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 +3352,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 +3385,7 @@ function _handle8494(t)
#_____________________________________________________________________________
function _hexnum(n, l)
{
+ #########################################################
if (l + 0 < 1) {
l = 2
}
@@ -3304,6 +3395,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 +3426,7 @@ function _import_data(t, p, p2, a)
#_______________________________________________________________________
function _info(t, d, A)
{
+ ##################################################
if (_ERRLOG_IF) {
A["TYPE"] = "INFO"
A["TEXT"] = t
@@ -3405,6 +3498,7 @@ function _initsys()
#_______________________________________________________________________
function _inituid(p, cs, dptr, pfx, sfx, hstr, lstr, A)
{
+ ################### 1 #
if (cs == 0 && cs == "") {
cs = p
p = _getuid()
@@ -3464,6 +3558,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 +3582,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 +3607,7 @@ function _inspass(A, f)
#_______________________________________________________________________
function _isptr(p)
{
+ ################################################## 1 #
if (isarray(p)) {
is = _NOP
it = "A"
@@ -3529,6 +3628,7 @@ function _isptr(p)
#_______________________________________________________________________
function _istr(p)
{
+ ################################################### 1 #
if (isarray(p)) {
is = _NOP
it = "A"
@@ -3545,6 +3645,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 +3688,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 +3716,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 +3758,7 @@ function _macsfx94(F, D, C, p1, p2, p3)
#_______________________________________________________________________
function _movarr(D, S)
{
+ ###################################################
delete D
D[""]
delete D[""]
@@ -3771,6 +3876,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 +3933,7 @@ function _nN_i0(p, F, v)
#_________________________________________________________________
function _newclrdir(f)
{
+ ############################################
if ((f = _filerd(f)) == "") {
return
}
@@ -3839,6 +3946,7 @@ function _newclrdir(f)
#_______________________________________________________________________
function _newdir(f)
{
+ #####################################################
if ((f = _filerd(f)) == "") {
return
}
@@ -3849,9 +3957,10 @@ function _newdir(f)
return f
}
-#_______________________________________________________________________
+##############################
function _nop(p0, p1, p2, p3)
{
+ #_______________________________________________________________________
}
#_____________________________________________________
@@ -3872,6 +3981,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 +4001,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 +4026,7 @@ function _nretarrd(A, i, v, r, q)
#___________________________________________________________________________________
function _out(t, a, b)
{
+ ###############################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -3929,6 +4041,7 @@ function _out(t, a, b)
#_________________________________________________________________
function _outnl(t)
{
+ ################################################
return _out(t ((t ~ /\x0A$/ ? "" : _CHR["EOL"])))
}
@@ -3983,6 +4096,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 +4119,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 +4260,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 +4360,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 +4371,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 +4407,7 @@ function _rEG(c, t, P, a, A)
#_______________________________________________________________________
function _rFBRO(p)
{
+ ######################################################
if (p) {
if (p in _tPARENT) {
return _tFCHLD[_tPARENT[p]]
@@ -4302,16 +4423,18 @@ function _rFBRO(p)
#_______________________________________________________________________
function _rFCHLD(p)
{
+ #####################################################
if (p && p in _tFCHLD) {
return _tFCHLD[p]
}
return ""
}
-#_______________________________________________________________________
+######################## p="", !v
function _rLBRO(p)
{
- if (p) {
+ #_______________________________________________________________________
+ if (p) { ######################################################
if (p in _tPARENT) {
return _tLCHLD[_tPARENT[p]]
}
@@ -4323,10 +4446,11 @@ function _rLBRO(p)
return p
}
-#_______________________________________________________________________
+######################## p=""
function _rLCHLD(p)
{
- if (p && p in _tLCHLD) {
+ #_______________________________________________________________________
+ if (p && p in _tLCHLD) { #####################################################
return _tLCHLD[p]
}
return ""
@@ -4335,40 +4459,45 @@ function _rLCHLD(p)
#_______________________________________________________________________
function _rLINK(p)
{
+ ######################################################
return ((p in _tLINK ? _tLINK[p] : ""))
}
-#_______________________________________________________________________
+######################## p=""
function _rNEXT(p)
{
- if (p && p in _tNEXT) {
+ #_______________________________________________________________________
+ if (p && p in _tNEXT) { ######################################################
return _tNEXT[p]
}
return ""
}
-#_______________________________________________________________________
+######################## p=""
function _rPARENT(p)
{
- if (p && p in _tPARENT) {
+ #_______________________________________________________________________
+ if (p && p in _tPARENT) { ####################################################
return _tPARENT[p]
}
return ""
}
-#_______________________________________________________________________
+######################## p=""
function _rPREV(p)
{
- if (p && p in _tPREV) {
+ #_______________________________________________________________________
+ if (p && p in _tPREV) { ######################################################
return _tPREV[p]
}
return ""
}
-#_______________________________________________________________________
+######################## p=""
function _rQBRO(p, c, p1)
{
- if (p) {
+ #_______________________________________________________________________
+ if (p) { ################################################
if (p in _tPARENT) {
return _tQCHLD[_tPARENT[p]]
}
@@ -4387,10 +4516,11 @@ function _rQBRO(p, c, p1)
return p
}
-#_______________________________________________________________________
+######################## p=""
function _rQCHLD(p)
{
- if (p && p in _tQCHLD) {
+ #_______________________________________________________________________
+ if (p && p in _tQCHLD) { #####################################################
return _tQCHLD[p]
}
return ""
@@ -4402,6 +4532,7 @@ function _rQCHLD(p)
#_____________________________________________________________________________
function _rSQFIRST(g, p, A)
{
+ #####################################################
if (isarray(A)) {
return _rSQFIRSTA(g, p, A)
}
@@ -4413,6 +4544,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 +4556,7 @@ function _rSQFIRSTA(g, p, A)
#_______________________________________________________________________
function _rSQNEXT(g, p, A)
{
+ ################################################
if (isarray(A)) {
return _rSQNEXTA(g, p, A)
}
@@ -4433,6 +4566,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 +4612,7 @@ function _rd_shortcut(D, f)
#_______________________________________________________________________
function _rdfile(f, i, A)
{
+ ################################################
if ((f = _filerdne(f)) == "" || _filene(f) == "") {
ERRNO = "Filename error"
return
@@ -4530,6 +4665,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 +4800,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 +4824,7 @@ function _regpath0(D, i, s, q, S)
#_________________________________________________________________________________________
function _report(p)
{
+ #######################################################################
_report_t0 = _reportparnt = ""
_report_i0(p)
_tframe("_report_i0", p)
@@ -4784,6 +4922,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 +4946,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 +4984,7 @@ function _rexpfnend(t)
#_____________________________________________________________________________
function _rexpstr(r, i, c, A)
{
+ ###################################################
c = split(r, A, "")
r = ""
for (i = 1; i <= c; i++) {
@@ -4885,6 +5026,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 +5142,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 +5169,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 +5220,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 +5233,7 @@ function _setarrsort(f, a)
#_______________________________________________________________________
function _setmpath(p, a)
{
+ ################################################
ERRNO = ""
if (p && (a = _filerd(p))) {
if (_FILEIO_TMPRD) {
@@ -5123,6 +5271,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 +5291,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 +5301,40 @@ function _sharepath(h, s, A)
function _shortcut(D, S)
{
+ #############################################################
if (isarray(D)) {
if (isarray(S)) {
_addarrmask(D, S, _SHORTCUTWSTRUC)
- } else if (S == 0 && S == "") {
+ } else if (S == 0 && S == "") { # array,array2* - copy from array2 to array shorcut-specific elements
_addarrmask(D, _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
- } else if (_isnotfileptr(S)) {
+ } 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 == "") {
+ } else if (S == 0 && S == "") { # ptr,array* - copy from array to array _[ptr] shorcut-specific elements
_addarrmask(_[D], _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
- } else if (_isnotfileptr(S)) {
+ } 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 {
+ } 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 +5518,7 @@ function _splitpath_test()
#_______________________________________________________________________
function _splitstr(A, t, r)
{
+ ########################################### 1 #
if (_istr(t)) {
if (_splitstr_i0(A, t) > 0) {
return _splitstrp0
@@ -5542,6 +5694,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 +5737,7 @@ function _tOBJ(c, t, P)
#_______________________________________________________________________
function _tOBJ_CLEANUP(p)
{
+ ##############################################
for (p in UIDSDEL) {
delete _ptr[p]
delete _tPREV[p]
@@ -5602,6 +5756,7 @@ function _tOBJ_CLEANUP(p)
#_______________________________________________________________________
function _tabtospc(t, ts, xc, a, c, n, A, B)
{
+ ##################################
if (! ts) {
ts = _TAB_STEP_DEFAULT
}
@@ -5638,6 +5793,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 +5812,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 +5831,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 +5850,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 +5869,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 +5953,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 +6037,7 @@ function _tdel_i1(A, i)
#_____________________________________________________________________________
function _tdelete(p, v)
{
+ ####################################################### # REMAKE EXCLUDE
if (p) {
_wLCHLD(_tDELPTR, p)
}
@@ -5881,6 +6047,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 +6060,7 @@ function _tdelitem(p)
#_______________________________________________________________________
function _tend(a, b)
{
+ #####################################################
if (b == "") {
return (_t_ENDF[_t_ENDF[0]] = a)
} else {
@@ -5903,6 +6071,7 @@ function _tend(a, b)
#_____________________________________________________________________________
function _texclude(p, v, pp)
{
+ ################################################### # TEST!!!
if (p in _) {
if (p in _tPARENT) {
pp = _tPARENT[p]
@@ -5945,6 +6114,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 +6124,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 +6191,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 +6247,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 +6303,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 +6359,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 +6433,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 +6543,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 +6562,7 @@ function _tgetitem(p, n, a, b)
#_________________________________________________________________
function _tgetsp(p)
{
+ ###############################################
return _tSTACK[p][0]
}
@@ -6396,33 +6574,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 +6775,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 +6785,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 +6796,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 +6806,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 +6817,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 +6845,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 +6856,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 +6866,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 +6910,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 +6929,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 +6948,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 +6964,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 +7003,7 @@ function _tr(n, cs, H)
#_______________________________________________________________________
function _trace(t, d, A)
{
+ #################################################
if (_ERRLOG_TF) {
A["TYPE"] = "TRACE"
A["TEXT"] = t
@@ -6818,6 +7014,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 +7030,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 +7232,7 @@ function _typa(p, A)
#_______________________________________________________________________
function _tzend(a, b)
{
+ #####################################################
if (b == 0 && b == "") {
return (_TEND[_TEND[_ARRLEN]] = a)
} else {
@@ -7170,6 +7372,7 @@ function _unstr(t)
#_________________________________________________________________
function _untmp(f, a)
{
+ #############################################
if (f = filepath(f)) {
if (match(f, /\\$/)) {
_deletepfx(_FILEIO_RDTMP, a = toupper(f))
@@ -7221,6 +7424,7 @@ function _var(v, t)
#_______________________________________________________________________
function _verb(t, d, A)
{
+ ##################################################
if (_ERRLOG_VF) {
A["TYPE"] = "VERB"
A["TEXT"] = t
@@ -7231,13 +7435,14 @@ function _verb(t, d, A)
#_________________________________________________________________
function _wFBRO(p, v, a)
{
+ ###########################################
if (p) {
if (v) {
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
return v
}
- }
+ } ######################## v is parentesis of p
if (p in _tPARENT) {
p = _tPARENT[p]
if (v in _tNEXT) {
@@ -7327,15 +7532,15 @@ function _wFBRO(p, v, a)
} else {
if (v == 0) {
return v
- }
+ } ######################## p=ptr, v=0
return v
}
- } else {
+ } 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 +7549,17 @@ 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]
@@ -7408,7 +7614,7 @@ function _wFCHLD(p, v, a)
return (_tFCHLD[_tPARENT[v] = p] = _tLCHLD[p] = v)
} else {
if (v == 0) {
- if (p in _tFCHLD) {
+ if (p in _tFCHLD) { ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -7420,9 +7626,9 @@ function _wFCHLD(p, v, a)
}
return v
}
- } else {
+ } else { ######################## p=ptr, v="" > ignore action
if (p == 0) {
- return v
+ return v ######################## p=0
}
return v
}
@@ -7431,13 +7637,14 @@ function _wFCHLD(p, v, a)
#_________________________________________________________________
function _wLBRO(p, v, a)
{
+ ###########################################
if (p) {
if (v) {
for (a = p; a in _tPARENT; ) {
if ((a = _tPARENT[a]) == v) {
return v
}
- }
+ } ######################## v is parentesis of p
if (p in _tPARENT) {
p = _tPARENT[p]
if (v in _tPREV) {
@@ -7527,15 +7734,15 @@ function _wLBRO(p, v, a)
} else {
if (v == 0) {
return v
- }
+ } ######################## p=ptr, v=0
return v
}
- } else {
+ } 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 +7751,17 @@ 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]
@@ -7608,7 +7816,7 @@ function _wLCHLD(p, v, a)
return (_tLCHLD[_tPARENT[v] = p] = _tFCHLD[p] = v)
} else {
if (v == 0) {
- if (p in _tFCHLD) {
+ if (p in _tFCHLD) { ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -7620,9 +7828,9 @@ function _wLCHLD(p, v, a)
}
return v
}
- } else {
+ } else { ######################## p=ptr, v="" > ignore action
if (p == 0) {
- return v
+ return v ######################## p=0
}
return v
}
@@ -7631,22 +7839,24 @@ 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
@@ -7694,15 +7904,15 @@ function _wNEXT(p, v, a, b)
} else {
if (v == 0) {
return v
- }
+ } ######################## p=ptr, v=0
return v
}
- } else {
+ } 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 +7921,24 @@ 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
@@ -7774,15 +7986,15 @@ function _wPREV(p, v, a, b)
} else {
if (v == 0) {
return v
- }
+ } ######################## p=ptr, v=0
return v
}
- } else {
+ } 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 +8003,19 @@ function _wPREV(p, v, a, b)
#_________________________________________________________________
function _wQBRO(p, v)
{
+ ##############################################
return v
}
#_________________________________________________________________
function _wQCHLD(p, v)
{
+ #############################################
if (p) {
if (v) {
- } else {
+ } else { ######################## p=ptr, v=ptr
if (v == 0) {
- if (p in _tFCHLD) {
+ if (p in _tFCHLD) { ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -7813,10 +8027,10 @@ function _wQCHLD(p, v)
}
return v
}
- } else {
+ } else { ######################## p=ptr, v="" > ignore action
if (p == 0) {
return v
- }
+ } ######################## p=0
return v
}
}
@@ -7824,6 +8038,7 @@ function _wQCHLD(p, v)
#_______________________________________________________________________
function _warning(t, d, A)
{
+ ###############################################
if (_ERRLOG_WF) {
A["TYPE"] = "WARNING"
A["TEXT"] = t
@@ -7875,6 +8090,7 @@ function _wr_shortcut(f, S)
#_________________________________________________________________
function _wrfile(f, d, a, b)
{
+ #########################################
if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") {
ERRNO = "Filename error"
return
@@ -7900,6 +8116,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 +8142,7 @@ function _wrfile1(f, d, a, b)
#_______________________________________________________________________
function _yexport(p)
{
+ #####################################################
return _tframe("_yexport_i0", p)
}
@@ -7945,6 +8163,7 @@ function _yexport_i0(p, p0, p1, p2)
#_________________________________________________________________
function cmp_str_idx(i1, v1, i2, v2)
{
+ ##############################
return ((i1 < i2 ? -1 : 1))
}
@@ -8099,6 +8318,7 @@ function hujf(a, b, c)
#___________________________________________________________
function ncmp_str_idx(i1, v1, i2, v2)
{
+ #######################
return ((i1 < i2 ? 1 : -1))
}
@@ -8225,4 +8445,5 @@ function zorr(A, i, r)
#_____________________________________________________________________________
function zzer()
{
+ ################################################################
}