aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--profile.c108
-rw-r--r--test/ChangeLog4
-rw-r--r--test/profile2.ok154
-rw-r--r--test/profile5.ok648
5 files changed, 406 insertions, 518 deletions
diff --git a/ChangeLog b/ChangeLog
index 57db1c0e..3309d36e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2016-02-18 Arnold D. Robbins <arnold@skeeve.com>
+
+ Fix profile / pretty-printing to chain else-ifs.
+
+ * profile.c (pprint): Change third argument into a set of flags
+ for in the for header or in an else if. Adjust case Op_K_else to
+ make the right checks and format the code properly. In Op_K_if
+ clear the flag so that any following else gets indented properly.
+ Adjust all calls.
+
2016-02-14 Arnold D. Robbins <arnold@skeeve.com>
* README, NEWS: Updated to reflect use of Texinfo 6.1.
diff --git a/profile.c b/profile.c
index dc89d006..3d0b1cbc 100644
--- a/profile.c
+++ b/profile.c
@@ -25,7 +25,7 @@
#include "awk.h"
-static void pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header);
+static void pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags);
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);
@@ -57,9 +57,12 @@ static FILE *prof_fp; /* where to send the profile */
static long indent_level = 0;
-
#define SPACEOVER 0
+#define NO_PPRINT_FLAGS 0
+#define IN_FOR_HEADER 1
+#define IN_ELSE_IF 2
+
/* set_prof_file --- set the output file for profiling or pretty-printing */
void
@@ -187,7 +190,7 @@ pp_free(NODE *n)
/* pprint --- pretty print a program segment */
static void
-pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header)
+pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
{
INSTRUCTION *pc;
NODE *t1;
@@ -219,7 +222,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header)
ip = pc->nexti;
indent(ip->exec_count);
if (ip != (pc + 1)->firsti) { /* non-empty pattern */
- pprint(ip->nexti, (pc + 1)->firsti, false);
+ pprint(ip->nexti, (pc + 1)->firsti, NO_PPRINT_FLAGS);
t1 = pp_pop();
fprintf(prof_fp, "%s {", t1->pp_str);
pp_free(t1);
@@ -236,7 +239,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header)
ip = ip->nexti;
}
indent_in();
- pprint(ip, (pc + 1)->lasti, false);
+ pprint(ip, (pc + 1)->lasti, NO_PPRINT_FLAGS);
indent_out();
fprintf(prof_fp, "\t}\n\n");
pc = (pc + 1)->lasti;
@@ -322,7 +325,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header)
cleanup:
pp_free(t2);
pp_free(t1);
- if (! in_for_header)
+ if ((flags & IN_FOR_HEADER) == 0)
fprintf(prof_fp, "\n");
break;
@@ -344,7 +347,7 @@ cleanup:
case Op_and:
case Op_or:
- pprint(pc->nexti, pc->target_jmp, in_for_header);
+ pprint(pc->nexti, pc->target_jmp, flags);
t2 = pp_pop();
t1 = pp_pop();
parenthesize(pc->opcode, t1, t2);
@@ -448,7 +451,7 @@ cleanup:
fprintf(prof_fp, "$%s%s%s", t1->pp_str, op2str(pc->opcode), t2->pp_str);
pp_free(t2);
pp_free(t1);
- if (! in_for_header)
+ if ((flags & IN_FOR_HEADER) == 0)
fprintf(prof_fp, "\n");
break;
@@ -469,7 +472,7 @@ cleanup:
efree(sub);
} else
fprintf(prof_fp, "%s %s", op2str(Op_K_delete), array);
- if (! in_for_header)
+ if ((flags & IN_FOR_HEADER) == 0)
fprintf(prof_fp, "\n");
pp_free(t1);
}
@@ -581,7 +584,7 @@ cleanup:
} else
fprintf(prof_fp, "%s%s", op2str(pc->opcode), tmp);
efree(tmp);
- if (! in_for_header)
+ if ((flags & IN_FOR_HEADER) == 0)
fprintf(prof_fp, "\n");
break;
@@ -699,15 +702,15 @@ cleanup:
case Op_pop:
t1 = pp_pop();
fprintf(prof_fp, "%s", t1->pp_str);
- if (! in_for_header)
+ if ((flags & IN_FOR_HEADER) == 0)
fprintf(prof_fp, "\n");
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);
+ pprint(pc->nexti, ip->condpair_left, NO_PPRINT_FLAGS);
+ pprint(ip->condpair_left->nexti, ip->condpair_right, NO_PPRINT_FLAGS);
t2 = pp_pop();
t1 = pp_pop();
str = pp_group3(t1->pp_str, ", ", t2->pp_str);
@@ -721,12 +724,12 @@ cleanup:
ip = pc + 1;
indent(ip->while_body->exec_count);
fprintf(prof_fp, "%s (", op2str(pc->opcode));
- pprint(pc->nexti, ip->while_body, false);
+ pprint(pc->nexti, ip->while_body, NO_PPRINT_FLAGS);
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(ip->while_body->nexti, pc->target_break, NO_PPRINT_FLAGS);
indent_out();
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
@@ -738,9 +741,9 @@ cleanup:
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, ip->doloop_cond, NO_PPRINT_FLAGS);
indent_out();
- pprint(ip->doloop_cond, pc->target_break, false);
+ pprint(ip->doloop_cond, pc->target_break, NO_PPRINT_FLAGS);
indent(SPACEOVER);
t1 = pp_pop();
fprintf(prof_fp, "} %s (%s)\n", op2str(Op_K_while), t1->pp_str);
@@ -759,24 +762,24 @@ cleanup:
&& pc->target_continue->opcode == Op_jmp) {
fprintf(prof_fp, ";;");
} else {
- pprint(pc->nexti, ip->forloop_cond, true);
+ pprint(pc->nexti, ip->forloop_cond, IN_FOR_HEADER);
fprintf(prof_fp, "; ");
if (ip->forloop_cond->opcode == Op_no_op &&
ip->forloop_cond->nexti == ip->forloop_body)
fprintf(prof_fp, "; ");
else {
- pprint(ip->forloop_cond, ip->forloop_body, true);
+ pprint(ip->forloop_cond, ip->forloop_body, IN_FOR_HEADER);
t1 = pp_pop();
fprintf(prof_fp, "%s; ", t1->pp_str);
pp_free(t1);
}
- pprint(pc->target_continue, pc->target_break, true);
+ pprint(pc->target_continue, pc->target_break, IN_FOR_HEADER);
}
fprintf(prof_fp, ") {\n");
indent_in();
- pprint(ip->forloop_body->nexti, pc->target_continue, false);
+ pprint(ip->forloop_body->nexti, pc->target_continue, NO_PPRINT_FLAGS);
indent_out();
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
@@ -801,7 +804,7 @@ cleanup:
item, op2str(Op_in_array), array);
indent_in();
pp_free(t1);
- pprint(ip->forloop_body->nexti, pc->target_break, false);
+ pprint(ip->forloop_body->nexti, pc->target_break, NO_PPRINT_FLAGS);
indent_out();
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
@@ -812,11 +815,11 @@ cleanup:
case Op_K_switch:
ip = pc + 1;
fprintf(prof_fp, "%s (", op2str(pc->opcode));
- pprint(pc->nexti, ip->switch_start, false);
+ pprint(pc->nexti, ip->switch_start, NO_PPRINT_FLAGS);
t1 = pp_pop();
fprintf(prof_fp, "%s) {\n", t1->pp_str);
pp_free(t1);
- pprint(ip->switch_start, ip->switch_end, false);
+ pprint(ip->switch_start, ip->switch_end, NO_PPRINT_FLAGS);
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
pc = pc->target_break;
@@ -832,13 +835,13 @@ cleanup:
} else
fprintf(prof_fp, "%s:\n", op2str(pc->opcode));
indent_in();
- pprint(pc->stmt_start->nexti, pc->stmt_end->nexti, false);
+ pprint(pc->stmt_start->nexti, pc->stmt_end->nexti, NO_PPRINT_FLAGS);
indent_out();
break;
case Op_K_if:
fprintf(prof_fp, "%s (", op2str(pc->opcode));
- pprint(pc->nexti, pc->branch_if, false);
+ pprint(pc->nexti, pc->branch_if, NO_PPRINT_FLAGS);
t1 = pp_pop();
fprintf(prof_fp, "%s) {", t1->pp_str);
pp_free(t1);
@@ -848,22 +851,47 @@ cleanup:
fprintf(prof_fp, " # %ld", ip->exec_count);
fprintf(prof_fp, "\n");
indent_in();
- pprint(ip->nexti, pc->branch_else, false);
+ pprint(ip->nexti, pc->branch_else, NO_PPRINT_FLAGS);
indent_out();
pc = pc->branch_else;
- if (pc->nexti->opcode == Op_no_op) {
+ if (pc->nexti->opcode == Op_no_op) { /* no following else */
indent(SPACEOVER);
fprintf(prof_fp, "}\n");
}
+ /*
+ * See next case; turn off the flag so that the
+ * following else is correctly indented.
+ */
+ flags &= ~IN_ELSE_IF;
break;
case Op_K_else:
- fprintf(prof_fp, "} %s {\n", op2str(pc->opcode));
- indent_in();
- pprint(pc->nexti, pc->branch_end, false);
- indent_out();
- indent(SPACEOVER);
- fprintf(prof_fp, "}\n");
+ /*
+ * If possible, chain else-if's together on the
+ * same line.
+ *
+ * See awkgram.y:mk_condition to understand
+ * what is being checked here.
+ *
+ * Op_exec_count follows Op_K_else, check the
+ * opcode of the following instruction.
+ * Additionally, check that the subsequent if
+ * terminates where this else does; in that case
+ * it's ok to compact the if to follow the else.
+ */
+
+ fprintf(prof_fp, "} %s ", op2str(pc->opcode));
+ if (pc->nexti->nexti->opcode == Op_K_if
+ && pc->branch_end == pc->nexti->nexti->branch_else->lasti) {
+ pprint(pc->nexti, pc->branch_end, IN_ELSE_IF);
+ } else {
+ fprintf(prof_fp, "{\n", op2str(pc->opcode));
+ indent_in();
+ pprint(pc->nexti, pc->branch_end, NO_PPRINT_FLAGS);
+ indent_out();
+ indent(SPACEOVER);
+ fprintf(prof_fp, "}\n");
+ }
pc = pc->branch_end;
break;
@@ -872,14 +900,14 @@ cleanup:
NODE *f, *t, *cond;
size_t len;
- pprint(pc->nexti, pc->branch_if, false);
+ pprint(pc->nexti, pc->branch_if, NO_PPRINT_FLAGS);
ip = pc->branch_if;
- pprint(ip->nexti, pc->branch_else, false);
+ pprint(ip->nexti, pc->branch_else, NO_PPRINT_FLAGS);
ip = pc->branch_else->nexti;
pc = ip->nexti;
assert(pc->opcode == Op_cond_exp);
- pprint(pc->nexti, pc->branch_end, false);
+ pprint(pc->nexti, pc->branch_end, NO_PPRINT_FLAGS);
f = pp_pop();
t = pp_pop();
@@ -898,7 +926,7 @@ cleanup:
break;
case Op_exec_count:
- if (! in_for_header)
+ if (flags == NO_PPRINT_FLAGS)
indent(pc->exec_count);
break;
@@ -1000,7 +1028,7 @@ dump_prog(INSTRUCTION *code)
/* \n on purpose, with \n in ctime() output */
fprintf(prof_fp, _("\t# gawk profile, created %s\n"), ctime(& now));
print_lib_list(prof_fp);
- pprint(code, NULL, false);
+ pprint(code, NULL, NO_PPRINT_FLAGS);
}
/* prec_level --- return the precedence of an operator, for paren tests */
@@ -1579,7 +1607,7 @@ pp_func(INSTRUCTION *pc, void *data ATTRIBUTE_UNUSED)
}
fprintf(prof_fp, ")\n\t{\n");
indent_in();
- pprint(pc->nexti->nexti, NULL, false); /* function body */
+ pprint(pc->nexti->nexti, NULL, NO_PPRINT_FLAGS); /* function body */
indent_out();
fprintf(prof_fp, "\t}\n");
return 0;
diff --git a/test/ChangeLog b/test/ChangeLog
index 56edb8f2..05f8e937 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2016-02-18 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile2.ok, profile5.ok: Adjust after code changes.
+
2016-01-14 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (aryprm9): New test.
diff --git a/test/profile2.ok b/test/profile2.ok
index 938d6858..1db4c2f0 100644
--- a/test/profile2.ok
+++ b/test/profile2.ok
@@ -12,62 +12,46 @@
571 nextstate = substr(machine[state symb], 1, 1)
571 act = substr(machine[state symb], 2, 1)
571 if (act == "0") { # 12
- 559 } else {
- 559 if (act == "1") { # 8
- 8 if (! inarray(tok, names)) { # 3
- 3 names[++nnames] = tok
+ 559 } else if (act == "1") { # 8
+ 8 if (! inarray(tok, names)) { # 3
+ 3 names[++nnames] = tok
+ }
+ 8 lines[tok, ++xnames[tok]] = NR
+ 551 } else if (act == "2") { # 426
+ 426 if (tok in local) { # 309
+ 309 tok = tok "(" funcname ")"
+ 309 if (! inarray(tok, names)) { # 22
+ 22 names[++nnames] = tok
+ }
+ 309 lines[tok, ++xnames[tok]] = NR
+ 117 } else {
+ 117 tok = tok "()"
+ 117 if (! inarray(tok, names)) { # 22
+ 22 names[++nnames] = tok
}
- 8 lines[tok, ++xnames[tok]] = NR
- 551 } else {
- 551 if (act == "2") { # 426
- 426 if (tok in local) { # 309
- 309 tok = tok "(" funcname ")"
- 309 if (! inarray(tok, names)) { # 22
- 22 names[++nnames] = tok
- }
- 309 lines[tok, ++xnames[tok]] = NR
- 117 } else {
- 117 tok = tok "()"
- 117 if (! inarray(tok, names)) { # 22
- 22 names[++nnames] = tok
- }
- 117 lines[tok, ++xnames[tok]] = NR
- }
- 125 } else {
- 125 if (act == "3") { # 4
- 4 funcname = tok
- 4 flines[tok] = NR
- 121 } else {
- 121 if (act == "4") { # 49
- 49 braces++
- 72 } else {
- 72 if (act == "5") { # 49
- 49 braces--
- 49 if (braces == 0) { # 4
- 22 for (temp in local) {
- 22 delete local[temp]
- }
- 4 funcname = ""
- 4 nextstate = 1
- }
- 23 } else {
- 23 if (act == "6") { # 22
- 22 local[tok] = 1
- 1 } else {
- 1 if (act == "7") { # 1
- 1 break
- } else {
- if (act == "8") {
- print("error: xref.awk: line " NR ": aborting") > "/dev/con"
- exit 1
- }
- }
- }
- }
- }
- }
+ 117 lines[tok, ++xnames[tok]] = NR
+ }
+ 125 } else if (act == "3") { # 4
+ 4 funcname = tok
+ 4 flines[tok] = NR
+ 121 } else if (act == "4") { # 49
+ 49 braces++
+ 72 } else if (act == "5") { # 49
+ 49 braces--
+ 49 if (braces == 0) { # 4
+ 22 for (temp in local) {
+ 22 delete local[temp]
}
+ 4 funcname = ""
+ 4 nextstate = 1
}
+ 23 } else if (act == "6") { # 22
+ 22 local[tok] = 1
+ 1 } else if (act == "7") { # 1
+ 1 break
+ } else if (act == "8") {
+ print("error: xref.awk: line " NR ": aborting") > "/dev/con"
+ exit 1
}
570 state = nextstate
}
@@ -127,44 +111,34 @@
4 tok = "function"
4 line = substr(line, 9)
4 return 1
- 1697 } else {
- 1697 if (line ~ /^{/) { # 53
- 53 tok = "{"
- 53 line = substr(line, 2)
- 53 return 2
- 1644 } else {
- 1644 if (line ~ /^}/) { # 53
- 53 tok = "}"
- 53 line = substr(line, 2)
- 53 return 3
- 1591 } else {
- 1591 if (match(line, /^[[:alpha:]_][[:alnum:]]*\[/)) { # 43
- 43 tok = substr(line, 1, RLENGTH - 1)
- 43 line = substr(line, RLENGTH + 1)
- 43 return 5
- 1548 } else {
- 1548 if (match(line, /^[[:alpha:]_][[:alnum:]]*\(/)) { # 87
- 87 tok = substr(line, 1, RLENGTH - 1)
- 87 line = substr(line, RLENGTH + 1)
- 87 if (! (tok in keywords)) { # 12
- 12 return 6
- }
- 1461 } else {
- 1461 if (match(line, /^[[:alpha:]_][[:alnum:]]*/)) { # 525
- 525 tok = substr(line, 1, RLENGTH)
- 525 line = substr(line, RLENGTH + 1)
- 525 if (! (tok in keywords)) { # 405
- 405 return 4
- }
- 936 } else {
- 936 match(line, /^[^[:alpha:]_{}]/)
- 936 tok = substr(line, 1, RLENGTH)
- 936 line = substr(line, RLENGTH + 1)
- }
- }
- }
- }
+ 1697 } else if (line ~ /^{/) { # 53
+ 53 tok = "{"
+ 53 line = substr(line, 2)
+ 53 return 2
+ 1644 } else if (line ~ /^}/) { # 53
+ 53 tok = "}"
+ 53 line = substr(line, 2)
+ 53 return 3
+ 1591 } else if (match(line, /^[[:alpha:]_][[:alnum:]]*\[/)) { # 43
+ 43 tok = substr(line, 1, RLENGTH - 1)
+ 43 line = substr(line, RLENGTH + 1)
+ 43 return 5
+ 1548 } else if (match(line, /^[[:alpha:]_][[:alnum:]]*\(/)) { # 87
+ 87 tok = substr(line, 1, RLENGTH - 1)
+ 87 line = substr(line, RLENGTH + 1)
+ 87 if (! (tok in keywords)) { # 12
+ 12 return 6
+ }
+ 1461 } else if (match(line, /^[[:alpha:]_][[:alnum:]]*/)) { # 525
+ 525 tok = substr(line, 1, RLENGTH)
+ 525 line = substr(line, RLENGTH + 1)
+ 525 if (! (tok in keywords)) { # 405
+ 405 return 4
}
+ 936 } else {
+ 936 match(line, /^[^[:alpha:]_{}]/)
+ 936 tok = substr(line, 1, RLENGTH)
+ 936 line = substr(line, RLENGTH + 1)
}
}
}
diff --git a/test/profile5.ok b/test/profile5.ok
index 2bae16b5..720683e2 100644
--- a/test/profile5.ok
+++ b/test/profile5.ok
@@ -356,15 +356,11 @@
if (match(t, /^((--([Vv])ersion)|(-([Vv])))[ \t]*/, A)) {
t = substr(t, RLENGTH + 1)
_cmdln_version = A[3] A[5]
- } else {
- if (match(t, /^((-?\?)|(--help))[ \t]*/)) {
- t = substr(t, RLENGTH + 1)
- _cmdln_help = 1
- } else {
- if (match(t, /^--[ \t]*/)) {
- return _endpass(substr(t, RLENGTH + 1))
- }
- }
+ } else if (match(t, /^((-?\?)|(--help))[ \t]*/)) {
+ t = substr(t, RLENGTH + 1)
+ _cmdln_help = 1
+ } else if (match(t, /^--[ \t]*/)) {
+ return _endpass(substr(t, RLENGTH + 1))
}
return t
case "_lib_APPLY":
@@ -848,11 +844,9 @@
_tLOG[n = _wLCHLD(p, _N())][""]
delete _tLOG[n][""]
_Zimparr(_tLOG[n], substr(t, 10))
- } else {
- if ((t = _pass(_IMPORT, t, p, A)) != "") {
- gsub(/\x1B\x3B/, "\033", t)
- _wLCHLD(p, _N(_tSTR, t))
- }
+ } else if ((t = _pass(_IMPORT, t, p, A)) != "") {
+ gsub(/\x1B\x3B/, "\033", t)
+ _wLCHLD(p, _N(_tSTR, t))
}
}
return p
@@ -1042,10 +1036,8 @@
if (optr == p) {
delete _UIDOBLV[p]
delete _UIDOBLV[_UIDOBLV[_UIDOBL[p] = p][""] = p][""]
- } else {
- if (optr in _UIDOBL) {
- _UIDOBL[p] = _UIDOBL[optr]
- }
+ } else if (optr in _UIDOBL) {
+ _UIDOBL[p] = _UIDOBL[optr]
}
}
_UIDPFX[p] = (_istr(pfx) ? pfx : "")
@@ -1137,11 +1129,9 @@
if (! (i in A1)) {
a++
R[i] = 0
- } else {
- if (A0[i] != A1[i]) {
- a++
- R[i] = 2
- }
+ } else if (A0[i] != A1[i]) {
+ a++
+ R[i] = 2
}
}
for (i in A1) {
@@ -1306,10 +1296,8 @@
if ((c = _CHR[i]) ~ r) {
D[c] = "\\" S[c]
t = t c
- } else {
- if (D[c] == "") {
- D[c] = c
- }
+ } else if (D[c] == "") {
+ D[c] = c
}
}
} else {
@@ -1319,10 +1307,8 @@
if (S != "") {
t = t c
}
- } else {
- if (D[c] == "") {
- D[c] = c
- }
+ } else if (D[c] == "") {
+ D[c] = c
}
}
}
@@ -1489,10 +1475,8 @@
} else {
return i
}
- } else {
- if (match(B[i++], /^([^ \t\-]+)\-([^ \t\-]+)\-([^ \t]+)[ \t]+([^ \t]+)[ \t]+([0-9]+)[ \t]+(.+)$/, C)) {
- A[f][f C[6]] = C[5] " " C[1] "/" _CHR["MONTH"][C[2]] "/" C[3] " " C[4]
- }
+ } else if (match(B[i++], /^([^ \t\-]+)\-([^ \t\-]+)\-([^ \t]+)[ \t]+([^ \t]+)[ \t]+([0-9]+)[ \t]+(.+)$/, C)) {
+ A[f][f C[6]] = C[5] " " C[1] "/" _CHR["MONTH"][C[2]] "/" C[3] " " C[4]
}
}
return i
@@ -1507,13 +1491,11 @@
if (_dllchktv != _[pp][".Product Version"]) {
_dllerr(_[pp]["AGENT"], "agent version (" _[pp][".Product Version"] ") do not match all lib versions: " _dllchktv "'")
}
+ } else if (! _missfl) {
+ _creport(pp, "agent not detected in registry")
} else {
- if (! _missfl) {
- _creport(pp, "agent not detected in registry")
- } else {
- _dllerr(pp, "agent not detected in registry but some registry entries exist:")
- _tframe("_dll_check_i1", pp, pp)
- }
+ _dllerr(pp, "agent not detected in registry but some registry entries exist:")
+ _tframe("_dll_check_i1", pp, pp)
}
}
@@ -1549,10 +1531,8 @@
} else {
if (_dllchktv == "") {
_dllchktv = v
- } else {
- if (v != _dllchktv) {
- return _dllerr(p, "different versions detected: " _dllchktv "!=" v "'")
- }
+ } else if (v != _dllchktv) {
+ return _dllerr(p, "different versions detected: " _dllchktv "!=" v "'")
}
ERRNO = ""
if (_th1(_[p]["DATA"] = _rdfile(f), ERRNO)) {
@@ -1975,13 +1955,11 @@
return _dllerr(p, " file version mismatch: ==`" _[p]["VERSION"] "'; !=`" v "'", f)
}
_creport(p, substr("OK: FILE DETECTED" ((v == "" ? "" : "(" v ")")) ": " f, 1, 122))
- } else {
- if (_[p]["TYPE"] == "defdir") {
- if (_filexist(f = _[p]["DIR"])) {
- _creport(p, substr("OK: DIR DETECTED: " f, 1, 112))
- } else {
- _dllerr(p, "directory " f " is not detected")
- }
+ } else if (_[p]["TYPE"] == "defdir") {
+ if (_filexist(f = _[p]["DIR"])) {
+ _creport(p, substr("OK: DIR DETECTED: " f, 1, 112))
+ } else {
+ _dllerr(p, "directory " f " is not detected")
}
}
}
@@ -2678,14 +2656,12 @@
lstr = A[3] "+"
hstr = ""
}
+ } else if (match(cs, /^(([^'\xB4\|]*\xB4.)*[^'\xB4\|]*)(\|(.*))?/, A)) {
+ hstr = A[1]
+ lstr = A[4]
} else {
- if (match(cs, /^(([^'\xB4\|]*\xB4.)*[^'\xB4\|]*)(\|(.*))?/, A)) {
- hstr = A[1]
- lstr = A[4]
- } else {
- ERRNO = "_inituid(): bad parameters"
- return
- }
+ ERRNO = "_inituid(): bad parameters"
+ return
}
_conl(dptr ":" pfx "'" hstr "|" lstr "'" sfx)
return _cfguid(p, dptr, pfx, sfx, hstr, lstr)
@@ -2998,24 +2974,18 @@
F[p][""]
delete F[p][""]
_copyarr(F[p], v)
- } else {
- if (! (v == 0 && v == "")) {
- F[p] = v
- }
+ } else if (! (v == 0 && v == "")) {
+ F[p] = v
}
- } else {
- if (! (F == 0 && F == "")) {
- if (isarray(v)) {
- _[p][F][""]
- delete _[p][F][""]
- _copyarr(_[p][F], v)
- } else {
- if (v == 0 && v == "") {
- _mpu(F, p)
- } else {
- _[p][F] = v
- }
- }
+ } else if (! (F == 0 && F == "")) {
+ if (isarray(v)) {
+ _[p][F][""]
+ delete _[p][F][""]
+ _copyarr(_[p][F], v)
+ } else if (v == 0 && v == "") {
+ _mpu(F, p)
+ } else {
+ _[p][F] = v
}
}
return p
@@ -3188,24 +3158,22 @@
if (RLENGTH > 0) {
D["type"] = toupper(substr(A[1], 1, RLENGTH - 1))
_patharr0_i0(i, D, "site", "port")
- } else {
- if (A[1] == "") {
- D["type"] = "UNC"
- if (h > 2) {
- D["host"]
- A[2] = _patharr0_i0(A[2], D, "drive", "", "FILE")
- return _patharr0_i1(D, A, 2, q)
- }
- if (i == "") {
- return 1
- }
- D["host"] = i
- A[3] = _patharr0_i0(A[3], D, "drive", "", "FILE")
- } else {
- D["type"] = "FILE"
- A[1] = _patharr0_i0(A[1], D, "drive")
- return _patharr0_i1(D, A, 1, q)
+ } else if (A[1] == "") {
+ D["type"] = "UNC"
+ if (h > 2) {
+ D["host"]
+ A[2] = _patharr0_i0(A[2], D, "drive", "", "FILE")
+ return _patharr0_i1(D, A, 2, q)
+ }
+ if (i == "") {
+ return 1
}
+ D["host"] = i
+ A[3] = _patharr0_i0(A[3], D, "drive", "", "FILE")
+ } else {
+ D["type"] = "FILE"
+ A[1] = _patharr0_i0(A[1], D, "drive")
+ return _patharr0_i1(D, A, 1, q)
}
return _patharr0_i1(D, A, 3, q)
}
@@ -3224,10 +3192,8 @@
D[r] = t
}
return t
- } else {
- if (t && r) {
- D[l] = t
- }
+ } else if (t && r) {
+ D[l] = t
}
return t
}
@@ -3250,10 +3216,8 @@
D["name"] = substr(t, 1, RSTART - 1)
}
D["ext"] = substr(t, RSTART, RLENGTH)
- } else {
- if (t != "") {
- D["name"] = t
- }
+ } else if (t != "") {
+ D["name"] = t
}
}
return 1
@@ -3378,12 +3342,10 @@
{
if (qm == qm + 0 && qm > 0) {
_qparamim = substr(" ", 1, qm)
+ } else if (qm != "") {
+ _qparamim = qm
} else {
- if (qm != "") {
- _qparamim = qm
- } else {
- _qparamim = " "
- }
+ _qparamim = " "
}
_qparamask = ""
return _qparam_i0(p0, p1, p2, p3, p4, p5, p6, p7)
@@ -3400,16 +3362,12 @@
default:
if (isarray(p0)) {
_qparama0 = "A"
+ } else if (p0 == "" && p0 == 0) {
+ _qparama0 = " "
+ } else if (_isptr(p0)) {
+ _qparama0 = "P"
} else {
- if (p0 == "" && p0 == 0) {
- _qparama0 = " "
- } else {
- if (_isptr(p0)) {
- _qparama0 = "P"
- } else {
- _qparama0 = "S"
- }
- }
+ _qparama0 = "S"
}
case ".":
_qparamask = _qparamask _qparama0
@@ -3669,11 +3627,9 @@
} else {
break
}
- } else {
- if (_rdregp0 ~ /^HK/) {
- ++_rdregkey
- return D[_rdregp0 = _rdregp0 "\\"]
- }
+ } else if (_rdregp0 ~ /^HK/) {
+ ++_rdregkey
+ return D[_rdregp0 = _rdregp0 "\\"]
}
}
return 1
@@ -3702,12 +3658,10 @@
} else {
_dllerr(p, substr("REGENTRY NOT MATCH(!=" _[p]["VALUE"] "): " _[p]["REGPATH"], 1, 126))
}
+ } else if (_VAR[_[p]["REGPATH"]] == _REG[_[p]["REGPATH"]]) {
+ _creport(p, substr("OK: REGPATH MATCH(==" _VAR[_[p]["REGPATH"]] "): " _[p]["REGPATH"], 1, 126))
} else {
- if (_VAR[_[p]["REGPATH"]] == _REG[_[p]["REGPATH"]]) {
- _creport(p, substr("OK: REGPATH MATCH(==" _VAR[_[p]["REGPATH"]] "): " _[p]["REGPATH"], 1, 126))
- } else {
- _dllerr(p, substr("REGPATH NOT MATCH(!=" _VAR[_[p]["REGPATH"]] "): " _[p]["REGPATH"], 1, 126))
- }
+ _dllerr(p, substr("REGPATH NOT MATCH(!=" _VAR[_[p]["REGPATH"]] "): " _[p]["REGPATH"], 1, 126))
}
} else {
_dllerr(p, substr("REGPATH NOT FOUND: " _[p]["REGPATH"], 1, 126))
@@ -3890,26 +3844,24 @@
if (D[7]) {
t = "STR"
v = _unstr(D[8])
+ } else if (D[10]) {
+ t = "W32"
+ v = D[11]
} else {
- if (D[10]) {
- t = "W32"
- v = D[11]
- } else {
- v = D[15]
- if (D[13]) {
- switch (D[14]) {
- case "2":
- t = "XSZ"
- break
- case "7":
- t = "MSZ"
- break
- default:
- t = "W64"
- }
- } else {
- t = "BIN"
+ v = D[15]
+ if (D[13]) {
+ switch (D[14]) {
+ case "2":
+ t = "XSZ"
+ break
+ case "7":
+ t = "MSZ"
+ break
+ default:
+ t = "W64"
}
+ } else {
+ t = "BIN"
}
}
DD[gensub(/(\\)\\+/, "\\1", "G", p "\\" _unstr(D[3] ((D[5] ? "(Default)" : ""))) "." t)] = v
@@ -4095,57 +4047,33 @@
if (isarray(D)) {
if (isarray(S)) {
_addarrmask(D, S, _SHORTCUTWSTRUC)
- } else {
- if (S == 0 && S == "") {
- _addarrmask(D, _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
- } else {
- if (_isnotfileptr(S)) {
- _addarrmask(D, _[S], _SHORTCUTWSTRUC)
- } else {
- if (_rd_shortcut(D, S)) {
- return
- }
- }
- }
+ } else if (S == 0 && S == "") {
+ _addarrmask(D, _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
+ } else if (_isnotfileptr(S)) {
+ _addarrmask(D, _[S], _SHORTCUTWSTRUC)
+ } else if (_rd_shortcut(D, S)) {
+ return
}
- } else {
- if (D == 0 && D == "") {
- return _NOP
- } else {
- if (_isnotfileptr(D)) {
- if (isarray(S)) {
- _addarrmask(_[D], S, _SHORTCUTWSTRUC)
- } else {
- if (S == 0 && S == "") {
- _addarrmask(_[D], _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
- } else {
- if (_isnotfileptr(S)) {
- _addarrmask(_[D], _[S], _SHORTCUTWSTRUC)
- } else {
- if (_rd_shortcut(_[D], S)) {
- return
- }
- }
- }
- }
- } else {
- if (isarray(S) && _wr_shortcut(D, S)) {
- return
- } else {
- if (S == 0 && S == "" && _wr_shortcut(D, _SHORTCUTDEFAULT)) {
- return
- } else {
- if (_isnotfileptr(S) && _wr_shortcut(D, _[S])) {
- return
- } else {
- if (_rd_shortcut(_SHRTCUTA1, S) || _wr_shortcut(D, _SHRTCUTA1)) {
- return
- }
- }
- }
- }
- }
+ } else if (D == 0 && D == "") {
+ return _NOP
+ } else if (_isnotfileptr(D)) {
+ if (isarray(S)) {
+ _addarrmask(_[D], S, _SHORTCUTWSTRUC)
+ } else if (S == 0 && S == "") {
+ _addarrmask(_[D], _SHORTCUTDEFAULT, _SHORTCUTWSTRUC)
+ } else if (_isnotfileptr(S)) {
+ _addarrmask(_[D], _[S], _SHORTCUTWSTRUC)
+ } else if (_rd_shortcut(_[D], S)) {
+ return
}
+ } else if (isarray(S) && _wr_shortcut(D, S)) {
+ return
+ } else if (S == 0 && S == "" && _wr_shortcut(D, _SHORTCUTDEFAULT)) {
+ return
+ } else if (_isnotfileptr(S) && _wr_shortcut(D, _[S])) {
+ return
+ } else if (_rd_shortcut(_SHRTCUTA1, S) || _wr_shortcut(D, _SHRTCUTA1)) {
+ return
}
return 1
}
@@ -4165,14 +4093,12 @@
if (match(_SHRTCUTA0[q], /^([^\t]+)\t+([^\t]+)(\t+([^\t]+)(\t+([^\t]+))?)?/, B)) {
if (B[3] == "") {
_SHORTCUTRSTRUC[B[2]] = B[1]
+ } else if (B[5] == "") {
+ _SHORTCUTWSTRUC[_SHORTCUTRSTRUC[B[4]] = B[1]] = B[2]
+ delete _SHORTCUTDEFAULT[B[1]]
} else {
- if (B[5] == "") {
- _SHORTCUTWSTRUC[_SHORTCUTRSTRUC[B[4]] = B[1]] = B[2]
- delete _SHORTCUTDEFAULT[B[1]]
- } else {
- _SHORTCUTWSTRUC[_SHORTCUTRSTRUC[B[4]] = B[1]] = B[2]
- _SHORTCUTDEFAULT[B[1]] = B[6]
- }
+ _SHORTCUTWSTRUC[_SHORTCUTRSTRUC[B[4]] = B[1]] = B[2]
+ _SHORTCUTDEFAULT[B[1]] = B[6]
}
} else {
_fatal("_shortcut.init: _shortcut_struc: syntax error: `" _SHRTCUTA0[q] "'")
@@ -4584,46 +4510,38 @@
}
return f
}
- } else {
- if (p in _tPARENT) {
- pp = _tPARENT[p]
- delete _tPARENT[p]
- if (p in _tPREV) {
- if (p in _tNEXT) {
- _tNEXT[_tPREV[f] = _tPREV[p]] = f = _tNEXT[p]
- delete _tNEXT[p]
- } else {
- delete _tNEXT[_tLCHLD[pp] = _tPREV[p]]
- }
- delete _tPREV[p]
- _tQCHLD[pp]--
+ } else if (p in _tPARENT) {
+ pp = _tPARENT[p]
+ delete _tPARENT[p]
+ if (p in _tPREV) {
+ if (p in _tNEXT) {
+ _tNEXT[_tPREV[f] = _tPREV[p]] = f = _tNEXT[p]
+ delete _tNEXT[p]
} else {
- if (p in _tNEXT) {
- delete _tPREV[_tFCHLD[pp] = _tNEXT[p]]
- delete _tNEXT[p]
- _tQCHLD[pp]--
- } else {
- delete _tFCHLD[pp]
- delete _tLCHLD[pp]
- delete _tQCHLD[pp]
- }
+ delete _tNEXT[_tLCHLD[pp] = _tPREV[p]]
}
+ delete _tPREV[p]
+ _tQCHLD[pp]--
+ } else if (p in _tNEXT) {
+ delete _tPREV[_tFCHLD[pp] = _tNEXT[p]]
+ delete _tNEXT[p]
+ _tQCHLD[pp]--
} else {
- if (p in _tPREV) {
- if (p in _tNEXT) {
- _tNEXT[_tPREV[f] = _tPREV[p]] = f = _tNEXT[p]
- delete _tNEXT[p]
- } else {
- delete _tNEXT[_tPREV[p]]
- }
- delete _tPREV[p]
- } else {
- if (p in _tNEXT) {
- delete _tPREV[_tNEXT[p]]
- delete _tNEXT[p]
- }
- }
+ delete _tFCHLD[pp]
+ delete _tLCHLD[pp]
+ delete _tQCHLD[pp]
+ }
+ } else if (p in _tPREV) {
+ if (p in _tNEXT) {
+ _tNEXT[_tPREV[f] = _tPREV[p]] = f = _tNEXT[p]
+ delete _tNEXT[p]
+ } else {
+ delete _tNEXT[_tPREV[p]]
}
+ delete _tPREV[p]
+ } else if (p in _tNEXT) {
+ delete _tPREV[_tNEXT[p]]
+ delete _tNEXT[p]
}
}
return p
@@ -4656,10 +4574,8 @@
for (i in _ptr[p]) {
if (isarray(_ptr[p][i])) {
_tdel_i1(_ptr[p][i])
- } else {
- if (i = _ptr[p][i]) {
- _tdel(i)
- }
+ } else if (i = _ptr[p][i]) {
+ _tdel(i)
}
}
if (p in _tFCHLD) {
@@ -4678,10 +4594,8 @@
for (i in _ptr[p]) {
if (isarray(_ptr[p][i])) {
_tdel_i1(_ptr[p][i])
- } else {
- if (i = _ptr[p][i]) {
- _tdel(i)
- }
+ } else if (i = _ptr[p][i]) {
+ _tdel(i)
}
}
if (p in _tFCHLD) {
@@ -4699,10 +4613,8 @@
for (i in A) {
if (isarray(A[i])) {
_tdel_i1(A[i])
- } else {
- if (i = A[i]) {
- _tdel(i)
- }
+ } else if (i = A[i]) {
+ _tdel(i)
}
}
}
@@ -4749,33 +4661,27 @@
delete _tNEXT[_tLCHLD[pp] = _tPREV[p]]
}
delete _tPREV[p]
+ } else if (p in _tNEXT) {
+ delete _tPREV[_tFCHLD[pp] = _tNEXT[p]]
+ delete _tNEXT[p]
} else {
- if (p in _tNEXT) {
- delete _tPREV[_tFCHLD[pp] = _tNEXT[p]]
- delete _tNEXT[p]
- } else {
- delete _tFCHLD[pp]
- delete _tLCHLD[pp]
- delete _tQCHLD[pp]
- return p
- }
+ delete _tFCHLD[pp]
+ delete _tLCHLD[pp]
+ delete _tQCHLD[pp]
+ return p
}
--_tQCHLD[pp]
- } else {
- if (p in _tPREV) {
- if (p in _tNEXT) {
- _tPREV[_tNEXT[v] = _tNEXT[p]] = v = _tPREV[p]
- delete _tNEXT[p]
- } else {
- delete _tNEXT[_tPREV[p]]
- }
- delete _tPREV[p]
+ } else if (p in _tPREV) {
+ if (p in _tNEXT) {
+ _tPREV[_tNEXT[v] = _tNEXT[p]] = v = _tPREV[p]
+ delete _tNEXT[p]
} else {
- if (p in _tNEXT) {
- delete _tPREV[_tNEXT[p]]
- delete _tNEXT[p]
- }
+ delete _tNEXT[_tPREV[p]]
}
+ delete _tPREV[p]
+ } else if (p in _tNEXT) {
+ delete _tPREV[_tNEXT[p]]
+ delete _tNEXT[p]
}
return p
}
@@ -5123,14 +5029,12 @@
if (r != "") {
A[".~"] = A["`~"] = A["^~"] = r
}
+ } else if (match(v, /!/)) {
+ delete A[i]
} else {
- if (match(v, /!/)) {
- delete A[i]
- } else {
- A[i] = v
- if (r != "") {
- A[i "~"] = r
- }
+ A[i] = v
+ if (r != "") {
+ A[i "~"] = r
}
}
}
@@ -5793,16 +5697,14 @@
}
--_tQCHLD[a]
}
- } else {
- if (v in _tPARENT) {
- if (p == (a = _tPARENT[v])) {
- return v
- }
- delete _tPREV[_tFCHLD[a] = _tNEXT[v]]
- --_tQCHLD[a]
- } else {
- delete _tPREV[_tNEXT[v]]
+ } else if (v in _tPARENT) {
+ if (p == (a = _tPARENT[v])) {
+ return v
}
+ delete _tPREV[_tFCHLD[a] = _tNEXT[v]]
+ --_tQCHLD[a]
+ } else {
+ delete _tPREV[_tNEXT[v]]
}
++_tQCHLD[p]
return (_tFCHLD[p] = _tPREV[_tNEXT[v] = _tFCHLD[_tPARENT[v] = p]] = v)
@@ -5819,15 +5721,13 @@
delete _tNEXT[_tPREV[v]]
}
delete _tPREV[v]
- } else {
- if (v in _tPARENT) {
- if (p == (a = _tPARENT[v])) {
- return v
- }
- delete _tFCHLD[a]
- delete _tLCHLD[a]
- delete _tQCHLD[a]
+ } else if (v in _tPARENT) {
+ if (p == (a = _tPARENT[v])) {
+ return v
}
+ delete _tFCHLD[a]
+ delete _tLCHLD[a]
+ delete _tQCHLD[a]
}
++_tQCHLD[p]
return (_tFCHLD[p] = _tPREV[_tNEXT[v] = _tFCHLD[_tPARENT[v] = p]] = v)
@@ -5845,12 +5745,10 @@
} else {
delete _tNEXT[_tLCHLD[a] = _tPREV[v]]
}
+ } else if (v in _tNEXT) {
+ _tNEXT[_tPREV[a] = _tPREV[v]] = a = _tNEXT[v]
} else {
- if (v in _tNEXT) {
- _tNEXT[_tPREV[a] = _tPREV[v]] = a = _tNEXT[v]
- } else {
- delete _tNEXT[_tPREV[v]]
- }
+ delete _tNEXT[_tPREV[v]]
}
delete _tPREV[v]
} else {
@@ -5867,10 +5765,8 @@
delete _tQCHLD[a]
}
delete _tPARENT[v]
- } else {
- if (v in _tNEXT) {
- delete _tPREV[_tNEXT[v]]
- }
+ } else if (v in _tNEXT) {
+ delete _tPREV[_tNEXT[v]]
}
}
return (_tPREV[_tNEXT[v] = p] = v)
@@ -5914,16 +5810,14 @@
}
--_tQCHLD[a]
}
- } else {
- if (v in _tPARENT) {
- if (p == (a = _tPARENT[v])) {
- return v
- }
- delete _tPREV[_tFCHLD[a] = _tNEXT[v]]
- --_tQCHLD[a]
- } else {
- delete _tPREV[_tNEXT[v]]
+ } else if (v in _tPARENT) {
+ if (p == (a = _tPARENT[v])) {
+ return v
}
+ delete _tPREV[_tFCHLD[a] = _tNEXT[v]]
+ --_tQCHLD[a]
+ } else {
+ delete _tPREV[_tNEXT[v]]
}
if (p in _tFCHLD) {
++_tQCHLD[p]
@@ -5943,15 +5837,13 @@
delete _tNEXT[_tPREV[v]]
}
delete _tPREV[v]
- } else {
- if (v in _tPARENT) {
- if (p == (a = _tPARENT[v])) {
- return v
- }
- delete _tFCHLD[a]
- delete _tLCHLD[a]
- delete _tQCHLD[a]
+ } else if (v in _tPARENT) {
+ if (p == (a = _tPARENT[v])) {
+ return v
}
+ delete _tFCHLD[a]
+ delete _tLCHLD[a]
+ delete _tQCHLD[a]
}
if (p in _tFCHLD) {
++_tQCHLD[p]
@@ -6003,16 +5895,14 @@
}
--_tQCHLD[a]
}
- } else {
- if (v in _tPARENT) {
- if (p == (a = _tPARENT[v])) {
- return v
- }
- delete _tNEXT[_tLCHLD[a] = _tPREV[v]]
- --_tQCHLD[a]
- } else {
- delete _tNEXT[_tPREV[v]]
+ } else if (v in _tPARENT) {
+ if (p == (a = _tPARENT[v])) {
+ return v
}
+ delete _tNEXT[_tLCHLD[a] = _tPREV[v]]
+ --_tQCHLD[a]
+ } else {
+ delete _tNEXT[_tPREV[v]]
}
++_tQCHLD[p]
return (_tLCHLD[p] = _tNEXT[_tPREV[v] = _tLCHLD[_tPARENT[v] = p]] = v)
@@ -6029,15 +5919,13 @@
delete _tPREV[_tNEXT[v]]
}
delete _tNEXT[v]
- } else {
- if (v in _tPARENT) {
- if (p == (a = _tPARENT[v])) {
- return v
- }
- delete _tLCHLD[a]
- delete _tFCHLD[a]
- delete _tQCHLD[a]
+ } else if (v in _tPARENT) {
+ if (p == (a = _tPARENT[v])) {
+ return v
}
+ delete _tLCHLD[a]
+ delete _tFCHLD[a]
+ delete _tQCHLD[a]
}
++_tQCHLD[p]
return (_tLCHLD[p] = _tNEXT[_tPREV[v] = _tLCHLD[_tPARENT[v] = p]] = v)
@@ -6055,12 +5943,10 @@
} else {
delete _tPREV[_tFCHLD[a] = _tNEXT[v]]
}
+ } else if (v in _tPREV) {
+ _tPREV[_tNEXT[a] = _tNEXT[v]] = a = _tPREV[v]
} else {
- if (v in _tPREV) {
- _tPREV[_tNEXT[a] = _tNEXT[v]] = a = _tPREV[v]
- } else {
- delete _tPREV[_tNEXT[v]]
- }
+ delete _tPREV[_tNEXT[v]]
}
delete _tNEXT[v]
} else {
@@ -6077,10 +5963,8 @@
delete _tQCHLD[a]
}
delete _tPARENT[v]
- } else {
- if (v in _tPREV) {
- delete _tNEXT[_tPREV[v]]
- }
+ } else if (v in _tPREV) {
+ delete _tNEXT[_tPREV[v]]
}
}
return (_tNEXT[_tPREV[v] = p] = v)
@@ -6124,16 +6008,14 @@
}
--_tQCHLD[a]
}
- } else {
- if (v in _tPARENT) {
- if (p == (a = _tPARENT[v])) {
- return v
- }
- delete _tNEXT[_tLCHLD[a] = _tPREV[v]]
- --_tQCHLD[a]
- } else {
- delete _tNEXT[_tPREV[v]]
+ } else if (v in _tPARENT) {
+ if (p == (a = _tPARENT[v])) {
+ return v
}
+ delete _tNEXT[_tLCHLD[a] = _tPREV[v]]
+ --_tQCHLD[a]
+ } else {
+ delete _tNEXT[_tPREV[v]]
}
if (p in _tLCHLD) {
++_tQCHLD[p]
@@ -6153,15 +6035,13 @@
delete _tPREV[_tNEXT[v]]
}
delete _tNEXT[v]
- } else {
- if (v in _tPARENT) {
- if (p == (a = _tPARENT[v])) {
- return v
- }
- delete _tLCHLD[a]
- delete _tFCHLD[a]
- delete _tQCHLD[a]
+ } else if (v in _tPARENT) {
+ if (p == (a = _tPARENT[v])) {
+ return v
}
+ delete _tLCHLD[a]
+ delete _tFCHLD[a]
+ delete _tQCHLD[a]
}
if (p in _tLCHLD) {
++_tQCHLD[p]
@@ -6225,21 +6105,17 @@
--_tQCHLD[b]
}
}
- } else {
- if (v in _tNEXT) {
- if (v in _tPARENT) {
- delete _tPREV[_tFCHLD[a = _tPARENT[v]] = _tNEXT[v]]
- --_tQCHLD[a]
- } else {
- delete _tPREV[_tNEXT[v]]
- }
+ } else if (v in _tNEXT) {
+ if (v in _tPARENT) {
+ delete _tPREV[_tFCHLD[a = _tPARENT[v]] = _tNEXT[v]]
+ --_tQCHLD[a]
} else {
- if (v in _tPARENT) {
- delete _tFCHLD[a = _tPARENT[v]]
- delete _tLCHLD[a]
- delete _tQCHLD[a]
- }
+ delete _tPREV[_tNEXT[v]]
}
+ } else if (v in _tPARENT) {
+ delete _tFCHLD[a = _tPARENT[v]]
+ delete _tLCHLD[a]
+ delete _tQCHLD[a]
}
if (p in _tNEXT) {
_tPREV[_tNEXT[v] = _tNEXT[p]] = v
@@ -6307,21 +6183,17 @@
--_tQCHLD[b]
}
}
- } else {
- if (v in _tPREV) {
- if (v in _tPARENT) {
- delete _tNEXT[_tLCHLD[a = _tPARENT[v]] = _tPREV[v]]
- --_tQCHLD[a]
- } else {
- delete _tNEXT[_tPREV[v]]
- }
+ } else if (v in _tPREV) {
+ if (v in _tPARENT) {
+ delete _tNEXT[_tLCHLD[a = _tPARENT[v]] = _tPREV[v]]
+ --_tQCHLD[a]
} else {
- if (v in _tPARENT) {
- delete _tLCHLD[a = _tPARENT[v]]
- delete _tFCHLD[a]
- delete _tQCHLD[a]
- }
+ delete _tNEXT[_tPREV[v]]
}
+ } else if (v in _tPARENT) {
+ delete _tLCHLD[a = _tPARENT[v]]
+ delete _tFCHLD[a]
+ delete _tQCHLD[a]
}
if (p in _tPREV) {
_tNEXT[_tPREV[v] = _tPREV[p]] = v