-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
gh-104169: Refactor tokenizer into lexer and wrappers #110684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-104169: Refactor tokenizer into lexer and wrappers #110684
Conversation
* The lexer, which include the actual lexeme producing logic, goes into the `lexer` directory. * The wrappers, one wrapper per input mode (file, string, utf-8, and readline), go into the `tokenizer` directory and include logic for creating a lexer instance and managing the buffer for different modes.
3661d27
to
a4190a9
Compare
if (tok->done != E_OK) { | ||
return EOF; | ||
} | ||
rc = tok->underflow(tok); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pablogsal This is the only change I did here. Instead of calling underflow
according to stuff like tok->str
, every tokenizer type passes in a callable that handles underflow
in _PyTokenizer_From*
.
|
|
|
|
|
|
|
…10684) * The lexer, which include the actual lexeme producing logic, goes into the `lexer` directory. * The wrappers, one wrapper per input mode (file, string, utf-8, and readline), go into the `tokenizer` directory and include logic for creating a lexer instance and managing the buffer for different modes. --------- Co-authored-by: Pablo Galindo <[email protected]> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
lexer
directory.tokenizer
directory and include logic for creating a lexer instance and managing the buffer for different modes.