Skip to content

Align peeked token handling with reuse (fixes bug that statements were not reused) - #24

Merged
gafter merged 7 commits into
mainfrom
statement-node-reuse-tests
Feb 4, 2026
Merged

gafter merged 7 commits into
mainfrom
statement-node-reuse-tests

Conversation

@gafter

@gafter gafter commented Feb 4, 2026

Copy link
Copy Markdown
Owner

Keep peeked tokens on the stack unless lexed from text, and track whether a peeked token was popped to preserve reuse.

gafter and others added 7 commits February 4, 2026 09:53
Keep peeked tokens on the stack unless lexed from text, and
track whether a peeked token was popped to preserve reuse.

Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid asserting trailing statement reuse when the statement
contains the change span, instead of expanding suffix limits.

Co-authored-by: Cursor <cursoragent@cursor.com>
Introduce a many-seed statement reuse finder test to mirror the
existing token reuse stress case.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add a many-seed statement reuse finder for erroneous programs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Track and print prefix/suffix statement reuse totals for each
incremental change case.

Co-authored-by: Cursor <cursoragent@cursor.com>
Skip the debug-only invalid program tree dump and reduce the
statement reuse stress test ranges for quicker runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align PeekTokenCore with non-terminal stack positions and
continue trailing statement reuse checks past spanning statements.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gafter gafter changed the title Align peeked token handling with reuse Align peeked token handling with reuse (fixes bug that statements were not reused) Feb 4, 2026
@gafter
gafter merged commit 8a2a8e3 into main Feb 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant