local tokens can self reference #19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "local_tokens_can_self_reference"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -34,2 +34,3 @@"mocha": "^10.2.0""mocha": "^10.2.0","ts-node": "^10.9.2"},I had to add
ts-nodeotherwise I couldn't run tests. Not sure if it was just my machine, but whatever.@ -34,2 +34,3 @@"mocha": "^10.2.0""mocha": "^10.2.0","ts-node": "^10.9.2"},Probably due to
github.com/lezer-parser/generator@d827142436/.mocharc.cjs (L4)I've added the ts-node dependency in
df7c098f93What does "local tokens can self reference" mean? What problem does this PR solve?
Sorry I was perhaps too terse in my nonexistent description 😅
In the following:
LetterreferencesYandZin the local tokens block. It is "self-referencing". Please see the test for a more complete example.This PR breaks out of the for loop early if
ruleis found. (In a way you can think of the original behavior as a bug because it doesn't make sense to writeundefinedintoruleonce it has been found.)Without breaking out early, the test fails with:
Error: Reference to token rule 'Y', which isn't found.That makes sense. Merged!
Just wondering, is it worth cutting a release for this? (I can always pnpm patch for my own proj, but I was just wondering if you were holding off for some reason.)
Done!