Check every pattern against both regex engines on a pull request - #56
Merged
Merged
Conversation
FrayxRulez
force-pushed
the
unicode-classes
branch
from
September 21, 2026 08:37
b07f46b to
d7c5ff1
Compare
FrayxRulez
force-pushed
the
check-grammars
branch
from
September 21, 2026 08:38
77c0eb0 to
f051791
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #55, which adds the header
tools/probe.cppshares with the loader. Review that one first.grammars.datis read by libprisma with Boost and by the Android client withjava.util.regex. Nothing currently holds it to meaning the same thing to both, and the failure that taught us this was silent:\vcompiles cleanly in both engines and means U+000B in one and the whole vertical whitespace class — newline included — in the other, which madeinivalues run past the end of their line. A "does it compile" gate would not have caught it.So three nets, cheapest first. The workflow regenerates the table from the pull request's own
components/andgenerate.jsbefore checking it, since the committed one is only refreshed on master.tools/check-escapes.js— every escape in the table has to be one both engines read the same way. The allowlist is whatnormalizeEscapesis expected to leave behind; anything else fails with what it means where. This is the net for escapes that compile fine and mean something else. Run against the table as it was before #53, it reports\vand\0and nothing else.tools/PatternProbe.java— compiles all 3958 patterns withjava.util.regex. It also applies the one rewrite a Java client has to do for itself: outsideMULTILINE,$means end of input in ECMAScript but "or before a final line terminator" in Java, and\zis the Java spelling of the first. That cannot live in the table, where\zwould read as a literalz. Against the pre-#53 table it fails 165 patterns.tools/probe.cpp— the same with Boost, through the sameUnicodeEscapes.hthe loader uses, so what it tests is what ships.Both probes write down every offset each pattern matches in
tools/corpus.txt, and the last step diffs the two files. That is the check that catches a divergence in meaning rather than in syntax. The corpus is deliberately ASCII: Boost matches bytes wherejava.util.regexmatches characters, so anything above U+007F diverges on offsets alone and would drown out the bugs being looked for.On the current table, with #55 in: 3958 of 3958 compile in both, and the two engines agree on every pattern.
🤖 Generated with Claude Code