gh-153569: consolidate tokenizer source and lexer state - #156484
Open
pablogsal wants to merge 7 commits into
Open
gh-153569: consolidate tokenizer source and lexer state#156484pablogsal wants to merge 7 commits into
pablogsal wants to merge 7 commits into
Conversation
Member
Author
|
Do not review until #156482 lands. |
pablogsal
force-pushed
the
gh-153569-tokenizer-validation-tools-clean
branch
from
August 28, 2026 18:40
5505010 to
68400fb
Compare
pablogsal
force-pushed
the
gh-153569-tokenizer-validation-tools-clean
branch
3 times, most recently
from
August 28, 2026 23:48
962c0c5 to
eae3e33
Compare
pablogsal
force-pushed
the
gh-153569-tokenizer-validation-tools-clean
branch
from
August 30, 2026 11:12
73741c4 to
3ce81ac
Compare
pablogsal
force-pushed
the
gh-153569-tokenizer-validation-tools-clean
branch
2 times, most recently
from
August 30, 2026 11:26
6e223e0 to
64893b4
Compare
pablogsal
force-pushed
the
gh-153569-tokenizer-validation-tools-clean
branch
from
August 30, 2026 13:16
64893b4 to
bdeeeb6
Compare
pablogsal
force-pushed
the
gh-153569-tokenizer-validation-tools-clean
branch
3 times, most recently
from
September 5, 2026 17:46
9318772 to
056e86e
Compare
pablogsal
force-pushed
the
gh-153569-tokenizer-validation-tools-clean
branch
3 times, most recently
from
September 6, 2026 20:24
da9dfb7 to
1a1a3c7
Compare
pablogsal
marked this pull request as ready for review
September 6, 2026 20:31
pablogsal
requested review from
a team,
AA-Turner,
emmatyping,
erlend-aasland,
itamaro and
lysnikolaou
as code owners
September 6, 2026 20:31
pablogsal
force-pushed
the
gh-153569-tokenizer-validation-tools-clean
branch
from
September 6, 2026 20:57
1a1a3c7 to
3ef307f
Compare
Formatted-string expressions and comments can outlive the buffer window where scanning began. Pointer boundaries require buffer relocation to repair tokenizer state. Record logical source ranges instead. Retain the active input window while a formatted string is open, give each mode ownership of its comment spans, and materialize text through shared span views.
pablogsal
force-pushed
the
gh-153569-tokenizer-validation-tools-clean
branch
from
September 6, 2026 21:37
3ef307f to
177eca5
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.
Consolidate tokenizer source and lexer state after #156482.
Replace the generic lexer mode array with active formatted-string frames that hold expression and comment spans. Carry raw-string context with emitted and cached parser tokens, so interpreting a token does not depend on the current frame. Keep field entry, punctuation, closing, and debug-expression transitions together in the string scanner, with explicit dispatch over its three modes.
Group indentation and logical-line state in a dedicated layout module, with operations for leading whitespace, continuations, pending indent/dedent tokens, and newline classification. Keep normal and alternate indentation columns together in each stack entry.
Give the reader ownership of input-specific state and source-retention decisions. Derive locations and failure status from existing scanner state, and keep buffer relocation inside the reader instead of a separate lexer buffer layer.
#156654 builds on this to replace the remaining scanner pointers and complete the opaque consumer API.