summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-12-12 06:16:43 +0200
committerArnold D. Robbins <arnold@skeeve.com>2014-12-12 06:16:43 +0200
commitfa9d1a09cfe9e7386746a2c6523b5503d1b4aff9 (patch)
tree93978608230ffd409cd8a32eaa4225d7f4905c83
parentedfe2064ee8285ccc70b9254ed191d5cef1de14f (diff)
downloadgawk-fa9d1a09cfe9e7386746a2c6523b5503d1b4aff9.tar.gz
Improve comment handling in pretty printing.
-rw-r--r--ChangeLog17
-rw-r--r--awk.h5
-rw-r--r--awkgram.c788
-rw-r--r--awkgram.y70
-rw-r--r--profile.c181
-rw-r--r--test/ChangeLog5
-rw-r--r--test/profile5.ok707
7 files changed, 976 insertions, 797 deletions
diff --git a/ChangeLog b/ChangeLog
index ac30d2b4..a9c7e555 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2014-12-12 Stephen Davies <sdavies@sdc.com.au>
+
+ Improve comment handling in pretty printing.
+
+ * awk.h (comment_type): New field in the node.
+ (EOL_COMMENT, FULL_COMMENT): New defines.
+ * awkgram.y (block_comment): New variable.
+ (check_comment): New function.
+ (grammar): Add code to handle comments as needed.
+ (get_comment): Now takes a flag indicating kind of comment.
+ (yylex): Collect comments appropriately.
+ (append_rule): Ditto.
+ * profile.c (pprint): Smarten up comment handling.
+ Have printing \n take comments into account.
+ (end_line): New function.
+ (pp_func): Better handling of function comments.
+
2014-12-10 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c: Sync with GNU grep.
diff --git a/awk.h b/awk.h
index a932b54d..41181529 100644
--- a/awk.h
+++ b/awk.h
@@ -530,6 +530,11 @@ typedef struct exp_node {
#define adepth sub.nodep.l.ll
#define alevel sub.nodep.x.xl
+/* Op_comment */
+#define comment_type sub.val.idx
+#define EOL_COMMENT 1
+#define FULL_COMMENT 2
+
/* --------------------------------lint warning types----------------------------*/
typedef enum lintvals {
LINT_illegal,
diff --git a/awkgram.c b/awkgram.c
index ddd41d5b..225cdb4e 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -128,6 +128,7 @@ static void check_funcs(void);
static ssize_t read_one_line(int fd, void *buffer, size_t count);
static int one_line_close(int fd);
static void split_comment(void);
+static void check_comment(void);
static bool want_source = false;
static bool want_regexp = false; /* lexical scanning kludge */
@@ -190,8 +191,10 @@ static INSTRUCTION *ip_beginfile;
static INSTRUCTION *comment = NULL;
static INSTRUCTION *program_comment = NULL;
static INSTRUCTION *function_comment = NULL;
+static INSTRUCTION *block_comment = NULL;
static bool func_first = true;
+static bool first_rule = true;
static inline INSTRUCTION *list_create(INSTRUCTION *x);
static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x);
@@ -202,7 +205,7 @@ extern double fmod(double x, double y);
#define YYSTYPE INSTRUCTION *
-#line 206 "awkgram.c" /* yacc.c:339 */
+#line 209 "awkgram.c" /* yacc.c:339 */
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
@@ -356,7 +359,7 @@ int yyparse (void);
/* Copy the second part of user declarations. */
-#line 360 "awkgram.c" /* yacc.c:358 */
+#line 363 "awkgram.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -658,25 +661,25 @@ static const yytype_uint8 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 205, 205, 207, 212, 213, 219, 231, 235, 246,
- 252, 257, 265, 273, 275, 280, 288, 290, 296, 304,
- 314, 340, 353, 366, 373, 383, 395, 397, 399, 405,
- 410, 411, 415, 450, 449, 483, 485, 490, 496, 524,
- 529, 530, 534, 536, 538, 545, 635, 677, 719, 832,
- 839, 846, 856, 865, 874, 883, 894, 910, 909, 933,
- 945, 945, 1043, 1043, 1076, 1106, 1112, 1113, 1119, 1120,
- 1127, 1132, 1144, 1158, 1160, 1168, 1173, 1175, 1183, 1185,
- 1194, 1195, 1203, 1208, 1208, 1219, 1223, 1231, 1232, 1235,
- 1237, 1242, 1243, 1252, 1253, 1258, 1263, 1269, 1271, 1273,
- 1280, 1281, 1287, 1288, 1293, 1295, 1300, 1302, 1310, 1315,
- 1324, 1331, 1333, 1335, 1351, 1361, 1368, 1370, 1375, 1377,
- 1379, 1387, 1389, 1394, 1396, 1401, 1403, 1405, 1455, 1457,
- 1459, 1461, 1463, 1465, 1467, 1469, 1483, 1488, 1493, 1518,
- 1524, 1526, 1528, 1530, 1532, 1534, 1539, 1543, 1575, 1577,
- 1583, 1589, 1602, 1603, 1604, 1609, 1614, 1618, 1622, 1637,
- 1650, 1655, 1691, 1709, 1710, 1716, 1717, 1722, 1724, 1731,
- 1748, 1765, 1767, 1774, 1779, 1787, 1797, 1809, 1818, 1822,
- 1826, 1830, 1834, 1838, 1841, 1843, 1847, 1851, 1855
+ 0, 208, 208, 210, 215, 216, 222, 234, 238, 249,
+ 255, 260, 268, 276, 278, 283, 291, 293, 299, 307,
+ 317, 347, 361, 375, 383, 394, 406, 408, 410, 416,
+ 421, 422, 426, 461, 460, 494, 496, 501, 507, 535,
+ 540, 541, 545, 547, 549, 556, 646, 688, 730, 843,
+ 850, 857, 867, 876, 885, 894, 905, 921, 920, 944,
+ 956, 956, 1054, 1054, 1087, 1117, 1123, 1124, 1130, 1131,
+ 1138, 1143, 1155, 1169, 1171, 1179, 1184, 1186, 1194, 1196,
+ 1205, 1206, 1214, 1219, 1219, 1230, 1234, 1242, 1243, 1246,
+ 1248, 1253, 1254, 1263, 1264, 1269, 1274, 1280, 1282, 1284,
+ 1291, 1292, 1298, 1299, 1304, 1306, 1311, 1313, 1321, 1326,
+ 1335, 1342, 1344, 1346, 1362, 1372, 1379, 1381, 1386, 1388,
+ 1390, 1398, 1400, 1405, 1407, 1412, 1414, 1416, 1466, 1468,
+ 1470, 1472, 1474, 1476, 1478, 1480, 1494, 1499, 1504, 1529,
+ 1535, 1537, 1539, 1541, 1543, 1545, 1550, 1554, 1586, 1588,
+ 1594, 1600, 1613, 1614, 1615, 1620, 1625, 1629, 1633, 1648,
+ 1661, 1666, 1702, 1720, 1721, 1727, 1728, 1733, 1735, 1742,
+ 1759, 1776, 1778, 1785, 1790, 1798, 1808, 1820, 1829, 1833,
+ 1837, 1841, 1845, 1849, 1852, 1854, 1858, 1862, 1866
};
#endif
@@ -1849,26 +1852,26 @@ yyreduce:
switch (yyn)
{
case 3:
-#line 208 "awkgram.y" /* yacc.c:1646 */
+#line 211 "awkgram.y" /* yacc.c:1646 */
{
rule = 0;
yyerrok;
}
-#line 1858 "awkgram.c" /* yacc.c:1646 */
+#line 1861 "awkgram.c" /* yacc.c:1646 */
break;
case 5:
-#line 214 "awkgram.y" /* yacc.c:1646 */
+#line 217 "awkgram.y" /* yacc.c:1646 */
{
next_sourcefile();
if (sourcefile == srcfiles)
process_deferred();
}
-#line 1868 "awkgram.c" /* yacc.c:1646 */
+#line 1871 "awkgram.c" /* yacc.c:1646 */
break;
case 6:
-#line 220 "awkgram.y" /* yacc.c:1646 */
+#line 223 "awkgram.y" /* yacc.c:1646 */
{
rule = 0;
/*
@@ -1877,19 +1880,19 @@ yyreduce:
*/
/* yyerrok; */
}
-#line 1881 "awkgram.c" /* yacc.c:1646 */
+#line 1884 "awkgram.c" /* yacc.c:1646 */
break;
case 7:
-#line 232 "awkgram.y" /* yacc.c:1646 */
+#line 235 "awkgram.y" /* yacc.c:1646 */
{
(void) append_rule((yyvsp[-1]), (yyvsp[0]));
}
-#line 1889 "awkgram.c" /* yacc.c:1646 */
+#line 1892 "awkgram.c" /* yacc.c:1646 */
break;
case 8:
-#line 236 "awkgram.y" /* yacc.c:1646 */
+#line 239 "awkgram.y" /* yacc.c:1646 */
{
if (rule != Rule) {
msg(_("%s blocks must have an action part"), ruletab[rule]);
@@ -1900,39 +1903,39 @@ yyreduce:
} else /* pattern rule with non-empty pattern */
(void) append_rule((yyvsp[-1]), NULL);
}
-#line 1904 "awkgram.c" /* yacc.c:1646 */
+#line 1907 "awkgram.c" /* yacc.c:1646 */
break;
case 9:
-#line 247 "awkgram.y" /* yacc.c:1646 */
+#line 250 "awkgram.y" /* yacc.c:1646 */
{
in_function = NULL;
(void) mk_function((yyvsp[-1]), (yyvsp[0]));
yyerrok;
}
-#line 1914 "awkgram.c" /* yacc.c:1646 */
+#line 1917 "awkgram.c" /* yacc.c:1646 */
break;
case 10:
-#line 253 "awkgram.y" /* yacc.c:1646 */
+#line 256 "awkgram.y" /* yacc.c:1646 */
{
want_source = false;
yyerrok;
}
-#line 1923 "awkgram.c" /* yacc.c:1646 */
+#line 1926 "awkgram.c" /* yacc.c:1646 */
break;
case 11:
-#line 258 "awkgram.y" /* yacc.c:1646 */
+#line 261 "awkgram.y" /* yacc.c:1646 */
{
want_source = false;
yyerrok;
}
-#line 1932 "awkgram.c" /* yacc.c:1646 */
+#line 1935 "awkgram.c" /* yacc.c:1646 */
break;
case 12:
-#line 266 "awkgram.y" /* yacc.c:1646 */
+#line 269 "awkgram.y" /* yacc.c:1646 */
{
if (include_source((yyvsp[0])) < 0)
YYABORT;
@@ -1940,23 +1943,23 @@ yyreduce:
bcfree((yyvsp[0]));
(yyval) = NULL;
}
-#line 1944 "awkgram.c" /* yacc.c:1646 */
+#line 1947 "awkgram.c" /* yacc.c:1646 */
break;
case 13:
-#line 274 "awkgram.y" /* yacc.c:1646 */
+#line 277 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 1950 "awkgram.c" /* yacc.c:1646 */
+#line 1953 "awkgram.c" /* yacc.c:1646 */
break;
case 14:
-#line 276 "awkgram.y" /* yacc.c:1646 */
+#line 279 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 1956 "awkgram.c" /* yacc.c:1646 */
+#line 1959 "awkgram.c" /* yacc.c:1646 */
break;
case 15:
-#line 281 "awkgram.y" /* yacc.c:1646 */
+#line 284 "awkgram.y" /* yacc.c:1646 */
{
if (load_library((yyvsp[0])) < 0)
YYABORT;
@@ -1964,23 +1967,23 @@ yyreduce:
bcfree((yyvsp[0]));
(yyval) = NULL;
}
-#line 1968 "awkgram.c" /* yacc.c:1646 */
+#line 1971 "awkgram.c" /* yacc.c:1646 */
break;
case 16:
-#line 289 "awkgram.y" /* yacc.c:1646 */
+#line 292 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 1974 "awkgram.c" /* yacc.c:1646 */
+#line 1977 "awkgram.c" /* yacc.c:1646 */
break;
case 17:
-#line 291 "awkgram.y" /* yacc.c:1646 */
+#line 294 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 1980 "awkgram.c" /* yacc.c:1646 */
+#line 1983 "awkgram.c" /* yacc.c:1646 */
break;
case 18:
-#line 296 "awkgram.y" /* yacc.c:1646 */
+#line 299 "awkgram.y" /* yacc.c:1646 */
{
rule = Rule;
if (comment != NULL) {
@@ -1989,11 +1992,11 @@ yyreduce:
} else
(yyval) = NULL;
}
-#line 1993 "awkgram.c" /* yacc.c:1646 */
+#line 1996 "awkgram.c" /* yacc.c:1646 */
break;
case 19:
-#line 305 "awkgram.y" /* yacc.c:1646 */
+#line 308 "awkgram.y" /* yacc.c:1646 */
{
rule = Rule;
if (comment != NULL) {
@@ -2002,11 +2005,11 @@ yyreduce:
} else
(yyval) = (yyvsp[0]);
}
-#line 2006 "awkgram.c" /* yacc.c:1646 */
+#line 2009 "awkgram.c" /* yacc.c:1646 */
break;
case 20:
-#line 315 "awkgram.y" /* yacc.c:1646 */
+#line 318 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *tp;
@@ -2029,14 +2032,18 @@ yyreduce:
((yyvsp[-3])->nexti + 1)->condpair_left = (yyvsp[-3])->lasti;
((yyvsp[-3])->nexti + 1)->condpair_right = (yyvsp[0])->lasti;
}
- (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp);
+ if (comment != NULL) {
+ (yyval) = list_append(list_merge(list_prepend((yyvsp[-3]), comment), (yyvsp[0])), tp);
+ comment = NULL;
+ } else
+ (yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp);
rule = Rule;
}
-#line 2036 "awkgram.c" /* yacc.c:1646 */
+#line 2043 "awkgram.c" /* yacc.c:1646 */
break;
case 21:
-#line 341 "awkgram.y" /* yacc.c:1646 */
+#line 348 "awkgram.y" /* yacc.c:1646 */
{
static int begin_seen = 0;
@@ -2047,13 +2054,14 @@ yyreduce:
(yyvsp[0])->in_rule = rule = BEGIN;
(yyvsp[0])->source_file = source;
+ check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2053 "awkgram.c" /* yacc.c:1646 */
+#line 2061 "awkgram.c" /* yacc.c:1646 */
break;
case 22:
-#line 354 "awkgram.y" /* yacc.c:1646 */
+#line 362 "awkgram.y" /* yacc.c:1646 */
{
static int end_seen = 0;
@@ -2064,35 +2072,38 @@ yyreduce:
(yyvsp[0])->in_rule = rule = END;
(yyvsp[0])->source_file = source;
+ check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2070 "awkgram.c" /* yacc.c:1646 */
+#line 2079 "awkgram.c" /* yacc.c:1646 */
break;
case 23:
-#line 367 "awkgram.y" /* yacc.c:1646 */
+#line 376 "awkgram.y" /* yacc.c:1646 */
{
func_first = false;
(yyvsp[0])->in_rule = rule = BEGINFILE;
(yyvsp[0])->source_file = source;
+ check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2081 "awkgram.c" /* yacc.c:1646 */
+#line 2091 "awkgram.c" /* yacc.c:1646 */
break;
case 24:
-#line 374 "awkgram.y" /* yacc.c:1646 */
+#line 384 "awkgram.y" /* yacc.c:1646 */
{
func_first = false;
(yyvsp[0])->in_rule = rule = ENDFILE;
(yyvsp[0])->source_file = source;
+ check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2092 "awkgram.c" /* yacc.c:1646 */
+#line 2103 "awkgram.c" /* yacc.c:1646 */
break;
case 25:
-#line 384 "awkgram.y" /* yacc.c:1646 */
+#line 395 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip;
if ((yyvsp[-3]) == NULL)
@@ -2101,39 +2112,39 @@ yyreduce:
ip = (yyvsp[-3]);
(yyval) = ip;
}
-#line 2105 "awkgram.c" /* yacc.c:1646 */
+#line 2116 "awkgram.c" /* yacc.c:1646 */
break;
case 26:
-#line 396 "awkgram.y" /* yacc.c:1646 */
+#line 407 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2111 "awkgram.c" /* yacc.c:1646 */
+#line 2122 "awkgram.c" /* yacc.c:1646 */
break;
case 27:
-#line 398 "awkgram.y" /* yacc.c:1646 */
+#line 409 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2117 "awkgram.c" /* yacc.c:1646 */
+#line 2128 "awkgram.c" /* yacc.c:1646 */
break;
case 28:
-#line 400 "awkgram.y" /* yacc.c:1646 */
+#line 411 "awkgram.y" /* yacc.c:1646 */
{
yyerror(_("`%s' is a built-in function, it cannot be redefined"),
tokstart);
YYABORT;
}
-#line 2127 "awkgram.c" /* yacc.c:1646 */
+#line 2138 "awkgram.c" /* yacc.c:1646 */
break;
case 29:
-#line 406 "awkgram.y" /* yacc.c:1646 */
+#line 417 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2133 "awkgram.c" /* yacc.c:1646 */
+#line 2144 "awkgram.c" /* yacc.c:1646 */
break;
case 32:
-#line 416 "awkgram.y" /* yacc.c:1646 */
+#line 427 "awkgram.y" /* yacc.c:1646 */
{
/*
* treat any comments between BOF and the first function
@@ -2160,17 +2171,17 @@ yyreduce:
/* $4 already free'd in install_function */
(yyval) = (yyvsp[-5]);
}
-#line 2164 "awkgram.c" /* yacc.c:1646 */
+#line 2175 "awkgram.c" /* yacc.c:1646 */
break;
case 33:
-#line 450 "awkgram.y" /* yacc.c:1646 */
+#line 461 "awkgram.y" /* yacc.c:1646 */
{ want_regexp = true; }
-#line 2170 "awkgram.c" /* yacc.c:1646 */
+#line 2181 "awkgram.c" /* yacc.c:1646 */
break;
case 34:
-#line 452 "awkgram.y" /* yacc.c:1646 */
+#line 463 "awkgram.y" /* yacc.c:1646 */
{
NODE *n, *exp;
char *re;
@@ -2199,28 +2210,28 @@ yyreduce:
(yyval)->opcode = Op_match_rec;
(yyval)->memory = n;
}
-#line 2203 "awkgram.c" /* yacc.c:1646 */
+#line 2214 "awkgram.c" /* yacc.c:1646 */
break;
case 35:
-#line 484 "awkgram.y" /* yacc.c:1646 */
+#line 495 "awkgram.y" /* yacc.c:1646 */
{ bcfree((yyvsp[0])); }
-#line 2209 "awkgram.c" /* yacc.c:1646 */
+#line 2220 "awkgram.c" /* yacc.c:1646 */
break;
case 37:
-#line 490 "awkgram.y" /* yacc.c:1646 */
+#line 501 "awkgram.y" /* yacc.c:1646 */
{
if (comment != NULL) {
(yyval) = list_create(comment);
comment = NULL;
} else (yyval) = NULL;
}
-#line 2220 "awkgram.c" /* yacc.c:1646 */
+#line 2231 "awkgram.c" /* yacc.c:1646 */
break;
case 38:
-#line 497 "awkgram.y" /* yacc.c:1646 */
+#line 508 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0]) == NULL) {
if (comment == NULL)
@@ -2248,40 +2259,40 @@ yyreduce:
}
yyerrok;
}
-#line 2252 "awkgram.c" /* yacc.c:1646 */
+#line 2263 "awkgram.c" /* yacc.c:1646 */
break;
case 39:
-#line 525 "awkgram.y" /* yacc.c:1646 */
+#line 536 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2258 "awkgram.c" /* yacc.c:1646 */
+#line 2269 "awkgram.c" /* yacc.c:1646 */
break;
case 42:
-#line 535 "awkgram.y" /* yacc.c:1646 */
+#line 546 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2264 "awkgram.c" /* yacc.c:1646 */
+#line 2275 "awkgram.c" /* yacc.c:1646 */
break;
case 43:
-#line 537 "awkgram.y" /* yacc.c:1646 */
+#line 548 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 2270 "awkgram.c" /* yacc.c:1646 */
+#line 2281 "awkgram.c" /* yacc.c:1646 */
break;
case 44:
-#line 539 "awkgram.y" /* yacc.c:1646 */
+#line 550 "awkgram.y" /* yacc.c:1646 */
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count));
else
(yyval) = (yyvsp[0]);
}
-#line 2281 "awkgram.c" /* yacc.c:1646 */
+#line 2292 "awkgram.c" /* yacc.c:1646 */
break;
case 45:
-#line 546 "awkgram.y" /* yacc.c:1646 */
+#line 557 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
INSTRUCTION *ip, *nextc, *tbreak;
@@ -2371,11 +2382,11 @@ yyreduce:
break_allowed--;
fix_break_continue(ip, tbreak, NULL);
}
-#line 2375 "awkgram.c" /* yacc.c:1646 */
+#line 2386 "awkgram.c" /* yacc.c:1646 */
break;
case 46:
-#line 636 "awkgram.y" /* yacc.c:1646 */
+#line 647 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@ -2417,11 +2428,11 @@ yyreduce:
continue_allowed--;
fix_break_continue(ip, tbreak, tcont);
}
-#line 2421 "awkgram.c" /* yacc.c:1646 */
+#line 2432 "awkgram.c" /* yacc.c:1646 */
break;
case 47:
-#line 678 "awkgram.y" /* yacc.c:1646 */
+#line 689 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@ -2463,11 +2474,11 @@ yyreduce:
} /* else
$1 and $4 are NULLs */
}
-#line 2467 "awkgram.c" /* yacc.c:1646 */
+#line 2478 "awkgram.c" /* yacc.c:1646 */
break;
case 48:
-#line 720 "awkgram.y" /* yacc.c:1646 */
+#line 731 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip;
char *var_name = (yyvsp[-5])->lextok;
@@ -2580,44 +2591,44 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
-#line 2584 "awkgram.c" /* yacc.c:1646 */
+#line 2595 "awkgram.c" /* yacc.c:1646 */
break;
case 49:
-#line 833 "awkgram.y" /* yacc.c:1646 */
+#line 844 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0]));
break_allowed--;
continue_allowed--;
}
-#line 2595 "awkgram.c" /* yacc.c:1646 */
+#line 2606 "awkgram.c" /* yacc.c:1646 */
break;
case 50:
-#line 840 "awkgram.y" /* yacc.c:1646 */
+#line 851 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0]));
break_allowed--;
continue_allowed--;
}
-#line 2606 "awkgram.c" /* yacc.c:1646 */
+#line 2617 "awkgram.c" /* yacc.c:1646 */
break;
case 51:
-#line 847 "awkgram.y" /* yacc.c:1646 */
+#line 858 "awkgram.y" /* yacc.c:1646 */
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count));
else
(yyval) = (yyvsp[0]);
}
-#line 2617 "awkgram.c" /* yacc.c:1646 */
+#line 2628 "awkgram.c" /* yacc.c:1646 */
break;
case 52:
-#line 857 "awkgram.y" /* yacc.c:1646 */
+#line 868 "awkgram.y" /* yacc.c:1646 */
{
if (! break_allowed)
error_ln((yyvsp[-1])->source_line,
@@ -2626,11 +2637,11 @@ regular_loop:
(yyval) = list_create((yyvsp[-1]));
}
-#line 2630 "awkgram.c" /* yacc.c:1646 */
+#line 2641 "awkgram.c" /* yacc.c:1646 */
break;
case 53:
-#line 866 "awkgram.y" /* yacc.c:1646 */
+#line 877 "awkgram.y" /* yacc.c:1646 */
{
if (! continue_allowed)
error_ln((yyvsp[-1])->source_line,
@@ -2639,11 +2650,11 @@ regular_loop:
(yyval) = list_create((yyvsp[-1]));
}
-#line 2643 "awkgram.c" /* yacc.c:1646 */
+#line 2654 "awkgram.c" /* yacc.c:1646 */
break;
case 54:
-#line 875 "awkgram.y" /* yacc.c:1646 */
+#line 886 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule && rule != Rule)
@@ -2652,11 +2663,11 @@ regular_loop:
(yyvsp[-1])->target_jmp = ip_rec;
(yyval) = list_create((yyvsp[-1]));
}
-#line 2656 "awkgram.c" /* yacc.c:1646 */
+#line 2667 "awkgram.c" /* yacc.c:1646 */
break;
case 55:
-#line 884 "awkgram.y" /* yacc.c:1646 */
+#line 895 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule == BEGIN || rule == END || rule == ENDFILE)
@@ -2667,11 +2678,11 @@ regular_loop:
(yyvsp[-1])->target_endfile = ip_endfile;
(yyval) = list_create((yyvsp[-1]));
}
-#line 2671 "awkgram.c" /* yacc.c:1646 */
+#line 2682 "awkgram.c" /* yacc.c:1646 */
break;
case 56:
-#line 895 "awkgram.y" /* yacc.c:1646 */
+#line 906 "awkgram.y" /* yacc.c:1646 */
{
/* Initialize the two possible jump targets, the actual target
* is resolved at run-time.
@@ -2686,20 +2697,20 @@ regular_loop:
} else
(yyval) = list_append((yyvsp[-1]), (yyvsp[-2]));
}
-#line 2690 "awkgram.c" /* yacc.c:1646 */
+#line 2701 "awkgram.c" /* yacc.c:1646 */
break;
case 57:
-#line 910 "awkgram.y" /* yacc.c:1646 */
+#line 921 "awkgram.y" /* yacc.c:1646 */
{
if (! in_function)
yyerror(_("`return' used outside function context"));
}
-#line 2699 "awkgram.c" /* yacc.c:1646 */
+#line 2710 "awkgram.c" /* yacc.c:1646 */
break;
case 58:
-#line 913 "awkgram.y" /* yacc.c:1646 */
+#line 924 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) == NULL) {
(yyval) = list_create((yyvsp[-3]));
@@ -2720,17 +2731,17 @@ regular_loop:
(yyval) = list_append((yyvsp[-1]), (yyvsp[-3]));
}
}
-#line 2724 "awkgram.c" /* yacc.c:1646 */
+#line 2735 "awkgram.c" /* yacc.c:1646 */
break;
case 60:
-#line 945 "awkgram.y" /* yacc.c:1646 */
+#line 956 "awkgram.y" /* yacc.c:1646 */
{ in_print = true; in_parens = 0; }
-#line 2730 "awkgram.c" /* yacc.c:1646 */
+#line 2741 "awkgram.c" /* yacc.c:1646 */
break;
case 61:
-#line 946 "awkgram.y" /* yacc.c:1646 */
+#line 957 "awkgram.y" /* yacc.c:1646 */
{
/*
* Optimization: plain `print' has no expression list, so $3 is null.
@@ -2827,17 +2838,17 @@ regular_print:
}
}
}
-#line 2831 "awkgram.c" /* yacc.c:1646 */
+#line 2842 "awkgram.c" /* yacc.c:1646 */
break;
case 62:
-#line 1043 "awkgram.y" /* yacc.c:1646 */
+#line 1054 "awkgram.y" /* yacc.c:1646 */
{ sub_counter = 0; }
-#line 2837 "awkgram.c" /* yacc.c:1646 */
+#line 2848 "awkgram.c" /* yacc.c:1646 */
break;
case 63:
-#line 1044 "awkgram.y" /* yacc.c:1646 */
+#line 1055 "awkgram.y" /* yacc.c:1646 */
{
char *arr = (yyvsp[-2])->lextok;
@@ -2870,11 +2881,11 @@ regular_print:
(yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3]));
}
}
-#line 2874 "awkgram.c" /* yacc.c:1646 */
+#line 2885 "awkgram.c" /* yacc.c:1646 */
break;
case 64:
-#line 1081 "awkgram.y" /* yacc.c:1646 */
+#line 1092 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
char *arr = (yyvsp[-1])->lextok;
@@ -2900,52 +2911,52 @@ regular_print:
fatal(_("`delete' is not allowed with FUNCTAB"));
}
}
-#line 2904 "awkgram.c" /* yacc.c:1646 */
+#line 2915 "awkgram.c" /* yacc.c:1646 */
break;
case 65:
-#line 1107 "awkgram.y" /* yacc.c:1646 */
+#line 1118 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = optimize_assignment((yyvsp[0])); }
-#line 2910 "awkgram.c" /* yacc.c:1646 */
+#line 2921 "awkgram.c" /* yacc.c:1646 */
break;
case 66:
-#line 1112 "awkgram.y" /* yacc.c:1646 */
+#line 1123 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2916 "awkgram.c" /* yacc.c:1646 */
+#line 2927 "awkgram.c" /* yacc.c:1646 */
break;
case 67:
-#line 1114 "awkgram.y" /* yacc.c:1646 */
+#line 1125 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2922 "awkgram.c" /* yacc.c:1646 */
+#line 2933 "awkgram.c" /* yacc.c:1646 */
break;
case 68:
-#line 1119 "awkgram.y" /* yacc.c:1646 */
+#line 1130 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2928 "awkgram.c" /* yacc.c:1646 */
+#line 2939 "awkgram.c" /* yacc.c:1646 */
break;
case 69:
-#line 1121 "awkgram.y" /* yacc.c:1646 */
+#line 1132 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) == NULL)
(yyval) = list_create((yyvsp[0]));
else
(yyval) = list_prepend((yyvsp[-1]), (yyvsp[0]));
}
-#line 2939 "awkgram.c" /* yacc.c:1646 */
+#line 2950 "awkgram.c" /* yacc.c:1646 */
break;
case 70:
-#line 1128 "awkgram.y" /* yacc.c:1646 */
+#line 1139 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2945 "awkgram.c" /* yacc.c:1646 */
+#line 2956 "awkgram.c" /* yacc.c:1646 */
break;
case 71:
-#line 1133 "awkgram.y" /* yacc.c:1646 */
+#line 1144 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -2957,11 +2968,11 @@ regular_print:
bcfree((yyvsp[-2]));
(yyval) = (yyvsp[-4]);
}
-#line 2961 "awkgram.c" /* yacc.c:1646 */
+#line 2972 "awkgram.c" /* yacc.c:1646 */
break;
case 72:
-#line 1145 "awkgram.y" /* yacc.c:1646 */
+#line 1156 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -2972,17 +2983,17 @@ regular_print:
(yyvsp[-3])->case_stmt = casestmt;
(yyval) = (yyvsp[-3]);
}
-#line 2976 "awkgram.c" /* yacc.c:1646 */
+#line 2987 "awkgram.c" /* yacc.c:1646 */
break;
case 73:
-#line 1159 "awkgram.y" /* yacc.c:1646 */
+#line 1170 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2982 "awkgram.c" /* yacc.c:1646 */
+#line 2993 "awkgram.c" /* yacc.c:1646 */
break;
case 74:
-#line 1161 "awkgram.y" /* yacc.c:1646 */
+#line 1172 "awkgram.y" /* yacc.c:1646 */
{
NODE *n = (yyvsp[0])->memory;
(void) force_number(n);
@@ -2990,71 +3001,71 @@ regular_print:
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 2994 "awkgram.c" /* yacc.c:1646 */
+#line 3005 "awkgram.c" /* yacc.c:1646 */
break;
case 75:
-#line 1169 "awkgram.y" /* yacc.c:1646 */
+#line 1180 "awkgram.y" /* yacc.c:1646 */
{
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3003 "awkgram.c" /* yacc.c:1646 */
+#line 3014 "awkgram.c" /* yacc.c:1646 */
break;
case 76:
-#line 1174 "awkgram.y" /* yacc.c:1646 */
+#line 1185 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3009 "awkgram.c" /* yacc.c:1646 */
+#line 3020 "awkgram.c" /* yacc.c:1646 */
break;
case 77:
-#line 1176 "awkgram.y" /* yacc.c:1646 */
+#line 1187 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_push_re;
(yyval) = (yyvsp[0]);
}
-#line 3018 "awkgram.c" /* yacc.c:1646 */
+#line 3029 "awkgram.c" /* yacc.c:1646 */
break;
case 78:
-#line 1184 "awkgram.y" /* yacc.c:1646 */
+#line 1195 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3024 "awkgram.c" /* yacc.c:1646 */
+#line 3035 "awkgram.c" /* yacc.c:1646 */
break;
case 79:
-#line 1186 "awkgram.y" /* yacc.c:1646 */
+#line 1197 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3030 "awkgram.c" /* yacc.c:1646 */
+#line 3041 "awkgram.c" /* yacc.c:1646 */
break;
case 81:
-#line 1196 "awkgram.y" /* yacc.c:1646 */
+#line 1207 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = (yyvsp[-1]);
}
-#line 3038 "awkgram.c" /* yacc.c:1646 */
+#line 3049 "awkgram.c" /* yacc.c:1646 */
break;
case 82:
-#line 1203 "awkgram.y" /* yacc.c:1646 */
+#line 1214 "awkgram.y" /* yacc.c:1646 */
{
in_print = false;
in_parens = 0;
(yyval) = NULL;
}
-#line 3048 "awkgram.c" /* yacc.c:1646 */
+#line 3059 "awkgram.c" /* yacc.c:1646 */
break;
case 83:
-#line 1208 "awkgram.y" /* yacc.c:1646 */
+#line 1219 "awkgram.y" /* yacc.c:1646 */
{ in_print = false; in_parens = 0; }
-#line 3054 "awkgram.c" /* yacc.c:1646 */
+#line 3065 "awkgram.c" /* yacc.c:1646 */
break;
case 84:
-#line 1209 "awkgram.y" /* yacc.c:1646 */
+#line 1220 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->redir_type == redirect_twoway
&& (yyvsp[0])->lasti->opcode == Op_K_getline_redir
@@ -3062,136 +3073,136 @@ regular_print:
yyerror(_("multistage two-way pipelines don't work"));
(yyval) = list_prepend((yyvsp[0]), (yyvsp[-2]));
}
-#line 3066 "awkgram.c" /* yacc.c:1646 */
+#line 3077 "awkgram.c" /* yacc.c:1646 */
break;
case 85:
-#line 1220 "awkgram.y" /* yacc.c:1646 */
+#line 1231 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL);
}
-#line 3074 "awkgram.c" /* yacc.c:1646 */
+#line 3085 "awkgram.c" /* yacc.c:1646 */
break;
case 86:
-#line 1225 "awkgram.y" /* yacc.c:1646 */
+#line 1236 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0]));
}
-#line 3082 "awkgram.c" /* yacc.c:1646 */
+#line 3093 "awkgram.c" /* yacc.c:1646 */
break;
case 91:
-#line 1242 "awkgram.y" /* yacc.c:1646 */
+#line 1253 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3088 "awkgram.c" /* yacc.c:1646 */
+#line 3099 "awkgram.c" /* yacc.c:1646 */
break;
case 92:
-#line 1244 "awkgram.y" /* yacc.c:1646 */
+#line 1255 "awkgram.y" /* yacc.c:1646 */
{
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3097 "awkgram.c" /* yacc.c:1646 */
+#line 3108 "awkgram.c" /* yacc.c:1646 */
break;
case 93:
-#line 1252 "awkgram.y" /* yacc.c:1646 */
+#line 1263 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3103 "awkgram.c" /* yacc.c:1646 */
+#line 3114 "awkgram.c" /* yacc.c:1646 */
break;
case 94:
-#line 1254 "awkgram.y" /* yacc.c:1646 */
+#line 1265 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3109 "awkgram.c" /* yacc.c:1646 */
+#line 3120 "awkgram.c" /* yacc.c:1646 */
break;
case 95:
-#line 1259 "awkgram.y" /* yacc.c:1646 */
+#line 1270 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->param_count = 0;
(yyval) = list_create((yyvsp[0]));
}
-#line 3118 "awkgram.c" /* yacc.c:1646 */
+#line 3129 "awkgram.c" /* yacc.c:1646 */
break;
case 96:
-#line 1264 "awkgram.y" /* yacc.c:1646 */
+#line 1275 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1;
(yyval) = list_append((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3128 "awkgram.c" /* yacc.c:1646 */
+#line 3139 "awkgram.c" /* yacc.c:1646 */
break;
case 97:
-#line 1270 "awkgram.y" /* yacc.c:1646 */
+#line 1281 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3134 "awkgram.c" /* yacc.c:1646 */
+#line 3145 "awkgram.c" /* yacc.c:1646 */
break;
case 98:
-#line 1272 "awkgram.y" /* yacc.c:1646 */
+#line 1283 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3140 "awkgram.c" /* yacc.c:1646 */
+#line 3151 "awkgram.c" /* yacc.c:1646 */
break;
case 99:
-#line 1274 "awkgram.y" /* yacc.c:1646 */
+#line 1285 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-2]); }
-#line 3146 "awkgram.c" /* yacc.c:1646 */
+#line 3157 "awkgram.c" /* yacc.c:1646 */
break;
case 100:
-#line 1280 "awkgram.y" /* yacc.c:1646 */
+#line 1291 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3152 "awkgram.c" /* yacc.c:1646 */
+#line 3163 "awkgram.c" /* yacc.c:1646 */
break;
case 101:
-#line 1282 "awkgram.y" /* yacc.c:1646 */
+#line 1293 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3158 "awkgram.c" /* yacc.c:1646 */
+#line 3169 "awkgram.c" /* yacc.c:1646 */
break;
case 102:
-#line 1287 "awkgram.y" /* yacc.c:1646 */
+#line 1298 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3164 "awkgram.c" /* yacc.c:1646 */
+#line 3175 "awkgram.c" /* yacc.c:1646 */
break;
case 103:
-#line 1289 "awkgram.y" /* yacc.c:1646 */
+#line 1300 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3170 "awkgram.c" /* yacc.c:1646 */
+#line 3181 "awkgram.c" /* yacc.c:1646 */
break;
case 104:
-#line 1294 "awkgram.y" /* yacc.c:1646 */
+#line 1305 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3176 "awkgram.c" /* yacc.c:1646 */
+#line 3187 "awkgram.c" /* yacc.c:1646 */
break;
case 105:
-#line 1296 "awkgram.y" /* yacc.c:1646 */
+#line 1307 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3185 "awkgram.c" /* yacc.c:1646 */
+#line 3196 "awkgram.c" /* yacc.c:1646 */
break;
case 106:
-#line 1301 "awkgram.y" /* yacc.c:1646 */
+#line 1312 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3191 "awkgram.c" /* yacc.c:1646 */
+#line 3202 "awkgram.c" /* yacc.c:1646 */
break;
case 107:
-#line 1303 "awkgram.y" /* yacc.c:1646 */
+#line 1314 "awkgram.y" /* yacc.c:1646 */
{
/*
* Returning the expression list instead of NULL lets
@@ -3199,52 +3210,52 @@ regular_print:
*/
(yyval) = (yyvsp[-1]);
}
-#line 3203 "awkgram.c" /* yacc.c:1646 */
+#line 3214 "awkgram.c" /* yacc.c:1646 */
break;
case 108:
-#line 1311 "awkgram.y" /* yacc.c:1646 */
+#line 1322 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3212 "awkgram.c" /* yacc.c:1646 */
+#line 3223 "awkgram.c" /* yacc.c:1646 */
break;
case 109:
-#line 1316 "awkgram.y" /* yacc.c:1646 */
+#line 1327 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = (yyvsp[-2]);
}
-#line 3221 "awkgram.c" /* yacc.c:1646 */
+#line 3232 "awkgram.c" /* yacc.c:1646 */
break;
case 110:
-#line 1325 "awkgram.y" /* yacc.c:1646 */
+#line 1336 "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 3232 "awkgram.c" /* yacc.c:1646 */
+#line 3243 "awkgram.c" /* yacc.c:1646 */
break;
case 111:
-#line 1332 "awkgram.y" /* yacc.c:1646 */
+#line 1343 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3238 "awkgram.c" /* yacc.c:1646 */
+#line 3249 "awkgram.c" /* yacc.c:1646 */
break;
case 112:
-#line 1334 "awkgram.y" /* yacc.c:1646 */
+#line 1345 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3244 "awkgram.c" /* yacc.c:1646 */
+#line 3255 "awkgram.c" /* yacc.c:1646 */
break;
case 113:
-#line 1336 "awkgram.y" /* yacc.c:1646 */
+#line 1347 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[-1])->source_line,
@@ -3260,11 +3271,11 @@ regular_print:
(yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1]));
}
}
-#line 3264 "awkgram.c" /* yacc.c:1646 */
+#line 3275 "awkgram.c" /* yacc.c:1646 */
break;
case 114:
-#line 1352 "awkgram.y" /* yacc.c:1646 */
+#line 1363 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old)
warning_ln((yyvsp[-1])->source_line,
@@ -3274,91 +3285,91 @@ regular_print:
(yyvsp[-1])->expr_count = 1;
(yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1]));
}
-#line 3278 "awkgram.c" /* yacc.c:1646 */
+#line 3289 "awkgram.c" /* yacc.c:1646 */
break;
case 115:
-#line 1362 "awkgram.y" /* yacc.c:1646 */
+#line 1373 "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 3289 "awkgram.c" /* yacc.c:1646 */
+#line 3300 "awkgram.c" /* yacc.c:1646 */
break;
case 116:
-#line 1369 "awkgram.y" /* yacc.c:1646 */
+#line 1380 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); }
-#line 3295 "awkgram.c" /* yacc.c:1646 */
+#line 3306 "awkgram.c" /* yacc.c:1646 */
break;
case 117:
-#line 1371 "awkgram.y" /* yacc.c:1646 */
+#line 1382 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3301 "awkgram.c" /* yacc.c:1646 */
+#line 3312 "awkgram.c" /* yacc.c:1646 */
break;
case 118:
-#line 1376 "awkgram.y" /* yacc.c:1646 */
+#line 1387 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3307 "awkgram.c" /* yacc.c:1646 */
+#line 3318 "awkgram.c" /* yacc.c:1646 */
break;
case 119:
-#line 1378 "awkgram.y" /* yacc.c:1646 */
+#line 1389 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3313 "awkgram.c" /* yacc.c:1646 */
+#line 3324 "awkgram.c" /* yacc.c:1646 */
break;
case 120:
-#line 1380 "awkgram.y" /* yacc.c:1646 */
+#line 1391 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_assign_quotient;
(yyval) = (yyvsp[0]);
}
-#line 3322 "awkgram.c" /* yacc.c:1646 */
+#line 3333 "awkgram.c" /* yacc.c:1646 */
break;
case 121:
-#line 1388 "awkgram.y" /* yacc.c:1646 */
+#line 1399 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3328 "awkgram.c" /* yacc.c:1646 */
+#line 3339 "awkgram.c" /* yacc.c:1646 */
break;
case 122:
-#line 1390 "awkgram.y" /* yacc.c:1646 */
+#line 1401 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3334 "awkgram.c" /* yacc.c:1646 */
+#line 3345 "awkgram.c" /* yacc.c:1646 */
break;
case 123:
-#line 1395 "awkgram.y" /* yacc.c:1646 */
+#line 1406 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3340 "awkgram.c" /* yacc.c:1646 */
+#line 3351 "awkgram.c" /* yacc.c:1646 */
break;
case 124:
-#line 1397 "awkgram.y" /* yacc.c:1646 */
+#line 1408 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3346 "awkgram.c" /* yacc.c:1646 */
+#line 3357 "awkgram.c" /* yacc.c:1646 */
break;
case 125:
-#line 1402 "awkgram.y" /* yacc.c:1646 */
+#line 1413 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3352 "awkgram.c" /* yacc.c:1646 */
+#line 3363 "awkgram.c" /* yacc.c:1646 */
break;
case 126:
-#line 1404 "awkgram.y" /* yacc.c:1646 */
+#line 1415 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3358 "awkgram.c" /* yacc.c:1646 */
+#line 3369 "awkgram.c" /* yacc.c:1646 */
break;
case 127:
-#line 1406 "awkgram.y" /* yacc.c:1646 */
+#line 1417 "awkgram.y" /* yacc.c:1646 */
{
int count = 2;
bool is_simple_var = false;
@@ -3405,47 +3416,47 @@ regular_print:
max_args = count;
}
}
-#line 3409 "awkgram.c" /* yacc.c:1646 */
+#line 3420 "awkgram.c" /* yacc.c:1646 */
break;
case 129:
-#line 1458 "awkgram.y" /* yacc.c:1646 */
+#line 1469 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3415 "awkgram.c" /* yacc.c:1646 */
+#line 3426 "awkgram.c" /* yacc.c:1646 */
break;
case 130:
-#line 1460 "awkgram.y" /* yacc.c:1646 */
+#line 1471 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3421 "awkgram.c" /* yacc.c:1646 */
+#line 3432 "awkgram.c" /* yacc.c:1646 */
break;
case 131:
-#line 1462 "awkgram.y" /* yacc.c:1646 */
+#line 1473 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3427 "awkgram.c" /* yacc.c:1646 */
+#line 3438 "awkgram.c" /* yacc.c:1646 */
break;
case 132:
-#line 1464 "awkgram.y" /* yacc.c:1646 */
+#line 1475 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3433 "awkgram.c" /* yacc.c:1646 */
+#line 3444 "awkgram.c" /* yacc.c:1646 */
break;
case 133:
-#line 1466 "awkgram.y" /* yacc.c:1646 */
+#line 1477 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3439 "awkgram.c" /* yacc.c:1646 */
+#line 3450 "awkgram.c" /* yacc.c:1646 */
break;
case 134:
-#line 1468 "awkgram.y" /* yacc.c:1646 */
+#line 1479 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3445 "awkgram.c" /* yacc.c:1646 */
+#line 3456 "awkgram.c" /* yacc.c:1646 */
break;
case 135:
-#line 1470 "awkgram.y" /* yacc.c:1646 */
+#line 1481 "awkgram.y" /* yacc.c:1646 */
{
/*
* In BEGINFILE/ENDFILE, allow `getline [var] < file'
@@ -3459,29 +3470,29 @@ regular_print:
_("non-redirected `getline' undefined inside END action"));
(yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input);
}
-#line 3463 "awkgram.c" /* yacc.c:1646 */
+#line 3474 "awkgram.c" /* yacc.c:1646 */
break;
case 136:
-#line 1484 "awkgram.y" /* yacc.c:1646 */
+#line 1495 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postincrement;
(yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3472 "awkgram.c" /* yacc.c:1646 */
+#line 3483 "awkgram.c" /* yacc.c:1646 */
break;
case 137:
-#line 1489 "awkgram.y" /* yacc.c:1646 */
+#line 1500 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postdecrement;
(yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3481 "awkgram.c" /* yacc.c:1646 */
+#line 3492 "awkgram.c" /* yacc.c:1646 */
break;
case 138:
-#line 1494 "awkgram.y" /* yacc.c:1646 */
+#line 1505 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old) {
warning_ln((yyvsp[-1])->source_line,
@@ -3501,64 +3512,64 @@ regular_print:
(yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1]));
}
}
-#line 3505 "awkgram.c" /* yacc.c:1646 */
+#line 3516 "awkgram.c" /* yacc.c:1646 */
break;
case 139:
-#line 1519 "awkgram.y" /* yacc.c:1646 */
+#line 1530 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type);
bcfree((yyvsp[-2]));
}
-#line 3514 "awkgram.c" /* yacc.c:1646 */
+#line 3525 "awkgram.c" /* yacc.c:1646 */
break;
case 140:
-#line 1525 "awkgram.y" /* yacc.c:1646 */
+#line 1536 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3520 "awkgram.c" /* yacc.c:1646 */
+#line 3531 "awkgram.c" /* yacc.c:1646 */
break;
case 141:
-#line 1527 "awkgram.y" /* yacc.c:1646 */
+#line 1538 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3526 "awkgram.c" /* yacc.c:1646 */
+#line 3537 "awkgram.c" /* yacc.c:1646 */
break;
case 142:
-#line 1529 "awkgram.y" /* yacc.c:1646 */
+#line 1540 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3532 "awkgram.c" /* yacc.c:1646 */
+#line 3543 "awkgram.c" /* yacc.c:1646 */
break;
case 143:
-#line 1531 "awkgram.y" /* yacc.c:1646 */
+#line 1542 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3538 "awkgram.c" /* yacc.c:1646 */
+#line 3549 "awkgram.c" /* yacc.c:1646 */
break;
case 144:
-#line 1533 "awkgram.y" /* yacc.c:1646 */
+#line 1544 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3544 "awkgram.c" /* yacc.c:1646 */
+#line 3555 "awkgram.c" /* yacc.c:1646 */
break;
case 145:
-#line 1535 "awkgram.y" /* yacc.c:1646 */
+#line 1546 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3550 "awkgram.c" /* yacc.c:1646 */
+#line 3561 "awkgram.c" /* yacc.c:1646 */
break;
case 146:
-#line 1540 "awkgram.y" /* yacc.c:1646 */
+#line 1551 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3558 "awkgram.c" /* yacc.c:1646 */
+#line 3569 "awkgram.c" /* yacc.c:1646 */
break;
case 147:
-#line 1544 "awkgram.y" /* yacc.c:1646 */
+#line 1555 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->opcode == Op_match_rec) {
(yyvsp[0])->opcode = Op_nomatch;
@@ -3590,37 +3601,37 @@ regular_print:
}
}
}
-#line 3594 "awkgram.c" /* yacc.c:1646 */
+#line 3605 "awkgram.c" /* yacc.c:1646 */
break;
case 148:
-#line 1576 "awkgram.y" /* yacc.c:1646 */
+#line 1587 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3600 "awkgram.c" /* yacc.c:1646 */
+#line 3611 "awkgram.c" /* yacc.c:1646 */
break;
case 149:
-#line 1578 "awkgram.y" /* yacc.c:1646 */
+#line 1589 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3610 "awkgram.c" /* yacc.c:1646 */
+#line 3621 "awkgram.c" /* yacc.c:1646 */
break;
case 150:
-#line 1584 "awkgram.y" /* yacc.c:1646 */
+#line 1595 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3620 "awkgram.c" /* yacc.c:1646 */
+#line 3631 "awkgram.c" /* yacc.c:1646 */
break;
case 151:
-#line 1590 "awkgram.y" /* yacc.c:1646 */
+#line 1601 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
@@ -3633,45 +3644,45 @@ regular_print:
if ((yyval) == NULL)
YYABORT;
}
-#line 3637 "awkgram.c" /* yacc.c:1646 */
+#line 3648 "awkgram.c" /* yacc.c:1646 */
break;
case 154:
-#line 1605 "awkgram.y" /* yacc.c:1646 */
+#line 1616 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[-1])->opcode = Op_preincrement;
(yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1]));
}
-#line 3646 "awkgram.c" /* yacc.c:1646 */
+#line 3657 "awkgram.c" /* yacc.c:1646 */
break;
case 155:
-#line 1610 "awkgram.y" /* yacc.c:1646 */
+#line 1621 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[-1])->opcode = Op_predecrement;
(yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1]));
}
-#line 3655 "awkgram.c" /* yacc.c:1646 */
+#line 3666 "awkgram.c" /* yacc.c:1646 */
break;
case 156:
-#line 1615 "awkgram.y" /* yacc.c:1646 */
+#line 1626 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3663 "awkgram.c" /* yacc.c:1646 */
+#line 3674 "awkgram.c" /* yacc.c:1646 */
break;
case 157:
-#line 1619 "awkgram.y" /* yacc.c:1646 */
+#line 1630 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3671 "awkgram.c" /* yacc.c:1646 */
+#line 3682 "awkgram.c" /* yacc.c:1646 */
break;
case 158:
-#line 1623 "awkgram.y" /* yacc.c:1646 */
+#line 1634 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->lasti->opcode == Op_push_i
&& ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0
@@ -3686,11 +3697,11 @@ regular_print:
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
}
-#line 3690 "awkgram.c" /* yacc.c:1646 */
+#line 3701 "awkgram.c" /* yacc.c:1646 */
break;
case 159:
-#line 1638 "awkgram.y" /* yacc.c:1646 */
+#line 1649 "awkgram.y" /* yacc.c:1646 */
{
/*
* was: $$ = $2
@@ -3700,20 +3711,20 @@ regular_print:
(yyvsp[-1])->memory = make_number(0.0);
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
-#line 3704 "awkgram.c" /* yacc.c:1646 */
+#line 3715 "awkgram.c" /* yacc.c:1646 */
break;
case 160:
-#line 1651 "awkgram.y" /* yacc.c:1646 */
+#line 1662 "awkgram.y" /* yacc.c:1646 */
{
func_use((yyvsp[0])->lasti->func_name, FUNC_USE);
(yyval) = (yyvsp[0]);
}
-#line 3713 "awkgram.c" /* yacc.c:1646 */
+#line 3724 "awkgram.c" /* yacc.c:1646 */
break;
case 161:
-#line 1656 "awkgram.y" /* yacc.c:1646 */
+#line 1667 "awkgram.y" /* yacc.c:1646 */
{
/* indirect function call */
INSTRUCTION *f, *t;
@@ -3746,11 +3757,11 @@ regular_print:
(yyval) = list_prepend((yyvsp[0]), t);
}
-#line 3750 "awkgram.c" /* yacc.c:1646 */
+#line 3761 "awkgram.c" /* yacc.c:1646 */
break;
case 162:
-#line 1692 "awkgram.y" /* yacc.c:1646 */
+#line 1703 "awkgram.y" /* yacc.c:1646 */
{
param_sanity((yyvsp[-1]));
(yyvsp[-3])->opcode = Op_func_call;
@@ -3764,49 +3775,49 @@ regular_print:
(yyval) = list_append(t, (yyvsp[-3]));
}
}
-#line 3768 "awkgram.c" /* yacc.c:1646 */
+#line 3779 "awkgram.c" /* yacc.c:1646 */
break;
case 163:
-#line 1709 "awkgram.y" /* yacc.c:1646 */
+#line 1720 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3774 "awkgram.c" /* yacc.c:1646 */
+#line 3785 "awkgram.c" /* yacc.c:1646 */
break;
case 164:
-#line 1711 "awkgram.y" /* yacc.c:1646 */
+#line 1722 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3780 "awkgram.c" /* yacc.c:1646 */
+#line 3791 "awkgram.c" /* yacc.c:1646 */
break;
case 165:
-#line 1716 "awkgram.y" /* yacc.c:1646 */
+#line 1727 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3786 "awkgram.c" /* yacc.c:1646 */
+#line 3797 "awkgram.c" /* yacc.c:1646 */
break;
case 166:
-#line 1718 "awkgram.y" /* yacc.c:1646 */
+#line 1729 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3792 "awkgram.c" /* yacc.c:1646 */
+#line 3803 "awkgram.c" /* yacc.c:1646 */
break;
case 167:
-#line 1723 "awkgram.y" /* yacc.c:1646 */
+#line 1734 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3798 "awkgram.c" /* yacc.c:1646 */
+#line 3809 "awkgram.c" /* yacc.c:1646 */
break;
case 168:
-#line 1725 "awkgram.y" /* yacc.c:1646 */
+#line 1736 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 3806 "awkgram.c" /* yacc.c:1646 */
+#line 3817 "awkgram.c" /* yacc.c:1646 */
break;
case 169:
-#line 1732 "awkgram.y" /* yacc.c:1646 */
+#line 1743 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = (yyvsp[0])->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated expressions */
@@ -3820,11 +3831,11 @@ regular_print:
sub_counter++; /* count # of dimensions */
(yyval) = (yyvsp[0]);
}
-#line 3824 "awkgram.c" /* yacc.c:1646 */
+#line 3835 "awkgram.c" /* yacc.c:1646 */
break;
case 170:
-#line 1749 "awkgram.y" /* yacc.c:1646 */
+#line 1760 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *t = (yyvsp[-1]);
if ((yyvsp[-1]) == NULL) {
@@ -3838,31 +3849,31 @@ regular_print:
(yyvsp[0])->sub_count = count_expressions(&t, false);
(yyval) = list_append(t, (yyvsp[0]));
}
-#line 3842 "awkgram.c" /* yacc.c:1646 */
+#line 3853 "awkgram.c" /* yacc.c:1646 */
break;
case 171:
-#line 1766 "awkgram.y" /* yacc.c:1646 */
+#line 1777 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3848 "awkgram.c" /* yacc.c:1646 */
+#line 3859 "awkgram.c" /* yacc.c:1646 */
break;
case 172:
-#line 1768 "awkgram.y" /* yacc.c:1646 */
+#line 1779 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 3856 "awkgram.c" /* yacc.c:1646 */
+#line 3867 "awkgram.c" /* yacc.c:1646 */
break;
case 173:
-#line 1775 "awkgram.y" /* yacc.c:1646 */
+#line 1786 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3862 "awkgram.c" /* yacc.c:1646 */
+#line 3873 "awkgram.c" /* yacc.c:1646 */
break;
case 174:
-#line 1780 "awkgram.y" /* yacc.c:1646 */
+#line 1791 "awkgram.y" /* yacc.c:1646 */
{
char *var_name = (yyvsp[0])->lextok;
@@ -3870,22 +3881,22 @@ regular_print:
(yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new);
(yyval) = list_create((yyvsp[0]));
}
-#line 3874 "awkgram.c" /* yacc.c:1646 */
+#line 3885 "awkgram.c" /* yacc.c:1646 */
break;
case 175:
-#line 1788 "awkgram.y" /* yacc.c:1646 */
+#line 1799 "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 3885 "awkgram.c" /* yacc.c:1646 */
+#line 3896 "awkgram.c" /* yacc.c:1646 */
break;
case 176:
-#line 1798 "awkgram.y" /* yacc.c:1646 */
+#line 1809 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = (yyvsp[0])->nexti;
if (ip->opcode == Op_push
@@ -3897,73 +3908,73 @@ regular_print:
} else
(yyval) = (yyvsp[0]);
}
-#line 3901 "awkgram.c" /* yacc.c:1646 */
+#line 3912 "awkgram.c" /* yacc.c:1646 */
break;
case 177:
-#line 1810 "awkgram.y" /* yacc.c:1646 */
+#line 1821 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_append((yyvsp[-1]), (yyvsp[-2]));
if ((yyvsp[0]) != NULL)
mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3911 "awkgram.c" /* yacc.c:1646 */
+#line 3922 "awkgram.c" /* yacc.c:1646 */
break;
case 178:
-#line 1819 "awkgram.y" /* yacc.c:1646 */
+#line 1830 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postincrement;
}
-#line 3919 "awkgram.c" /* yacc.c:1646 */
+#line 3930 "awkgram.c" /* yacc.c:1646 */
break;
case 179:
-#line 1823 "awkgram.y" /* yacc.c:1646 */
+#line 1834 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postdecrement;
}
-#line 3927 "awkgram.c" /* yacc.c:1646 */
+#line 3938 "awkgram.c" /* yacc.c:1646 */
break;
case 180:
-#line 1826 "awkgram.y" /* yacc.c:1646 */
+#line 1837 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3933 "awkgram.c" /* yacc.c:1646 */
+#line 3944 "awkgram.c" /* yacc.c:1646 */
break;
case 182:
-#line 1834 "awkgram.y" /* yacc.c:1646 */
+#line 1845 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 3939 "awkgram.c" /* yacc.c:1646 */
+#line 3950 "awkgram.c" /* yacc.c:1646 */
break;
case 183:
-#line 1838 "awkgram.y" /* yacc.c:1646 */
+#line 1849 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 3945 "awkgram.c" /* yacc.c:1646 */
+#line 3956 "awkgram.c" /* yacc.c:1646 */
break;
case 186:
-#line 1847 "awkgram.y" /* yacc.c:1646 */
+#line 1858 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 3951 "awkgram.c" /* yacc.c:1646 */
+#line 3962 "awkgram.c" /* yacc.c:1646 */
break;
case 187:
-#line 1851 "awkgram.y" /* yacc.c:1646 */
+#line 1862 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); yyerrok; }
-#line 3957 "awkgram.c" /* yacc.c:1646 */
+#line 3968 "awkgram.c" /* yacc.c:1646 */
break;
case 188:
-#line 1855 "awkgram.y" /* yacc.c:1646 */
+#line 1866 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 3963 "awkgram.c" /* yacc.c:1646 */
+#line 3974 "awkgram.c" /* yacc.c:1646 */
break;
-#line 3967 "awkgram.c" /* yacc.c:1646 */
+#line 3978 "awkgram.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -4191,7 +4202,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 1857 "awkgram.y" /* yacc.c:1906 */
+#line 1868 "awkgram.y" /* yacc.c:1906 */
struct token {
@@ -4620,11 +4631,9 @@ mk_program()
cp = end_block;
else
cp = list_merge(begin_block, end_block);
- /*
- * We don't need to clear the comment variables
- * since they're not used anymore after this
- * function is called.
- */
+ if (program_comment != NULL) {
+ (void) list_prepend(cp, program_comment);
+ }
if (comment != NULL)
(void) list_append(cp, comment);
(void) list_append(cp, ip_atexit);
@@ -4672,6 +4681,10 @@ out:
/* delete the Op_list, not needed */
tmp = cp->nexti;
bcfree(cp);
+ /* these variables are not used again but zap them anyway. */
+ comment = NULL;
+ function_comment = NULL;
+ program_comment = NULL;
return tmp;
#undef begin_block
@@ -5314,11 +5327,29 @@ pushback(void)
(! lexeof && lexptr && lexptr > lexptr_begin ? lexptr-- : lexptr);
}
+/* check_comment --- check for block comment */
+
+void
+check_comment(void)
+{
+ if (comment != NULL) {
+ if (first_rule) {
+ program_comment = comment;
+ } else
+ block_comment = comment;
+ comment = NULL;
+ }
+ first_rule = false;
+}
-/* get_comment --- collect comment text */
+/*
+ * get_comment --- collect comment text.
+ * Flag = EOL_COMMENT for end-of-line comments.
+ * Flag = FULL_COMMENT for self-contained comments.
+ */
int
-get_comment(void)
+get_comment(int flag)
{
int c;
int sl;
@@ -5330,6 +5361,12 @@ get_comment(void)
while ((c = nextc(false)) != '\n' && c != END_FILE) {
tokadd(c);
}
+ if (flag == EOL_COMMENT) {
+ /* comment at end of line. */
+ if (c == '\n')
+ tokadd(c);
+ break;
+ }
if (c == '\n') {
tokadd(c);
sourceline++;
@@ -5344,6 +5381,7 @@ get_comment(void)
break;
else if (c != '#') {
pushback();
+ sourceline--;
break;
} else
tokadd(c);
@@ -5353,6 +5391,7 @@ get_comment(void)
comment = bcalloc(Op_comment, 1, sl);
comment->source_file = source;
comment->memory = make_str_node(tokstart, tok - tokstart, 0);
+ comment->memory->comment_type = flag;
return c;
}
@@ -5404,7 +5443,7 @@ allow_newline(void)
if (c == '#') {
if (do_pretty_print && ! do_profile) {
/* collect comment byte code iff doing pretty print but not profiling. */
- c = get_comment();
+ c = get_comment(EOL_COMMENT);
} else {
while ((c = nextc(false)) != '\n' && c != END_FILE)
continue;
@@ -5616,7 +5655,10 @@ retry:
* Collect comment byte code iff doing pretty print
* but not profiling.
*/
- c = get_comment();
+ if (lasttok == NEWLINE || lasttok == 0)
+ c = get_comment(FULL_COMMENT);
+ else
+ c = get_comment(EOL_COMMENT);
if (c == END_FILE)
return lasttok = NEWLINE_EOF;
@@ -5653,7 +5695,7 @@ retry:
_("use of `\\ #...' line continuation is not portable"));
}
if (do_pretty_print && ! do_profile)
- c = get_comment();
+ c = get_comment(EOL_COMMENT);
else {
while ((c = nextc(false)) != '\n')
if (c == END_FILE)
@@ -7508,7 +7550,11 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
(rp + 1)->lasti = action->lasti;
(rp + 2)->first_line = pattern->source_line;
(rp + 2)->last_line = lastline;
- ip = list_prepend(action, rp);
+ if (block_comment != NULL) {
+ ip = list_prepend(list_prepend(action, block_comment), rp);
+ block_comment = NULL;
+ } else
+ ip = list_prepend(action, rp);
} else {
rp = bcalloc(Op_rule, 3, 0);
diff --git a/awkgram.y b/awkgram.y
index 85825cb9..6721bcdc 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -88,6 +88,7 @@ static void check_funcs(void);
static ssize_t read_one_line(int fd, void *buffer, size_t count);
static int one_line_close(int fd);
static void split_comment(void);
+static void check_comment(void);
static bool want_source = false;
static bool want_regexp = false; /* lexical scanning kludge */
@@ -150,8 +151,10 @@ static INSTRUCTION *ip_beginfile;
static INSTRUCTION *comment = NULL;
static INSTRUCTION *program_comment = NULL;
static INSTRUCTION *function_comment = NULL;
+static INSTRUCTION *block_comment = NULL;
static bool func_first = true;
+static bool first_rule = true;
static inline INSTRUCTION *list_create(INSTRUCTION *x);
static inline INSTRUCTION *list_append(INSTRUCTION *l, INSTRUCTION *x);
@@ -334,7 +337,11 @@ pattern
($1->nexti + 1)->condpair_left = $1->lasti;
($1->nexti + 1)->condpair_right = $4->lasti;
}
- $$ = list_append(list_merge($1, $4), tp);
+ if (comment != NULL) {
+ $$ = list_append(list_merge(list_prepend($1, comment), $4), tp);
+ comment = NULL;
+ } else
+ $$ = list_append(list_merge($1, $4), tp);
rule = Rule;
}
| LEX_BEGIN
@@ -348,6 +355,7 @@ pattern
$1->in_rule = rule = BEGIN;
$1->source_file = source;
+ check_comment();
$$ = $1;
}
| LEX_END
@@ -361,6 +369,7 @@ pattern
$1->in_rule = rule = END;
$1->source_file = source;
+ check_comment();
$$ = $1;
}
| LEX_BEGINFILE
@@ -368,6 +377,7 @@ pattern
func_first = false;
$1->in_rule = rule = BEGINFILE;
$1->source_file = source;
+ check_comment();
$$ = $1;
}
| LEX_ENDFILE
@@ -375,6 +385,7 @@ pattern
func_first = false;
$1->in_rule = rule = ENDFILE;
$1->source_file = source;
+ check_comment();
$$ = $1;
}
;
@@ -2282,11 +2293,9 @@ mk_program()
cp = end_block;
else
cp = list_merge(begin_block, end_block);
- /*
- * We don't need to clear the comment variables
- * since they're not used anymore after this
- * function is called.
- */
+ if (program_comment != NULL) {
+ (void) list_prepend(cp, program_comment);
+ }
if (comment != NULL)
(void) list_append(cp, comment);
(void) list_append(cp, ip_atexit);
@@ -2334,6 +2343,10 @@ out:
/* delete the Op_list, not needed */
tmp = cp->nexti;
bcfree(cp);
+ /* these variables are not used again but zap them anyway. */
+ comment = NULL;
+ function_comment = NULL;
+ program_comment = NULL;
return tmp;
#undef begin_block
@@ -2976,11 +2989,29 @@ pushback(void)
(! lexeof && lexptr && lexptr > lexptr_begin ? lexptr-- : lexptr);
}
+/* check_comment --- check for block comment */
+
+void
+check_comment(void)
+{
+ if (comment != NULL) {
+ if (first_rule) {
+ program_comment = comment;
+ } else
+ block_comment = comment;
+ comment = NULL;
+ }
+ first_rule = false;
+}
-/* get_comment --- collect comment text */
+/*
+ * get_comment --- collect comment text.
+ * Flag = EOL_COMMENT for end-of-line comments.
+ * Flag = FULL_COMMENT for self-contained comments.
+ */
int
-get_comment(void)
+get_comment(int flag)
{
int c;
int sl;
@@ -2992,6 +3023,12 @@ get_comment(void)
while ((c = nextc(false)) != '\n' && c != END_FILE) {
tokadd(c);
}
+ if (flag == EOL_COMMENT) {
+ /* comment at end of line. */
+ if (c == '\n')
+ tokadd(c);
+ break;
+ }
if (c == '\n') {
tokadd(c);
sourceline++;
@@ -3006,6 +3043,7 @@ get_comment(void)
break;
else if (c != '#') {
pushback();
+ sourceline--;
break;
} else
tokadd(c);
@@ -3015,6 +3053,7 @@ get_comment(void)
comment = bcalloc(Op_comment, 1, sl);
comment->source_file = source;
comment->memory = make_str_node(tokstart, tok - tokstart, 0);
+ comment->memory->comment_type = flag;
return c;
}
@@ -3066,7 +3105,7 @@ allow_newline(void)
if (c == '#') {
if (do_pretty_print && ! do_profile) {
/* collect comment byte code iff doing pretty print but not profiling. */
- c = get_comment();
+ c = get_comment(EOL_COMMENT);
} else {
while ((c = nextc(false)) != '\n' && c != END_FILE)
continue;
@@ -3278,7 +3317,10 @@ retry:
* Collect comment byte code iff doing pretty print
* but not profiling.
*/
- c = get_comment();
+ if (lasttok == NEWLINE || lasttok == 0)
+ c = get_comment(FULL_COMMENT);
+ else
+ c = get_comment(EOL_COMMENT);
if (c == END_FILE)
return lasttok = NEWLINE_EOF;
@@ -3315,7 +3357,7 @@ retry:
_("use of `\\ #...' line continuation is not portable"));
}
if (do_pretty_print && ! do_profile)
- c = get_comment();
+ c = get_comment(EOL_COMMENT);
else {
while ((c = nextc(false)) != '\n')
if (c == END_FILE)
@@ -5170,7 +5212,11 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
(rp + 1)->lasti = action->lasti;
(rp + 2)->first_line = pattern->source_line;
(rp + 2)->last_line = lastline;
- ip = list_prepend(action, rp);
+ if (block_comment != NULL) {
+ ip = list_prepend(list_prepend(action, block_comment), rp);
+ block_comment = NULL;
+ } else
+ ip = list_prepend(action, rp);
} else {
rp = bcalloc(Op_rule, 3, 0);
diff --git a/profile.c b/profile.c
index 59542ab9..ad879a3c 100644
--- a/profile.c
+++ b/profile.c
@@ -26,6 +26,7 @@
#include "awk.h"
static void pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header);
+static void 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);
@@ -176,70 +177,80 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header)
NODE *t1;
char *str;
NODE *t2;
- INSTRUCTION *ip;
+ INSTRUCTION *ip1;
+ INSTRUCTION *ip2;
NODE *m;
char *tmp;
int rule;
- long lind;
static int rule_count[MAXRULE];
for (pc = startp; pc != endp; pc = pc->nexti) {
if (pc->source_line > 0)
sourceline = pc->source_line;
+ /* skip leading EOL comment as it has already been printed */
+ if (pc->opcode == Op_comment
+ && pc->memory->comment_type == EOL_COMMENT)
+ continue;
switch (pc->opcode) {
case Op_rule:
+ /*
+ * Rules are three instructions long.
+ * See append_rule in awkgram.y.
+ * The first has the Rule Op Code, nexti etc.
+ * The second, (pc + 1) has firsti and lasti:
+ * the first/last ACTION instructions for this rule.
+ * The third has first_line and last_line:
+ * the first and last source line numbers.
+ */
source = pc->source_file;
rule = pc->in_rule;
if (rule != Rule) {
- ip = (pc + 1)->firsti;
-
- /* print pre-begin/end comments */
- if (ip->opcode == Op_comment) {
- print_comment(ip, 0);
- ip = ip->nexti;
- }
+ /* Allow for pre-non-rule-block comment */
+ if (pc->nexti != (pc +1)->firsti
+ && pc->nexti->opcode == Op_comment
+ && pc->nexti->memory->comment_type == FULL_COMMENT)
+ print_comment(pc->nexti, -1);
+ ip1 = (pc + 1)->firsti;
+ ip2 = (pc + 1)->lasti;
if (do_profile) {
if (! rule_count[rule]++)
fprintf(prof_fp, _("\t# %s rule(s)\n\n"), ruletab[rule]);
indent(0);
}
- fprintf(prof_fp, "%s {\n", ruletab[rule]);
+ fprintf(prof_fp, "%s {", ruletab[rule]);
+ end_line(pc);
} else {
if (do_profile && ! rule_count[rule]++)
fprintf(prof_fp, _("\t# Rule(s)\n\n"));
- ip = pc->nexti;
- lind = ip->exec_count;
- /* print pre-block comments */
- if (ip->opcode == Op_exec_count && ip->nexti->opcode == Op_comment)
- ip = ip->nexti;
- if (ip->opcode == Op_comment) {
- print_comment(ip, lind);
- if (ip->nexti->nexti == (pc + 1)->firsti)
- ip = ip->nexti->nexti;
- }
- if (ip != (pc + 1)->firsti) { /* non-empty pattern */
- indent(lind);
- pprint(ip->nexti, (pc + 1)->firsti, false);
- t1 = pp_pop();
- fprintf(prof_fp, "%s {", t1->pp_str);
- pp_free(t1);
- ip = (pc + 1)->firsti;
-
- if (do_profile && ip->exec_count > 0)
- fprintf(prof_fp, " # %ld", ip->exec_count);
-
- fprintf(prof_fp, "\n");
+ ip1 = pc->nexti;
+ if (ip1 != (pc + 1)->firsti) { /* non-empty pattern */
+ pprint(ip1->nexti, (pc + 1)->firsti, false);
+ /* Allow for case where the "pattern" is just a comment */
+ if (ip1->nexti->nexti->nexti != (pc +1)->firsti
+ || ip1->nexti->opcode != Op_comment) {
+ t1 = pp_pop();
+ fprintf(prof_fp, "%s {", t1->pp_str);
+ pp_free(t1);
+ } else
+ fprintf(prof_fp, "{");
+ ip1 = (pc + 1)->firsti;
+ ip2 = (pc + 1)->lasti;
+
+ if (do_profile && ip1->exec_count > 0)
+ fprintf(prof_fp, " # %ld", ip1->exec_count);
+
+ end_line(ip1);
} else {
fprintf(prof_fp, "{\n");
- ip = (pc + 1)->firsti;
+ ip1 = (pc + 1)->firsti;
}
- ip = ip->nexti;
+ ip1 = ip1->nexti;
}
indent_in();
- pprint(ip, (pc + 1)->lasti, false);
+ pprint(ip1, ip2, false);
indent_out();
if (do_profile)
indent(0);
@@ -328,7 +339,7 @@ cleanup:
pp_free(t2);
pp_free(t1);
if (! in_for_header)
- fprintf(prof_fp, "\n");
+ end_line(pc);
break;
default:
@@ -454,7 +465,7 @@ cleanup:
pp_free(t2);
pp_free(t1);
if (! in_for_header)
- fprintf(prof_fp, "\n");
+ end_line(pc);
break;
case Op_concat:
@@ -475,7 +486,7 @@ cleanup:
} else
fprintf(prof_fp, "%s %s", op2str(Op_K_delete), array);
if (! in_for_header)
- fprintf(prof_fp, "\n");
+ end_line(pc);
pp_free(t1);
}
break;
@@ -587,7 +598,7 @@ cleanup:
fprintf(prof_fp, "%s%s", op2str(pc->opcode), tmp);
efree(tmp);
if (! in_for_header)
- fprintf(prof_fp, "\n");
+ end_line(pc);
break;
case Op_push_re:
@@ -705,33 +716,33 @@ cleanup:
t1 = pp_pop();
fprintf(prof_fp, "%s", t1->pp_str);
if (! in_for_header)
- fprintf(prof_fp, "\n");
+ end_line(pc);
pp_free(t1);
break;
case Op_line_range:
- ip = pc + 1;
- pprint(pc->nexti, ip->condpair_left, false);
- pprint(ip->condpair_left->nexti, ip->condpair_right, false);
+ ip1 = pc + 1;
+ pprint(pc->nexti, ip1->condpair_left, false);
+ pprint(ip1->condpair_left->nexti, ip1->condpair_right, false);
t2 = pp_pop();
t1 = pp_pop();
str = pp_group3(t1->pp_str, ", ", t2->pp_str);
pp_free(t1);
pp_free(t2);
pp_push(Op_line_range, str, CAN_FREE);
- pc = ip->condpair_right;
+ pc = ip1->condpair_right;
break;
case Op_K_while:
- ip = pc + 1;
- indent(ip->while_body->exec_count);
+ ip1 = pc + 1;
+ indent(ip1->while_body->exec_count);
fprintf(prof_fp, "%s (", op2str(pc->opcode));
- pprint(pc->nexti, ip->while_body, false);
+ pprint(pc->nexti, ip1->while_body, false);
t1 = pp_pop();
fprintf(prof_fp, "%s) {\n", t1->pp_str);
pp_free(t1);
indent_in();
- pprint(ip->while_body->nexti, pc->target_break, false);
+ pprint(ip1->while_body->nexti, pc->target_break, false);
indent_out();
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
@@ -739,13 +750,13 @@ cleanup:
break;
case Op_K_do:
- ip = pc + 1;
+ ip1 = pc + 1;
indent(pc->nexti->exec_count);
fprintf(prof_fp, "%s {\n", op2str(pc->opcode));
indent_in();
- pprint(pc->nexti->nexti, ip->doloop_cond, false);
+ pprint(pc->nexti->nexti, ip1->doloop_cond, false);
indent_out();
- pprint(ip->doloop_cond, pc->target_break, false);
+ pprint(ip1->doloop_cond, pc->target_break, false);
indent(SPACEOVER);
t1 = pp_pop();
fprintf(prof_fp, "} %s (%s)\n", op2str(Op_K_while), t1->pp_str);
@@ -754,24 +765,24 @@ cleanup:
break;
case Op_K_for:
- ip = pc + 1;
- indent(ip->forloop_body->exec_count);
+ ip1 = pc + 1;
+ indent(ip1->forloop_body->exec_count);
fprintf(prof_fp, "%s (", op2str(pc->opcode));
/* If empty for looop header, print it a little more nicely. */
if ( pc->nexti->opcode == Op_no_op
- && ip->forloop_cond == pc->nexti
+ && ip1->forloop_cond == pc->nexti
&& pc->target_continue->opcode == Op_jmp) {
fprintf(prof_fp, ";;");
} else {
- pprint(pc->nexti, ip->forloop_cond, true);
+ pprint(pc->nexti, ip1->forloop_cond, true);
fprintf(prof_fp, "; ");
- if (ip->forloop_cond->opcode == Op_no_op &&
- ip->forloop_cond->nexti == ip->forloop_body)
+ if (ip1->forloop_cond->opcode == Op_no_op &&
+ ip1->forloop_cond->nexti == ip1->forloop_body)
fprintf(prof_fp, "; ");
else {
- pprint(ip->forloop_cond, ip->forloop_body, true);
+ pprint(ip1->forloop_cond, ip1->forloop_body, true);
t1 = pp_pop();
fprintf(prof_fp, "%s; ", t1->pp_str);
pp_free(t1);
@@ -781,7 +792,7 @@ cleanup:
}
fprintf(prof_fp, ") {\n");
indent_in();
- pprint(ip->forloop_body->nexti, pc->target_continue, false);
+ pprint(ip1->forloop_body->nexti, pc->target_continue, false);
indent_out();
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
@@ -793,20 +804,20 @@ cleanup:
char *array;
const char *item;
- ip = pc + 1;
+ ip1 = pc + 1;
t1 = pp_pop();
array = t1->pp_str;
- m = ip->forloop_cond->array_var;
+ m = ip1->forloop_cond->array_var;
if (m->type == Node_param_list)
item = func_params[m->param_cnt].param;
else
item = m->vname;
- indent(ip->forloop_body->exec_count);
+ indent(ip1->forloop_body->exec_count);
fprintf(prof_fp, "%s (%s%s%s) {\n", op2str(Op_K_arrayfor),
item, op2str(Op_in_array), array);
indent_in();
pp_free(t1);
- pprint(ip->forloop_body->nexti, pc->target_break, false);
+ pprint(ip1->forloop_body->nexti, pc->target_break, false);
indent_out();
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
@@ -815,13 +826,13 @@ cleanup:
break;
case Op_K_switch:
- ip = pc + 1;
+ ip1 = pc + 1;
fprintf(prof_fp, "%s (", op2str(pc->opcode));
- pprint(pc->nexti, ip->switch_start, false);
+ pprint(pc->nexti, ip1->switch_start, false);
t1 = pp_pop();
fprintf(prof_fp, "%s) {\n", t1->pp_str);
pp_free(t1);
- pprint(ip->switch_start, ip->switch_end, false);
+ pprint(ip1->switch_start, ip1->switch_end, false);
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
pc = pc->target_break;
@@ -848,12 +859,12 @@ cleanup:
fprintf(prof_fp, "%s) {", t1->pp_str);
pp_free(t1);
- ip = pc->branch_if;
- if (ip->exec_count > 0)
- fprintf(prof_fp, " # %ld", ip->exec_count);
- fprintf(prof_fp, "\n");
+ ip1 = pc->branch_if;
+ if (ip1->exec_count > 0)
+ fprintf(prof_fp, " # %ld", ip1->exec_count);
+ end_line(pc);
indent_in();
- pprint(ip->nexti, pc->branch_else, false);
+ pprint(ip1->nexti, pc->branch_else, false);
indent_out();
pc = pc->branch_else;
if (pc->nexti->opcode == Op_no_op) {
@@ -878,11 +889,11 @@ cleanup:
size_t len;
pprint(pc->nexti, pc->branch_if, false);
- ip = pc->branch_if;
- pprint(ip->nexti, pc->branch_else, false);
- ip = pc->branch_else->nexti;
+ ip1 = pc->branch_if;
+ pprint(ip1->nexti, pc->branch_else, false);
+ ip1 = pc->branch_else->nexti;
- pc = ip->nexti;
+ pc = ip1->nexti;
assert(pc->opcode == Op_cond_exp);
pprint(pc->nexti, pc->branch_end, false);
@@ -923,6 +934,21 @@ cleanup:
}
}
+/* end_line --- end pretty print line with new line or on-line comment */
+
+void
+end_line(INSTRUCTION *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;
+ }
+ else
+ fprintf(prof_fp, "\n");
+}
+
/* pp_string_fp --- printy print a string to the fp */
/*
@@ -1008,7 +1034,8 @@ print_comment(INSTRUCTION* pc, long in)
count = pc->memory->stlen;
text = pc->memory->stptr;
- indent(in); /* is this correct? Where should comments go? */
+ if (in >= 0)
+ indent(in); /* is this correct? Where should comments go? */
for (; count > 0; count--, text++) {
if (after_newline) {
indent(in);
@@ -1586,7 +1613,7 @@ pp_func(INSTRUCTION *pc, void *data ATTRIBUTE_UNUSED)
/* print any function comment */
if (fp->opcode == Op_comment && fp->source_line == 0) {
- print_comment(fp, 0);
+ print_comment(fp, -1); /* -1 ==> don't indent */
fp = fp->nexti;
}
diff --git a/test/ChangeLog b/test/ChangeLog
index de7e66d3..9b00b382 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile5.ok: Updated after code changes.
+
2014-11-26 Arnold D. Robbins <arnold@skeeve.com>
* Gentests: Fix gensub call after adding warning.
@@ -10,6 +14,7 @@
* Makefile.am (sortglos): New test.
* sortglos.awk, sortglos.in, sortglos.ok: New files.
+ Thanks to Antonio Columbo.
2014-11-09 Arnold D. Robbins <arnold@skeeve.com>
diff --git a/test/profile5.ok b/test/profile5.ok
index 4c944627..5bf04dcf 100644
--- a/test/profile5.ok
+++ b/test/profile5.ok
@@ -2,8 +2,7 @@ BEGIN {
_addlib("_BASE")
}
-############################################################################
-
+#___________________________________________________________________________________
BEGIN {
BINMODE = "rw"
SUBSEP = "\000"
@@ -24,8 +23,7 @@ BEGIN {
_addlib("_INSTRUC")
}
-#############################################################################
-
+#___________________________________________________________________________________
BEGIN {
_delay_perfmsdelay = 11500
}
@@ -38,19 +36,11 @@ BEGIN {
BEGIN {
}
-###########################################################################
-
-
-
-
-
-
-BEGIN {
+BEGIN { ###########################################################################
_addlib("_EXTFN")
}
-#############################################################################
-
+#___________________________________________________________________________________
BEGIN {
delete _XCHR
delete _ASC
@@ -78,7 +68,6 @@ BEGIN {
_QSTR[_CHR[i]] = _QSTRQ[_CHR[i]]
}
_QSTR["\\"] = "\\\\"
- #; _QSTR["\""]="\\\""
#_____________________________________________________________________________
_CHR["CR"] = "\r"
@@ -117,8 +106,7 @@ BEGIN {
_addlib("_SYSIO")
}
-#############################################################################
-
+#___________________________________________________________________________________
BEGIN {
_SYS_STDCON = "CON"
_CON_WIDTH = (match(_cmd("MODE " _SYS_STDCON " 2>NUL"), /Columns:[ \t]*([0-9]+)/, A) ? strtonum(A[1]) : 80)
@@ -128,8 +116,7 @@ BEGIN {
_addlib("_FILEIO")
}
-#############################################################################
-
+#___________________________________________________________________________________
BEGIN {
if (_SYS_STDOUT == "") {
_SYS_STDOUT = "/dev/stdout"
@@ -151,7 +138,7 @@ BEGIN {
_addlib("_tOBJ")
}
-#############################################################################
+#___________________________________________________________________________________
BEGIN {
_tInBy = "\212._tInBy"
_tgenuid_init()
@@ -183,8 +170,7 @@ BEGIN {
_addlib("_ERRLOG")
}
-#############################################################################
-
+#___________________________________________________________________________________
BEGIN {
if (_gawk_scriptlevel < 1) {
_ERRLOG_TF = 1
@@ -206,11 +192,7 @@ BEGIN {
_shortcut_init()
}
-#########################################################
-
-
-
-BEGIN {
+BEGIN { #########################################################
_addlib("_eXTFN")
}
@@ -219,10 +201,7 @@ BEGIN {
_extfn_init()
}
-############################################################
-
-
-BEGIN {
+BEGIN { ############################################################
_addlib("_sHARE")
}
@@ -231,9 +210,7 @@ BEGIN {
}
BEGIN {
- _addlib("_DS")
- ###############################################################################
-
+ _addlib("_DS") ###############################################################################
_PRODUCT_NAME = "Deployment Solution Control"
_PRODUCT_VERSION = "1.0"
_PRODUCT_COPYRIGHT = "Copyright (C) 2013 by CosumoGEN"
@@ -300,7 +277,29 @@ BEGIN {
_initsys()
}
-############################################################################
+#_________________________________________________________________________________________
+##########################################################################################
+
+
+
+
+
+
+
+#BootDevice BuildNumber BuildType Caption CodeSet CountryCode CreationClassName CSCreationClassName CSDVersion CSName CurrentTimeZone DataExecutionPrevention_32BitApplications DataExecutionPrevention_Available DataExecutionPrevention_Drivers DataExecutionPrevention_SupportPolicy Debug Description Distributed EncryptionLevel ForegroundApplicationBoost FreePhysicalMemory FreeSpaceInPagingFiles FreeVirtualMemory InstallDate LargeSystemCache LastBootUpTime LocalDateTime Locale Manufacturer MaxNumberOfProcesses MaxProcessMemorySize MUILanguages Name NumberOfLicensedUsers NumberOfProcesses NumberOfUsers OperatingSystemSKU Organization OSArchitecture OSLanguage OSProductSuite OSType OtherTypeDescription PAEEnabled PlusProductID PlusVersionNumber Primary ProductType RegisteredUser SerialNumber ServicePackMajorVersion ServicePackMinorVersion SizeStoredInPagingFiles Status SuiteMask SystemDevice SystemDirectory SystemDrive TotalSwapSpaceSize TotalVirtualMemorySize TotalVisibleMemorySize Version WindowsDirectory
+#\Device\HarddiskVolume1 7601 Multiprocessor Free Microsoft Windows Server 2008 R2 Enterprise 1252 1 Win32_OperatingSystem Win32_ComputerSystem Service Pack 1 CPU 180 TRUE TRUE TRUE 3 FALSE FALSE 256 0 6925316 33518716 41134632 20110502192745.000000+180 20130426120425.497469+180 20130510134606.932000+180 0409 Microsoft Corporation -1 8589934464 {"en-US"} Microsoft Windows Server 2008 R2 Enterprise |C:\Windows|\Device\Harddisk0\Partition2 0 116 2 10 64-bit 1033 274 18 TRUE 3 Windows User 55041-507-2389175-84833 1 0 33554432 OK 274 \Device\HarddiskVolume2 C:\Windows\system32 C: 50311020 16758448 6.1.7601 C:\Windows
+
+
+
+
+
+
+
+
+
+
+
+
BEGIN {
a = ENVIRON["EGAWK_CMDLINE"]
@@ -321,13 +320,43 @@ BEGIN {
_END()
}
-########################################################################
-
+#_____________________________________________________________________________
END {
_EXIT()
}
-###############################################################################
+#_______________________________________________________________________
+########################################################################
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
END {
if (_gawk_scriptlevel < 1) {
@@ -339,8 +368,17 @@ END {
}
}
-###############################################################################
-
+##########################################################################################
+# PUBLIC:
+#_____________________________________________________________________________
+# _rFBRO(ptr) - Return ptr of first-bro. [TESTED]
+# If !ptr then returns "".
+#_____________________________________________________________________________
+# _rLBRO(ptr) - Return ptr of last-bro. [TESTED]
+# If !ptr then returns "".
+#_____________________________________________________________________________
+# _rQBRO(ptr) - Returns brothers total quantity. [TESTED]
+# If !ptr then returns "".
END {
if (_gawk_scriptlevel < 1) {
if (! _fileio_notdeltmpflag) {
@@ -350,7 +388,297 @@ END {
}
}
-###############################################################################
+#___________________________________________________________________________________
+####################################################################################
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#___________________________________________________________________________________
+# fn _dirtree(array,pathmask)
+#
+# Return in `array' file tree from pathmask:
+# array["file.filerdne"]="size date time"
+# array["subdir.filerd"]["file.filerdne"]="size date time"
+# array["subdir.filerd"]["file.filerd"][...]
+#
+# The array will be cleared before any action. Function return pathmask w/o ltabspc and rtabspc.
+#___________________________________________________________________________________
+
+
+
+
+
+# OK: change internal function's names to: w\o "_"
+# OK: FLENGTH: should cover r-spcs
+# OK: optimize REXP
+# OK: add new symbols to dir/file names ( ! and + )
+# OK: create _getfilepath()
+# OK: del - conflict with WROOTDIR (do not update it)
+# OK: dir/del - support for filemask ( * and ? )
+# OK: how to define code injections: header\ender; and HANDLERS
+# OK: units in header\ender? conline division...
+# OK: _FILEPATH problem: it will not been defined at the moment when subscript0 starts - at the start TMPRD="_tmp"
+# OK: del: if del("dir\\") - then all ok except it NOT deleted "dir\\" - _del function removed(renamed to __del)
+# OK: tmpdirs: it delete only autotmp dir and only from script0
+# OK: MICROTEST: global testing of filepath (UNC! CORRECT RESULTS! )
+# question about cache: did new just now generated absolute filepath cached in FILECACHE? its seems like NO
+# check _untmp: CONFLICT: if file or dir from autotmp dir will be untmp then it anyway will be deleted; but file or dir from other point never be deleted anyway - so what is the point of untmp?????
+#ERRLOG: _setmpath: warning!!!!!
+
+#___________________________________________________________________________________
+####################################################################################
+# PUBLIC:
+#___________________________________________________________________________________
+#
+# fn _rdfile(_filepath)
+#
+# Read and return data from file specified in _filepath.
+# If _filepath=="" then no action occured and return "".
+# Function read and return data from file. No any changes in data occured.
+# Function use _filerdne function internally. If some syntax error
+# found in _filepath then function return "".
+# If some error occured while reading data from file then fuction return ""
+# and error-text is in ERRNO(and no close-file action will be occured!).
+# If reading data completed successfully then function try to close
+# file and if while closing file some error occured then function
+# returns "" and error-text is in ERRNO.
+# Otherwise function returns readed data.
+#_____________________________________________________________________________
+#
+# fn _wrfile(_filepath,_data)
+#
+# Write data into file specified in _filepath.
+# If _filepath=="" then no action occured and return "".
+# Function write _data to file. No any changes in data occured.
+# Function use _filerdne function internally. If some syntax error
+# found in _filepath then function return "".
+# If some error occured while writing data to file then fuction return ""
+# and error-text is in ERRNO(and no close-file action will be occured!).
+# If writing data completed successfully then function try to close
+# file and if while closing file some error occured then function
+# returns "" and error-text is in ERRNO.
+# Otherwise function returns _filepath(re-processed).
+#___________________________________________________________________________________
+#
+# fn _filepath(_filepath)
+#
+# Return re-processed root-dir-name-ext of _filepath.
+# If _filepath=="" then no action occured and return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+#
+# fn _filerdne(_filepath)
+#
+# Return re-processed root-dir-filename of _filepath.
+# If _filepath=="" then no action occured and return "".
+# Function return result only if in _filepath present file-name(name
+# and/or extension) - otherwise its return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+#
+# fn _filerdn(_filepath)
+#
+# Return re-processed root-dir-name of _filepath.
+# If _filepath=="" then no action occured and return "".
+# Function return result only if in _filepath present name field -
+# - otherwise its return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+#
+# fn _filerd(_filepath)
+#
+# Return re-processed root-dir of _filepath.
+# If _filepath=="" then no action occured and return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+#
+# fn _filer(_filepath)
+#
+# Return re-processed root of _filepath.
+# If _filepath=="" then no action occured and return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+#
+# fn _filed(_filepath)
+#
+# Return re-processed dir of _filepath.
+# If _filepath=="" then no action occured and return "".
+# There is only one case when dir string can be =="" - when in
+# _filepath specified unmounted drive(MS-format) and from-
+# current-location address used(like Z:file.ext). In this
+# case no rootdir-cache-record will be created.
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+# fn _filene(_filepath)
+#
+# Return re-processed name-ext of _filepath.
+# If _filepath=="" then no action occured and return "".
+# Function return result only if in _filepath present file-name(name
+# and/or extension) - otherwise its return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+#
+# fn _filen(_filepath)
+#
+# Return re-processed name of _filepath.
+# If _filepath=="" then no action occured and return "".
+# Function return result only if in _filepath present name field -
+# - otherwise its return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#_____________________________________________________________________________
+#
+# fn _file(_filepath)
+#
+# Return re-processed ext of _filepath.
+# If _filepath=="" then no action occured and return "".
+# Function return result only if in _filepath present ext field -
+# - otherwise its return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+#___________________________________________________________________________________
+#
+# fn _dir(_ARR,_filepathmask)
+#
+# Get file-/folder-list of root-folder of _filepathmask.
+# If _filepathmask=="" then no action occured and return "".
+# _filepathmask can contain symbols like `*' and `?' as like
+# its used in `dir'-shell command.
+# Function gets file-/folder-list of specified root-dir-_filepathmask
+# and return this list in array _ARR - where each element:
+#
+# index - is the _filepath of file-or-folder name-ext
+# value - contains 3 fields separated by " ":
+# 1. =="D" if this is folder
+# ==/[0-9]+/ if this is file - size of file in bytes
+# 2. ==date-of-creation of file or folder
+# 3. ==time-of-creation of file or folder
+#
+# Function returns quantity of items in ARR.
+#___________________________________________________________________________________
+#
+# fn _filexist(_filepath)
+#
+# Test if file or path or drive specified in _filepath is exist.
+# If _filepath=="" then no action occured and return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+# Function returns _filepath if _filepath is exist. Otherwise
+# function return 0.
+#_____________________________________________________________________________
+#
+# fn _filenotexist(_filepath)
+#
+# Test if file or path or drive specified in _filepath is not exist.
+# If _filepath=="" then no action occured and return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+# Function returns 1 if _filepath is not exist. Otherwise function
+# return 0.
+#_____________________________________________________________________________
+#
+# fn _newdir(_filepath)
+#
+# Create path specified in root-dir-_filepath.
+# If _filepath=="" then no action occured and return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+# Function returns root-dir of _filepath.
+#_______________________________________________________________________
+#
+# fn _newdir(_filepath)
+#
+# Create path specified in root-dir-_filepath. If this folder
+# already exist then it will be completely cleared.
+# If _filepath=="" then no action occured and return "".
+# If some syntax error found in _filepath then function return ""
+# (and NO _filepath-cache-record will be created!).
+# Function returns root-dir of _filepath.
+#___________________________________________________________________________________
+#
+# fn _getmpfile(_filepath,_currfilepath)
+#
+# Return ....
+#
+#_____________________________________________________________________________
+#
+# fn _getmpdir(_filepath,_currfilepath)
+#
+# Return ...
+#
+#_____________________________________________________________________________
+#
+# Temporary files folder.
+#
+# Temporary files folder location is defined by _FILEIO_TMPRD.
+# If it wasn't been initialized before program run or not been initialized
+# by ENVIRON["TMPDIR"] then it will defined as the:
+# `current rootdir(stored in _FILEIO_RD)\programname.TMP'
+# In this case if its already exist then it will completely cleared when _FILEIO
+# library initialization processed.
+# And at the program uninitialization processed it will completely
+# cleared if _FILEIO_TMPCLRFLAG is true.
+#___________________________________________________________________________________
+#
+# var _FILEIO_RD (ENVIRON["CD"])
+#
+# This var can be set before running program. It can contain path which
+# will be used as default current dir while program run.
+# If this var is set before program runs - then it will be refreshed by the
+# _filerd it will be used as default current dir while program run.
+# If this var is not set before program runs - then ENVIRON["CD"] can also
+# set up default current dir while program run. If it set before program
+# begin then it will be refreshed by the _filerd - and also writed into
+# _FILEIO_RD.
+# If both _FILEIO_RD and ENVIRON["CD"] are not set before program begins
+# then real current root\dir will be writed into both _FILEIO_RD and
+# ENVIRON["CD"] and it will be used as default current dir while program run.
+#
+#___________________________________________________________________________________
+#
+# var _FILEIO_TMPRD (ENVIRON["TMPRD"])
+#
+# This var can be set before running program. It can contain path which
+# will be used as default temporary files root-folder while program run.
+# If this var is set before program runs - then it will be refreshed by the
+# _filerd - and also writed into ENVIRON["TMPRD"].
+# If this var is not set before program runs - then ENVIRON["TMPRD"] can also
+# set up default temporary files root-folder while program run. If it set
+# before program begin then it will be refreshed by the _filerd - and
+# also writed into _FILEIO_TMPRD.
+# If both _FILEIO_TMPRD and ENVIRON["TMPRD"] are not set before program begins
+# then new folder into path specified by the _FILEIO_RD(after its handling)
+# will be writed into both _FILEIO_TMPRD and ENVIRON["TMPRD"] and it
+# will be used as default temporary files root-folder while program run.
+#___________________________________________________________________________________
+#
+# var _FILEPATH
+#
+# This var contain filepath of working script. It should be setting up externally.
+#
+# var _gawk_scriptlevel
+#___________________________________________________________________________________
+####################################################################################
END {
if (_constatstrln > 0) {
_constat()
@@ -376,7 +704,6 @@ END {
#_______________________________________________________________________
function W(p, p0, p1)
{
- #####################################################
if (isarray(p0)) {
delete p0[p]
if (isarray(p1)) {
@@ -410,7 +737,6 @@ function W(p, p0, p1)
}
##########################################################
-
function _ARR(c, t, P)
{
switch (c) {
@@ -440,7 +766,6 @@ function _ARR(c, t, P)
}
##########################################################
-
function _BASE(c, t, P, A)
{
switch (c) {
@@ -494,7 +819,6 @@ function _BASE(c, t, P, A)
#____________________________________________________________________________
function _DS(c, t, P, a, A)
{
- ######################################################
switch (c) {
case "_lib_CMDLN":
#___________________________________________________________
@@ -520,12 +844,9 @@ function _DS(c, t, P, a, A)
#______________________________________________________________________________________________
function _END()
{
- #################################################################################
-
}
########################################################
-
function _ERRLOG(c, t, P, a, b, A)
{
switch (c) {
@@ -597,12 +918,9 @@ function _ERRLOG(c, t, P, a, b, A)
#______________________________________________________________________________________________
function _EXIT()
{
- ################################################################################
-
}
########################################################
-
function _EXTFN(c, t, P)
{
switch (c) {
@@ -632,7 +950,6 @@ function _EXTFN(c, t, P)
}
#######################################################
-
function _FILEIO(c, t, P, A)
{
switch (c) {
@@ -679,11 +996,9 @@ function _FILEIO(c, t, P, A)
}
}
-############################################################
#_____________________________________________________________________________
function _FILEVER(c, t, P, a, A)
{
- #################################################
switch (c) {
case "_lib_CMDLN":
#___________________________________________________________
@@ -720,13 +1035,10 @@ function _INIT(f)
#___________________________________________________________________________________
function _INITBASE()
{
- ################################################################
-
_egawk_utilpath = ENVIRON["EGAWK_PATH"] "BIN\\UTIL\\"
}
######################################################
-
function _INSTRUC(c, t, P)
{
switch (c) {
@@ -764,7 +1076,6 @@ function _INSTRUC(c, t, P)
#_____________________________________________________________________________
function _N(F, v, p)
{
- ###########################################################
for (p in _UIDS) {
delete _UIDS[p]
return _nN_i0(p, F, v)
@@ -773,7 +1084,6 @@ function _N(F, v, p)
}
#####################################################
-
function _SHORTCUT(c, t, P)
{
switch (c) {
@@ -805,7 +1115,6 @@ function _SHORTCUT(c, t, P)
#______________________________________________________________________________________________
function _START(t, i, A)
{
- #########################################################################
_torexp_init()
test_uid()
return
@@ -915,7 +1224,6 @@ function _START(t, i, A)
}
#########################################################
-
function _SYSIO(c, t, P)
{
switch (c) {
@@ -969,7 +1277,6 @@ function _W(p, A, v)
#_______________________________________________________________________
function _Zexparr(S, s, t, i)
{
- ##############################################
t = ""
if (isarray(S)) {
for (i in S) {
@@ -1021,7 +1328,6 @@ 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))
@@ -1072,7 +1378,6 @@ 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++) {
@@ -1147,7 +1452,6 @@ function _accmpu(A, a, n)
#_______________________________________________________________________
function _add(S, sf, D, df)
{
- ################################################
if (sf in S) {
if (isarray(S[sf])) {
if (df in D) {
@@ -1171,7 +1475,6 @@ function _add(S, sf, D, df)
#_________________________________________________________________
function _addarr(D, S)
{
- #############################################
if (isarray(S)) {
_addarr_i0(D, S)
}
@@ -1196,7 +1499,6 @@ function _addarr_i0(D, S, i)
#_______________________________________________________________________
function _addarrmask(D, S, M)
{
- #############################################
for (_addarrmaski0 in M) {
if (_addarrmaski0 in S) {
if (isarray(S[_addarrmaski0])) {
@@ -1229,14 +1531,12 @@ 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
@@ -1262,7 +1562,6 @@ function _addfile(f, d, a, b)
#_____________________________________________________________________________
function _addlib(f)
{
- ###########################################################
_addf(_LIBAPI, f)
}
@@ -1273,15 +1572,12 @@ function _addlib(f)
#_______________________________________________________________________
function _addlist(A, v)
{
- ##################################################
A[++A[0]] = v
}
-############################################
#_______________________________________________________________________
function _bearray(A)
{
- ####################################################
if (isarray(A) || A == 0 && A == "") {
return 1
}
@@ -1290,7 +1586,6 @@ function _bearray(A)
#_________________________________________________________________
function _bframe(A, t, p)
{
- ###########################################
return _bframe_i0(A, t, p, A[""])
}
@@ -1322,7 +1617,6 @@ 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) {
@@ -1391,7 +1685,6 @@ function _cfguidl(p, H, L, hi, h, hl, li)
#____________________________________________________________________________________________________
function _check(p)
{
- ####################################################################################
_dll_check(p)
_file_check(p)
_serv_check(p)
@@ -1401,14 +1694,12 @@ 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
@@ -1426,7 +1717,6 @@ function _cmd(c, i, A)
#_______________________________________________________________________
function _cmparr(A0, A1, R, a, i)
{
- ##########################################
a = 0
delete R
for (i in A0) {
@@ -1452,7 +1742,6 @@ 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
@@ -1494,7 +1783,6 @@ function _con(t, ts, a, b, c, d, i, r, A, B)
#_______________________________________________________________________
function _conin(t, a, b)
{
- #################################################
_constatpush()
_constat()
a = BINMODE
@@ -1516,14 +1804,12 @@ 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))
}
@@ -1540,7 +1826,6 @@ 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)
}
@@ -1577,7 +1862,6 @@ function _constatgtstr(t, ln, a, b)
#_______________________________________________________________________
function _constatpop()
{
- ##################################################
if (_CONSTATPUSH[0] > 0) {
return _constat(_CONSTATPUSH[_CONSTATPUSH[0]--])
}
@@ -1587,7 +1871,6 @@ function _constatpop()
#_______________________________________________________________________
function _constatpush(t, ts)
{
- #############################################
_CONSTATPUSH[++_CONSTATPUSH[0]] = _constatstr
if (t) {
_constat(t, ts)
@@ -1604,7 +1887,6 @@ 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
@@ -1613,7 +1895,6 @@ 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
@@ -1654,7 +1935,6 @@ 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 == "")) {
@@ -1666,14 +1946,12 @@ 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 == "")) {
@@ -1684,7 +1962,6 @@ 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
@@ -1694,7 +1971,6 @@ 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
@@ -1703,7 +1979,6 @@ 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")
@@ -1732,7 +2007,6 @@ function _del(f, c, a, A)
#_______________________________________________________________________
function _delay(t, a)
{
- ###################################################
for (a = 1; a <= t; a++) {
_delayms()
}
@@ -1741,7 +2015,6 @@ function _delay(t, a)
#_________________________________________________________________
function _delayms(a)
{
- #############################################
for (a = 1; a <= _delay_perfmsdelay; a++) {
}
}
@@ -1749,7 +2022,6 @@ function _delayms(a)
#_______________________________________________________________________
function _deletepfx(A, f, B, le, i)
{
- ########################################
le = length(f)
for (i in A) {
if (substr(toupper(i), 1, le) == f) {
@@ -1762,7 +2034,6 @@ 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]
@@ -1771,7 +2042,6 @@ function _delf(A, f)
#_______________________________________________________________________
function _deluid(p)
{
- ################################################# 1 #
if (p in _CLASSPTR) {
_deluida0 = _CLASSPTR[p]
if (_deluida0 in _UIDOBL) {
@@ -1785,7 +2055,6 @@ function _deluid(p)
#_______________________________________________________________________
function _dir(A, rd, i, r, f, ds, pf, B, C)
{
- ####################################
delete A
gsub(/(^[ \t]*)|([ \t]*$)/, "", rd)
if (rd == "") {
@@ -1815,7 +2084,6 @@ function _dir(A, rd, i, r, f, ds, pf, B, C)
#_________________________________________________________________
function _dirtree(A, f, B)
{
- #########################################
gsub(/(^[ \t]*)|([ \t]*$)/, "", f)
delete A
A[""]
@@ -1852,8 +2120,7 @@ function _dll_check(pp)
{
_dllchktv = ""
_missfl = 1
- _tframe("_dll_check_i0", pp, _REG, pp)
- #also check that all dll have same version; also check that all dlls have success and then report that DS plug-in version n - installed
+ _tframe("_dll_check_i0", pp, _REG, pp) #also check that all dll have same version; also check that all dlls have success and then report that DS plug-in version n - installed
if (1 || "AGENT" in _[pp]) {
if (_dllchktv != _[pp][".Product Version"]) {
_dllerr(_[pp]["AGENT"], "agent version (" _[pp][".Product Version"] ") do not match all lib versions: " _dllchktv "'")
@@ -1888,7 +2155,6 @@ 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"
@@ -1982,7 +2248,6 @@ function _drawuid(p, cn, ch, o)
#_______________________________________________________________________
function _dumparr(A, t, lv, a)
{
- ############################################
b = PROCINFO["sorted_in"]
PROCINFO["sorted_in"] = "_lengthsort"
if (isarray(A)) {
@@ -2047,7 +2312,6 @@ 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 " ")))
@@ -2115,14 +2379,12 @@ 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)
@@ -2134,7 +2396,6 @@ 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)
@@ -2174,7 +2435,6 @@ function _dumpval(v, n)
}
########################################################
-
function _eXTFN(c, t, P)
{
switch (c) {
@@ -2212,7 +2472,6 @@ function _endpass(t)
#_______________________________________________________________________
function _err(t, a, b)
{
- ###################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -2227,14 +2486,12 @@ 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
@@ -2245,14 +2502,12 @@ 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")
@@ -2264,7 +2519,6 @@ function _export_data(t, i, A)
#_____________________________________________________________________________
function _expout(t, d, a, b)
{
- ####################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -2287,8 +2541,6 @@ function _expout(t, d, a, b)
function _extfn_init()
{
- ##############################################################
-
_formatstrs_init()
_formatstrd_init()
_formatrexp_init()
@@ -2321,7 +2573,6 @@ function _faccr_i0(A, t, p, P, f, r)
#_______________________________________________________________________
function _fatal(t, d, A)
{
- #################################################
if (_ERRLOG_FF) {
A["TYPE"] = "FATAL"
A["TEXT"] = t
@@ -2352,11 +2603,9 @@ 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[""])
}
@@ -2369,7 +2618,6 @@ function _fframe_i0(A, t, p, f)
#_________________________________________________________________
function _file(f)
{
- #################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2418,7 +2666,6 @@ function _file_check_i0(p, pp, p1, p2, f, v)
#_________________________________________________________________
function _filed(f, dd, d)
{
- ##########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2443,7 +2690,6 @@ function _filed(f, dd, d)
#_________________________________________________________________
function _filen(f)
{
- ################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2453,7 +2699,6 @@ function _filen(f)
#_________________________________________________________________
function _filene(f)
{
- ###############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2463,7 +2708,6 @@ function _filene(f)
#_________________________________________________________________
function _filenotexist(f, a)
{
- ######################################
if (f == "") {
return ""
}
@@ -2481,7 +2725,6 @@ function _filenotexist(f, a)
#_______________________________________________________________________
function _filepath(f, dd)
{
- ################################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2491,7 +2734,6 @@ function _filepath(f, dd)
#_________________________________________________________________
function _filer(f, dd)
{
- #############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2507,7 +2749,6 @@ function _filer(f, dd)
#_________________________________________________________________
function _filerd(f, dd)
{
- ############################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2517,7 +2758,6 @@ function _filerd(f, dd)
#_________________________________________________________________
function _filerdn(f, dd)
{
- ###########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2527,7 +2767,6 @@ function _filerdn(f, dd)
#_________________________________________________________________
function _filerdne(f, dd)
{
- ##########################################
if ((f = _filerdnehnd(f)) == "") {
return ""
}
@@ -2598,7 +2837,6 @@ function _filerdnehnd(st, c, r, d, n, A)
#_______________________________________________________________________
function _filexist(f, a)
{
- ################################################
if (f == "") {
return ""
}
@@ -2617,7 +2855,6 @@ function _filexist(f, a)
#_______________________________________________________________________
function _fn(f, p0, p1, p2)
{
- ################################################
if (f in FUNCTAB) {
return @f(p0, p1, p2)
}
@@ -2626,7 +2863,6 @@ 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)
@@ -2695,7 +2931,6 @@ function _formatstrd_init()
_FORMATSTRDESC["\t"] = "\\t"
}
-#__________________________________________________________________________________
####################################################################################
@@ -2765,7 +3000,6 @@ 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))
}
@@ -2775,7 +3009,6 @@ function _gensubfn(t, r, f, p0, A)
#_____________________________________________________________________________
function _get_errout(p)
{
- #######################################################
return _tframe("_get_errout_i0", p)
}
@@ -2830,7 +3063,6 @@ function _get_errout_i3(p, t, ts, cl, cp, cr, a, b)
#_____________________________________________________________________________
function _get_logout(p)
{
- #######################################################
return _tframe("_get_logout_i0", p)
}
@@ -2854,7 +3086,6 @@ function _get_logout_i0(p, t, n, a)
#_______________________________________________________________________
function _getchrln(s, w)
{
- #################################################
if (s == "") {
return
}
@@ -2880,14 +3111,12 @@ 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
@@ -2906,7 +3135,6 @@ function _getfilepath(t, f, al, b, A)
function _getfilever(f)
{
- #############################################################
split(_cmd(_fileverpath " \"" f "\""), _GETFILEVERA0, /[ \t]+/)
if (_GETFILEVERA0[5]) {
return _GETFILEVERA0[5]
@@ -2916,14 +3144,12 @@ function _getfilever(f)
#_________________________________________________________________
function _getime()
{
- ################################################
return strftime("%H:%M:%S")
}
#_________________________________________________________________
function _getmpdir(f, dd)
{
- ##########################################
if (! dd || ! (dd = _filerd(dd))) {
dd = _FILEIO_TMPRD
}
@@ -2936,7 +3162,6 @@ function _getmpdir(f, dd)
#_________________________________________________________________
function _getmpfile(f, dd)
{
- #########################################
if (! dd || ! (dd = _filerd(dd))) {
dd = _FILEIO_TMPRD
}
@@ -2949,7 +3174,6 @@ 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)
@@ -3045,14 +3269,12 @@ 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
@@ -3063,7 +3285,6 @@ 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]
@@ -3096,7 +3317,6 @@ function _handle8494(t)
#_____________________________________________________________________________
function _hexnum(n, l)
{
- #########################################################
if (l + 0 < 1) {
l = 2
}
@@ -3106,7 +3326,6 @@ 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)
@@ -3137,7 +3356,6 @@ function _import_data(t, p, p2, a)
#_______________________________________________________________________
function _info(t, d, A)
{
- ##################################################
if (_ERRLOG_IF) {
A["TYPE"] = "INFO"
A["TEXT"] = t
@@ -3209,7 +3427,6 @@ function _initsys()
#_______________________________________________________________________
function _inituid(p, cs, dptr, pfx, sfx, hstr, lstr, A)
{
- ################### 1 #
if (cs == 0 && cs == "") {
cs = p
p = _getuid()
@@ -3271,7 +3488,6 @@ function _inituidefault(h, l, H, L)
#_______________________________________________________________________
function _ins(S, sf, D, df)
{
- ################################################
if (sf in S) {
if (isarray(S[sf])) {
if (df in D) {
@@ -3295,19 +3511,16 @@ 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)
{
@@ -3320,7 +3533,6 @@ function _inspass(A, f)
#_______________________________________________________________________
function _isptr(p)
{
- ################################################## 1 #
if (isarray(p)) {
is = _NOP
it = "A"
@@ -3341,7 +3553,6 @@ function _isptr(p)
#_______________________________________________________________________
function _istr(p)
{
- ################################################### 1 #
if (isarray(p)) {
is = _NOP
it = "A"
@@ -3358,7 +3569,6 @@ function _istr(p)
#_________________________________________________________________
function _lengthsort(i1, v1, i2, v2)
{
- ##############################
return ((length(i1) < length(i2) ? -1 : (length(i1) > length(i2) ? 1 : (i1 < i2 ? -1 : 1))))
}
@@ -3401,14 +3611,12 @@ 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()
@@ -3429,7 +3637,6 @@ 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)
@@ -3471,7 +3678,6 @@ function _macsfx94(F, D, C, p1, p2, p3)
#_______________________________________________________________________
function _movarr(D, S)
{
- ###################################################
delete D
D[""]
delete D[""]
@@ -3589,7 +3795,6 @@ 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]
@@ -3652,7 +3857,6 @@ function _nN_i0(p, F, v)
#_________________________________________________________________
function _newclrdir(f)
{
- ############################################
if ((f = _filerd(f)) == "") {
return
}
@@ -3665,7 +3869,6 @@ function _newclrdir(f)
#_______________________________________________________________________
function _newdir(f)
{
- #####################################################
if ((f = _filerd(f)) == "") {
return
}
@@ -3676,7 +3879,6 @@ function _newdir(f)
return f
}
-##############################
#_______________________________________________________________________
function _nop(p0, p1, p2, p3)
{
@@ -3700,7 +3902,6 @@ 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]
@@ -3720,7 +3921,6 @@ 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]
@@ -3745,7 +3945,6 @@ function _nretarrd(A, i, v, r, q)
#___________________________________________________________________________________
function _out(t, a, b)
{
- ###############################################################
a = BINMODE
b = ORS
BINMODE = "rw"
@@ -3760,7 +3959,6 @@ function _out(t, a, b)
#_________________________________________________________________
function _outnl(t)
{
- ################################################
return _out(t ((t ~ /\x0A$/ ? "" : _CHR["EOL"])))
}
@@ -3815,7 +4013,6 @@ 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
@@ -3838,7 +4035,6 @@ 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]))) {
@@ -3927,9 +4123,6 @@ function _patharr0_i1(D, A, i, q, t, c)
}
#############################################################################
-
-
-
function _pmap(m, s1, s2, s3, s4, s5, s6, s7, s8)
{
if (match(m, /^([^\(]+)\(([^\)]*)\)$/, _QMAP)) {
@@ -3988,7 +4181,6 @@ 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 : "")
@@ -4094,7 +4286,6 @@ 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
@@ -4105,17 +4296,14 @@ 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":
#___________________________________________________________
@@ -4141,7 +4329,6 @@ function _rEG(c, t, P, a, A)
#_______________________________________________________________________
function _rFBRO(p)
{
- ######################################################
if (p) {
if (p in _tPARENT) {
return _tFCHLD[_tPARENT[p]]
@@ -4157,18 +4344,15 @@ function _rFBRO(p)
#_______________________________________________________________________
function _rFCHLD(p)
{
- #####################################################
if (p && p in _tFCHLD) {
return _tFCHLD[p]
}
return ""
}
-######################## p="", !v
#_______________________________________________________________________
function _rLBRO(p)
{
- ######################################################
if (p) {
if (p in _tPARENT) {
return _tLCHLD[_tPARENT[p]]
@@ -4181,11 +4365,9 @@ function _rLBRO(p)
return p
}
-######################## p=""
#_______________________________________________________________________
function _rLCHLD(p)
{
- #####################################################
if (p && p in _tLCHLD) {
return _tLCHLD[p]
}
@@ -4195,48 +4377,39 @@ function _rLCHLD(p)
#_______________________________________________________________________
function _rLINK(p)
{
- ######################################################
return ((p in _tLINK ? _tLINK[p] : ""))
}
-######################## p=""
#_______________________________________________________________________
function _rNEXT(p)
{
- ######################################################
if (p && p in _tNEXT) {
return _tNEXT[p]
}
return ""
}
-######################## p=""
#_______________________________________________________________________
function _rPARENT(p)
{
- ####################################################
if (p && p in _tPARENT) {
return _tPARENT[p]
}
return ""
}
-######################## p=""
#_______________________________________________________________________
function _rPREV(p)
{
- ######################################################
if (p && p in _tPREV) {
return _tPREV[p]
}
return ""
}
-######################## p=""
#_______________________________________________________________________
function _rQBRO(p, c, p1)
{
- ################################################
if (p) {
if (p in _tPARENT) {
return _tQCHLD[_tPARENT[p]]
@@ -4256,11 +4429,9 @@ function _rQBRO(p, c, p1)
return p
}
-######################## p=""
#_______________________________________________________________________
function _rQCHLD(p)
{
- #####################################################
if (p && p in _tQCHLD) {
return _tQCHLD[p]
}
@@ -4273,7 +4444,6 @@ function _rQCHLD(p)
#_____________________________________________________________________________
function _rSQFIRST(g, p, A)
{
- #####################################################
if (isarray(A)) {
return _rSQFIRSTA(g, p, A)
}
@@ -4285,7 +4455,6 @@ function _rSQFIRST(g, p, A)
#_________________________________________________________________
function _rSQFIRSTA(g, p, A)
{
- ########################################
_SQTOPTR[g] = p
_SQSTACK[g][0] = 0
if ((p = _rsqgetptr(g, p)) in A) {
@@ -4297,7 +4466,6 @@ function _rSQFIRSTA(g, p, A)
#_______________________________________________________________________
function _rSQNEXT(g, p, A)
{
- ################################################
if (isarray(A)) {
return _rSQNEXTA(g, p, A)
}
@@ -4307,7 +4475,6 @@ 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]--]
@@ -4353,7 +4520,6 @@ function _rd_shortcut(D, f)
#_______________________________________________________________________
function _rdfile(f, i, A)
{
- ################################################
if ((f = _filerdne(f)) == "" || _filene(f) == "") {
ERRNO = "Filename error"
return
@@ -4406,7 +4572,6 @@ 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/)
@@ -4545,7 +4710,6 @@ function _registryinit()
#_____________________________________________________________________________
function _regpath0(D, i, s, q, S)
{
- ############################################ 0 #
if (i = _patharr0(S, i)) {
if ("name" in S) {
D["name"] = S["name"]
@@ -4569,7 +4733,6 @@ function _regpath0(D, i, s, q, S)
#_________________________________________________________________________________________
function _report(p)
{
- #######################################################################
_report_t0 = _reportparnt = ""
_report_i0(p)
_tframe("_report_i0", p)
@@ -4667,7 +4830,6 @@ 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
@@ -4691,7 +4853,6 @@ 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)))
}
@@ -4729,7 +4890,6 @@ function _rexpfnend(t)
#_____________________________________________________________________________
function _rexpstr(r, i, c, A)
{
- ###################################################
c = split(r, A, "")
r = ""
for (i = 1; i <= c; i++) {
@@ -4771,7 +4931,6 @@ 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()
}
@@ -4889,11 +5048,9 @@ function _rxpfn(R, t, p, i, f, A)
return _rexpfnend(t)
}
-##############################################################
#_____________________________________________________________________________
function _sHARE(c, t, P, a, A)
{
- ###################################################
switch (c) {
case "_lib_CMDLN":
#___________________________________________________________
@@ -4916,11 +5073,9 @@ function _sHARE(c, t, P, a, A)
}
}
-################################################################
#_____________________________________________________________________________
function _sYS(c, t, P, a, A)
{
- #####################################################
switch (c) {
case "_lib_CMDLN":
#___________________________________________________________
@@ -4967,7 +5122,6 @@ 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"]
@@ -4980,7 +5134,6 @@ function _setarrsort(f, a)
#_______________________________________________________________________
function _setmpath(p, a)
{
- ################################################
ERRNO = ""
if (p && (a = _filerd(p))) {
if (_FILEIO_TMPRD) {
@@ -5018,7 +5171,6 @@ 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/)) {
@@ -5038,7 +5190,6 @@ 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])
@@ -5048,17 +5199,14 @@ function _sharepath(h, s, A)
function _shortcut(D, S)
{
- #############################################################
if (isarray(D)) {
if (isarray(S)) {
_addarrmask(D, S, _SHORTCUTWSTRUC)
} else {
if (S == 0 && S == "") {
- # array,array2* - copy from array2 to array shorcut-specific elements
_addarrmask(D, _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
} else {
if (_isnotfileptr(S)) {
- # array* - define shortcut-specific elements in array by default values
_addarrmask(D, _[S], _SHORTCUTWSTRUC)
} else {
if (_rd_shortcut(D, S)) {
@@ -5067,22 +5215,18 @@ function _shortcut(D, S)
}
}
}
- # array,ptr* - copy from array _[ptr] to array shorcut-specific elements
} else {
if (D == 0 && D == "") {
return _NOP
} else {
if (_isnotfileptr(D)) {
- # -* - no action(return -)
if (isarray(S)) {
_addarrmask(_[D], S, _SHORTCUTWSTRUC)
} else {
if (S == 0 && S == "") {
- # ptr,array* - copy from array to array _[ptr] shorcut-specific elements
_addarrmask(_[D], _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
} else {
if (_isnotfileptr(S)) {
- # ptr* - define shortcut-specifc elements in array _[ptr] by default values
_addarrmask(_[D], _[S], _SHORTCUTWSTRUC)
} else {
if (_rd_shortcut(_[D], S)) {
@@ -5091,9 +5235,7 @@ function _shortcut(D, S)
}
}
}
- # ptr,ptr2* - copy from array _[ptr2] to array _[ptr] shorcut-specific elements
} else {
- # ptr,filepath* - define in array _[ptr] shortcut-specific elements by reading its from shortcut file filepath(load shortcut)
if (isarray(S) && _wr_shortcut(D, S)) {
return
} else {
@@ -5109,11 +5251,9 @@ function _shortcut(D, S)
}
}
}
- # filepath,ptr* - [over]write shorcut file filepath; shortcut parameters will be defined by shortcut-specific elements in array _[ptr](save shortcut)
}
}
}
- # filepath,filepath2* - [over]write shorcut file filepath; shortcut parameters will be defined from shortcut file filepath2(copy shortcut)
return 1
}
@@ -5299,7 +5439,6 @@ function _splitpath_test()
#_______________________________________________________________________
function _splitstr(A, t, r)
{
- ########################################### 1 #
if (_istr(t)) {
if (_splitstr_i0(A, t) > 0) {
return _splitstrp0
@@ -5475,7 +5614,6 @@ 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
@@ -5488,7 +5626,6 @@ function _sysinfo(D, h)
}
#########################################################
-
function _tOBJ(c, t, P)
{
switch (c) {
@@ -5519,7 +5656,6 @@ function _tOBJ(c, t, P)
#_______________________________________________________________________
function _tOBJ_CLEANUP(p)
{
- ##############################################
for (p in UIDSDEL) {
delete _ptr[p]
delete _tPREV[p]
@@ -5538,7 +5674,6 @@ function _tOBJ_CLEANUP(p)
#_______________________________________________________________________
function _tabtospc(t, ts, xc, a, c, n, A, B)
{
- ##################################
if (! ts) {
ts = _TAB_STEP_DEFAULT
}
@@ -5575,7 +5710,6 @@ 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]
@@ -5594,7 +5728,6 @@ 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]
@@ -5613,7 +5746,6 @@ 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]
@@ -5632,7 +5764,6 @@ 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]
@@ -5651,7 +5782,6 @@ function _tbpassx_i0(f, p, p0, p1)
#_____________________________________________________________________________
function _tbrochld(p, f, pp)
{
- ################################################### # TEST!!!
if (p) {
if (p in _tFCHLD) {
f = _tFCHLD[p]
@@ -5743,35 +5873,30 @@ 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]) {
@@ -5833,7 +5958,6 @@ function _tdel_i1(A, i)
#_____________________________________________________________________________
function _tdelete(p, v)
{
- ####################################################### # REMAKE EXCLUDE
if (p) {
_wLCHLD(_tDELPTR, p)
}
@@ -5843,7 +5967,6 @@ 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)
@@ -5856,7 +5979,6 @@ function _tdelitem(p)
#_______________________________________________________________________
function _tend(a, b)
{
- #####################################################
if (b == "") {
return (_t_ENDF[_t_ENDF[0]] = a)
} else {
@@ -5867,7 +5989,6 @@ function _tend(a, b)
#_____________________________________________________________________________
function _texclude(p, v, pp)
{
- ################################################### # TEST!!!
if (p in _) {
if (p in _tPARENT) {
pp = _tPARENT[p]
@@ -5916,7 +6037,6 @@ 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]
@@ -5926,7 +6046,6 @@ 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)
@@ -5993,7 +6112,6 @@ 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)
@@ -6049,7 +6167,6 @@ 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)
@@ -6105,7 +6222,6 @@ 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)
@@ -6161,7 +6277,6 @@ 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)
@@ -6235,7 +6350,6 @@ 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]
@@ -6347,7 +6461,6 @@ 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]
@@ -6366,7 +6479,6 @@ function _tgetitem(p, n, a, b)
#_________________________________________________________________
function _tgetsp(p)
{
- ###############################################
return _tSTACK[p][0]
}
@@ -6378,28 +6490,24 @@ 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)
{
@@ -6409,7 +6517,6 @@ function _th3(p0, p1, p2, r)
#_________________________________________________________________
function _tifend(l)
{
- ###############################################
return ((_t_ENDF[0] + l in _t_ENDF ? (_t_ENDF[_t_ENDF[0] + l] ? _t_ENDF[_t_ENDF[0] + l] : 1) : ""))
}
@@ -6579,7 +6686,6 @@ 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] : ""))
}
@@ -6589,7 +6695,6 @@ 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] : "")
@@ -6600,7 +6705,6 @@ 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] : ""))
}
@@ -6610,7 +6714,6 @@ 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] : "")
@@ -6621,7 +6724,6 @@ 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]
@@ -6649,7 +6751,6 @@ 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] : "")
@@ -6660,7 +6761,6 @@ 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] : ""))
}
@@ -6670,7 +6770,6 @@ 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] : "")
@@ -6714,7 +6813,6 @@ 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]
@@ -6733,7 +6831,6 @@ 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]
@@ -6752,7 +6849,6 @@ 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])) {
@@ -6768,7 +6864,6 @@ function _tpop(p, aA, a)
#_____________________________________________________________________________
function _tpush(p, aA, a)
{
- ######################################################
if (isarray(aA)) {
delete _tSTACK[p][a = ++_tSTACK[p][0]]
_tSTACK[p][a][""]
@@ -6807,7 +6902,6 @@ function _tr(n, cs, H)
#_______________________________________________________________________
function _trace(t, d, A)
{
- #################################################
if (_ERRLOG_TF) {
A["TYPE"] = "TRACE"
A["TEXT"] = t
@@ -6818,7 +6912,6 @@ function _trace(t, d, A)
#_________________________________________________________________
function _trunframe(f, p, p0, p1, p2)
{
- #################################
return _tframe((f ? f : "_trunframe_i0"), p, p0, p1, p2)
}
@@ -6834,28 +6927,24 @@ 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)
}
@@ -7036,7 +7125,6 @@ function _typa(p, A)
#_______________________________________________________________________
function _tzend(a, b)
{
- #####################################################
if (b == 0 && b == "") {
return (_TEND[_TEND[_ARRLEN]] = a)
} else {
@@ -7176,7 +7264,6 @@ function _unstr(t)
#_________________________________________________________________
function _untmp(f, a)
{
- #############################################
if (f = filepath(f)) {
if (match(f, /\\$/)) {
_deletepfx(_FILEIO_RDTMP, a = toupper(f))
@@ -7228,7 +7315,6 @@ function _var(v, t)
#_______________________________________________________________________
function _verb(t, d, A)
{
- ##################################################
if (_ERRLOG_VF) {
A["TYPE"] = "VERB"
A["TEXT"] = t
@@ -7239,7 +7325,6 @@ function _verb(t, d, A)
#_________________________________________________________________
function _wFBRO(p, v, a)
{
- ###########################################
if (p) {
if (v) {
for (a = p; a in _tPARENT; ) {
@@ -7247,7 +7332,6 @@ function _wFBRO(p, v, a)
return v
}
}
- ######################## v is parentesis of p
if (p in _tPARENT) {
p = _tPARENT[p]
if (v in _tNEXT) {
@@ -7346,19 +7430,15 @@ function _wFBRO(p, v, a)
if (v == 0) {
return v
}
- ######################## p=ptr, v=0
return v
}
} else {
- ######################## p=ptr, v=""
if (p == 0) {
return v
}
- ######################## p=0
if (v) {
return _texclude(v)
}
- ######################## p="", v=ptr - exclude v
return v
}
}
@@ -7366,19 +7446,16 @@ 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]
@@ -7438,7 +7515,6 @@ function _wFCHLD(p, v, a)
} else {
if (v == 0) {
if (p in _tFCHLD) {
- ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -7451,11 +7527,9 @@ function _wFCHLD(p, v, a)
return v
}
} else {
- ######################## p=ptr, v="" > ignore action
if (p == 0) {
return v
}
- ######################## p=0
return v
}
}
@@ -7463,7 +7537,6 @@ function _wFCHLD(p, v, a)
#_________________________________________________________________
function _wLBRO(p, v, a)
{
- ###########################################
if (p) {
if (v) {
for (a = p; a in _tPARENT; ) {
@@ -7471,7 +7544,6 @@ function _wLBRO(p, v, a)
return v
}
}
- ######################## v is parentesis of p
if (p in _tPARENT) {
p = _tPARENT[p]
if (v in _tPREV) {
@@ -7570,19 +7642,15 @@ function _wLBRO(p, v, a)
if (v == 0) {
return v
}
- ######################## p=ptr, v=0
return v
}
} else {
- ######################## p=ptr, v=""
if (p == 0) {
return v
}
- ######################## p=0
if (v) {
return _texclude(v)
}
- ######################## p="", v=ptr - exclude v
return v
}
}
@@ -7590,19 +7658,16 @@ 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]
@@ -7662,7 +7727,6 @@ function _wLCHLD(p, v, a)
} else {
if (v == 0) {
if (p in _tFCHLD) {
- ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -7675,11 +7739,9 @@ function _wLCHLD(p, v, a)
return v
}
} else {
- ######################## p=ptr, v="" > ignore action
if (p == 0) {
return v
}
- ######################## p=0
return v
}
}
@@ -7687,26 +7749,22 @@ 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
@@ -7759,19 +7817,15 @@ function _wNEXT(p, v, a, b)
if (v == 0) {
return v
}
- ######################## p=ptr, v=0
return v
}
} else {
- ######################## p=ptr, v=""
if (p == 0) {
return v
}
- ######################## p=0
if (v) {
return _texclude(v)
}
- ######################## p="", v=ptr - exclude v
return v
}
}
@@ -7779,26 +7833,22 @@ 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
@@ -7851,19 +7901,15 @@ function _wPREV(p, v, a, b)
if (v == 0) {
return v
}
- ######################## p=ptr, v=0
return v
}
} else {
- ######################## p=ptr, v=""
if (p == 0) {
return v
}
- ######################## p=0
if (v) {
return _texclude(v)
}
- ######################## p="", v=ptr - exclude v
return v
}
}
@@ -7871,21 +7917,17 @@ function _wPREV(p, v, a, b)
#_________________________________________________________________
function _wQBRO(p, v)
{
- ##############################################
return v
}
#_________________________________________________________________
function _wQCHLD(p, v)
{
- #############################################
if (p) {
if (v) {
} else {
- ######################## p=ptr, v=ptr
if (v == 0) {
if (p in _tFCHLD) {
- ######################## p=ptr, v=0 > delete all chld
v = _tFCHLD[p]
delete _tFCHLD[p]
delete _tLCHLD[p]
@@ -7898,11 +7940,9 @@ function _wQCHLD(p, v)
return v
}
} else {
- ######################## p=ptr, v="" > ignore action
if (p == 0) {
return v
}
- ######################## p=0
return v
}
}
@@ -7910,7 +7950,6 @@ function _wQCHLD(p, v)
#_______________________________________________________________________
function _warning(t, d, A)
{
- ###############################################
if (_ERRLOG_WF) {
A["TYPE"] = "WARNING"
A["TEXT"] = t
@@ -7962,7 +8001,6 @@ function _wr_shortcut(f, S)
#_________________________________________________________________
function _wrfile(f, d, a, b)
{
- #########################################
if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") {
ERRNO = "Filename error"
return
@@ -7988,7 +8026,6 @@ function _wrfile(f, d, a, b)
#___________________________________________________________
function _wrfile1(f, d, a, b)
{
- ##################################
if ((f = _wfilerdnehnd(f)) == "" || _filene(f) == "") {
ERRNO = "Filename error"
return
@@ -8014,7 +8051,6 @@ function _wrfile1(f, d, a, b)
#_______________________________________________________________________
function _yexport(p)
{
- #####################################################
return _tframe("_yexport_i0", p)
}
@@ -8035,7 +8071,6 @@ function _yexport_i0(p, p0, p1, p2)
#_________________________________________________________________
function cmp_str_idx(i1, v1, i2, v2)
{
- ##############################
return ((i1 < i2 ? -1 : 1))
}
@@ -8190,7 +8225,6 @@ function hujf(a, b, c)
#___________________________________________________________
function ncmp_str_idx(i1, v1, i2, v2)
{
- #######################
return ((i1 < i2 ? 1 : -1))
}
@@ -8317,5 +8351,4 @@ function zorr(A, i, r)
#_____________________________________________________________________________
function zzer()
{
- ################################################################
}