Repository navigation
Ignore raw grammar metadata when assigning rule IDs - #306
Open
RKS (rksharma-owg) wants to merge 1 commit into
Open
RKS (rksharma-owg) wants to merge 1 commit into
RKS (rksharma-owg) wants to merge 1 commit into
Conversation
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.
Raw grammar rules can contain metadata named
id, which the rule compiler currently trusts as an internal compiled rule identifier. A string or out-of-range numeric value crashes tokenization; a colliding numeric value can silently select the wrong rule.Clear incoming rule IDs on the existing cloned grammar before compilation. Traverse pattern, repository and capture rule containers plus injections, preserving repository entries named
id, location metadata and caller-owned input. External grammars use the same initialization path.Add 18 regressions using real Oniguruma tokenization. They cover string/numeric IDs in patterns, repository entries, captures, injections and external grammars; begin/end/while captures; exact token scopes/ranges; unchanged caller input and independent registries.
Validation:
npm run bundlefails identically on baseline and patch because webpack expectsout/main.jswhile TypeScript emitsout/src/main.js. API extraction is not reached. This existing packaging failure is outside this tokenizer change.Fixes #229.