| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Extend the set-operation charset fusion to intersection (&&), not just difference (--). A new charset-body opcode INVERT is the dual of NEGATE: NEGATE flips the running verdict, INVERT flips each following membership test, so [A&&B] -- and chained or nested set operations -- compile to a single charset instead of a positive lookbehind assertion. A --/&& chain is a pure conjunction, so _fuse_difference generalizes to _fuse_setops by appending one more kind of fail item. An intersection operand must reduce to a single member and is not fused under IGNORECASE (case folding could split it); the optimizer walk threads the flag context through groups, so a scoped (?i:...) is skipped too. Intersection-bearing set operations match 4-6x faster; pure difference compiles bit-for-bit as before. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Extend the set-operation charset fusion to intersection (&&), not just difference (--). A new charset-body opcode INVERT is the dual of NEGATE: NEGATE flips the running verdict, INVERT flips each following membership test, so [A&&B] — and chained or nested set operations — compile to a single charset instead of a positive lookbehind assertion.
A --/&& chain is a pure conjunction (the character must be in the head charset, not in any subtrahend, and in every intersection operand), so _fuse_difference generalizes to _fuse_setops by appending one more kind of fail item to the fused charset. An intersection operand must reduce to a single member and is not fused under IGNORECASE, where case folding could split it; the optimizer walk threads the flag context through groups, so a scoped (?i:...) is skipped too.
Intersection-bearing set operations match 4–6× faster (no per-character recursive lookbehind sub-match); pure difference compiles bit-for-bit as before.
Verified with a 231k-check differential over random --/&& chains (plain, (?i), (?i:...) and (?-i:...) contexts) against per-operand membership as the oracle, with no mismatches.