Repository navigation
fix: keep unclosed subscript recovery linear - #20
Open
everton-dgn wants to merge 1 commit into
Open
everton-dgn wants to merge 1 commit into
everton-dgn wants to merge 1 commit into
Conversation
|
Thanks for the fix, @everton-dgn. I reviewed this against #14 and the results look good. What I tested (head b071427 vs its merge-base 61b82c2, which is current main; Node 24, built with plain
I did not find a concern. This is differential evidence over the corpora above, not a proof of equivalence. One reading note: the per-start-position cache is only filled from positions the search actually visited and only when no errors were recorded, which matches the comment about not caching inside skipped quote/comment syntax. The 28,192 targeted cases above did not find a case where that breaks down. |
Author
|
Thanks for the review and for the differential runs against #14. Let me know if anything else is needed before merging. |
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.
Repeated unclosed subscripts followed by a final
]make recovery scan the remaining input again for each command. This caches bracket results after a failed search, only at positions the lexer visited, so recovery can still reinterpret quotes and comments correctly.For the 256-line case in the issue, character reads fall from 204,539 to 10,737. The regression checks growth in reads rather than elapsed time and preserves the later-assignment checks.
The full 2,060-test suite passed on Node 24. After the final syntax adjustment, 263 focused tests, type checks, lint, formatting and the runtime smoke test passed. I couldn't run the Node 14 smoke test on this arm64 Mac; CI still needs to cover it.
Fixes #14