gh-104169: Refactor tokenizer into lexer and wrappers#110684
gh-104169: Refactor tokenizer into lexer and wrappers#110684lysnikolaou merged 12 commits intopython:mainfrom
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.
@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 <pablogsal@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
lexerdirectory.tokenizerdirectory and include logic for creating a lexer instance and managing the buffer for different modes.