Skip to content

Setting: start new rules passes with a @CODE region (nlp-engine#391) - #1237

Merged
ddehilster merged 1 commit into
VisualText:masterfrom
ddehilster:feat/new-pass-code-region-391
Oct 14, 2026
Merged

ddehilster merged 1 commit into
VisualText:masterfrom
ddehilster:feat/new-pass-code-region-391

Conversation

@ddehilster

Copy link
Copy Markdown
Member

Implements VisualText/nlp-engine#391 as an opt-in setting.

New setting: nlp.newPass.codeRegion (default off, so nothing changes for anyone who doesn't turn it on). When it's on, a new rules pass starts with a @CODE region:

@CODE
L("hello") = 0;
@@CODE

@NODES _ROOT

@RULES
...

As Amnon describes in the issue, a @CODE region runs before the rules. It's where to set up globals for the pass, or to skip it with exitpass(), which effectively lets one analyzer run several analyzers' worth of passes. L("hello") = 0; is the placeholder parse-en-us already uses for an empty code region.

Testing

  • A pass built from the new template runs through engine 4.2.24 with no errors.
  • tsc --noEmit shows no new errors. The one error it reports, in src/server/serverCore.ts, is there without this change too.

🤖 Generated with Claude Code

New setting nlp.newPass.codeRegion (default off). When on, a new rules pass
starts with a @code region, which runs before the rules: a place to set up
globals for the pass or to skip it with exitpass().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ddehilster
ddehilster merged commit 64a7531 into VisualText:master Oct 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant