From a5372bded764e7ad8312738dfe0e93dbf38cfd5b Mon Sep 17 00:00:00 2001 From: David de Hilster Date: Mon, 26 Oct 2026 18:37:38 -0400 Subject: [PATCH] zone and endzone lines take no pass number (4.2.48) 4.2.47 numbered the zone and endzone lines of analyzer.seq as passes. A folder line is not a pass in the engine, and the VS Code sequence view numbers only lines with a pass file (and tokenizers), so after a zone line every engine pass number was one higher than the view's, two after endzone: with -DEV, clicking a pass opened the wrong ana###.tree. runPass() now skips zone and endzone lines without numbering them, like a folder line, on every path: the normal loop, an inactive /zone line, the no-zones fallback and a stray endzone. The explicit increments in execute() and executeZones() are gone. CI: the zone-mode step expects z00N-ana003.tree for the words pass, which is pass 3 in the sequence view; it was ana004. Also brings the bundled analyzers, with parse-en-us v1.1.4 (the pos50 loop fix), into a release (#805). Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build-linux.yml | 7 ++++--- .github/workflows/build-macos.yml | 7 ++++--- .github/workflows/build-windows.yml | 7 ++++--- lite/parse.cpp | 17 ++++++++++------- nlp/main.cpp | 2 +- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 00dcfd38..8c3a5153 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -370,10 +370,11 @@ jobs: if [ "$tree" != "0" ] || [ "$(grep -c '^ _line ' "$FIX/input/text.txt_log/final.tree")" != "3" ]; then echo "FAIL(zone-mode): final.tree is not three _line stubs:"; cat "$FIX/input/text.txt_log/final.tree"; exit 1 fi - # -DEV writes per-zone pass trees, named by zone. + # -DEV writes per-zone pass trees, named by zone. The zone line takes + # no pass number, as in the sequence view, so words is pass 3. for z in 001 002 003; do - if [ ! -f "$FIX/input/text.txt_log/z$z-ana004.tree" ]; then - echo "FAIL(zone-mode): no z$z-ana004.tree"; ls "$FIX/input/text.txt_log"; exit 1 + if [ ! -f "$FIX/input/text.txt_log/z$z-ana003.tree" ]; then + echo "FAIL(zone-mode): no z$z-ana003.tree"; ls "$FIX/input/text.txt_log"; exit 1 fi done echo "[zone-mode] one run of the zone passes per zone, zones kept as stubs" diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 33ea8a79..8deb5096 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -217,10 +217,11 @@ jobs: if [ "$tree" != "0" ] || [ "$(grep -c '^ _line ' "$FIX/input/text.txt_log/final.tree")" != "3" ]; then echo "FAIL(zone-mode): final.tree is not three _line stubs:"; cat "$FIX/input/text.txt_log/final.tree"; exit 1 fi - # -DEV writes per-zone pass trees, named by zone. + # -DEV writes per-zone pass trees, named by zone. The zone line takes + # no pass number, as in the sequence view, so words is pass 3. for z in 001 002 003; do - if [ ! -f "$FIX/input/text.txt_log/z$z-ana004.tree" ]; then - echo "FAIL(zone-mode): no z$z-ana004.tree"; ls "$FIX/input/text.txt_log"; exit 1 + if [ ! -f "$FIX/input/text.txt_log/z$z-ana003.tree" ]; then + echo "FAIL(zone-mode): no z$z-ana003.tree"; ls "$FIX/input/text.txt_log"; exit 1 fi done echo "[zone-mode] one run of the zone passes per zone, zones kept as stubs" diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 8c3706a2..30066f70 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -305,10 +305,11 @@ jobs: if [ "$tree" != "0" ] || [ "$(grep -c '^ _line ' "$FIX/input/text.txt_log/final.tree")" != "3" ]; then echo "FAIL(zone-mode): final.tree is not three _line stubs:"; cat "$FIX/input/text.txt_log/final.tree"; exit 1 fi - # -DEV writes per-zone pass trees, named by zone. + # -DEV writes per-zone pass trees, named by zone. The zone line takes + # no pass number, as in the sequence view, so words is pass 3. for z in 001 002 003; do - if [ ! -f "$FIX/input/text.txt_log/z$z-ana004.tree" ]; then - echo "FAIL(zone-mode): no z$z-ana004.tree"; ls "$FIX/input/text.txt_log"; exit 1 + if [ ! -f "$FIX/input/text.txt_log/z$z-ana003.tree" ]; then + echo "FAIL(zone-mode): no z$z-ana003.tree"; ls "$FIX/input/text.txt_log"; exit 1 fi done echo "[zone-mode] one run of the zone passes per zone, zones kept as stubs" diff --git a/lite/parse.cpp b/lite/parse.cpp index 4ae5eac6..a848d8c4 100644 --- a/lite/parse.cpp +++ b/lite/parse.cpp @@ -523,6 +523,13 @@ static const int RUN_ABORT = 2; // A pass failed: stop without finishing up. int Parse::runPass(Delt *seq, long &num) { +// zone and endzone lines are markers, not passes: like a folder line, they +// take no pass number, so pass numbers (and ana###.tree names) match the +// sequence view's. +const _TCHAR *salgo = str(seq->getData()->getAlgoname()); +if (!strcmp_i(salgo, _T("zone")) || !strcmp_i(salgo, _T("endzone"))) + return RUN_OK; + // A run past its time limit runs no more passes. The pass that ran // out stopped at its next while turn; the rest are skipped whole. // 10/25/26 DD. if (overBudget(true)) @@ -644,7 +651,7 @@ std::vector *> zones; if (root) findZones(root->pDown, ztype, zones); -long base = currpass_; // The zone line's own pass number. +long base = currpass_; // The last pass before the zone line. long num = base; int result = RUN_OK; Delt *seq; @@ -703,11 +710,9 @@ for (long z = 0; z < nzones && result == RUN_OK; ++z) zoneNum_ = 0; zoneFirst_ = zoneLast_ = false; -// The wrap-up passes, once, on the whole document. The endzone line takes -// a pass number of its own, as the zone line does. +// The wrap-up passes, once, on the whole document. if (endz && result == RUN_OK) { - ++num; for (seq = endz->Right(); seq && result == RUN_OK; seq = seq->Right()) result = runPass(seq, num); } @@ -764,9 +769,7 @@ for (seq = ana->getSeq(); seq; seq = seq->Right()) Seqn *pass = seq->getData(); if (pass->getActive() && !strcmp_i(str(pass->getAlgoname()), _T("zone"))) { - // The zone line takes a pass number, as a folder line does, so the - // passes after it keep the numbers the sequence file gives them. - ++currpass_; + // The zone line takes no pass number (see runPass). if (executeZones(seq->Right(), pass->getRulesfilename()) == RUN_ABORT) return; break; diff --git a/nlp/main.cpp b/nlp/main.cpp index f3040476..02fe886e 100644 --- a/nlp/main.cpp +++ b/nlp/main.cpp @@ -15,7 +15,7 @@ All rights reserved. #include "lite/nlp_engine.h" #include "version.h" -#define NLP_ENGINE_VERSION "4.2.47" +#define NLP_ENGINE_VERSION "4.2.48" bool cmdReadArgs(int, _TCHAR *argv[], _TCHAR *&, _TCHAR *&, _TCHAR *&, _TCHAR *&, bool &, bool &, bool &, bool &, bool &, bool &, int &, bool &, bool &, _TCHAR *&, double &); void cmdHelpargs(_TCHAR *);