]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-104169: Refactor tokenizer into lexer and wrappers (#110684)
authorLysandros Nikolaou <lisandrosnik@gmail.com>
Wed, 11 Oct 2023 15:14:44 +0000 (17:14 +0200)
committerGitHub <noreply@github.com>
Wed, 11 Oct 2023 15:14:44 +0000 (15:14 +0000)
commit01481f2dc13341c84b64d6dffc08ffed022712a6
tree706f721ed9a7e5fa7e1c6cb3c3026191c7c95475
parenteb50cd37eac47dd4dc71ab42d0582dfb6eac4515
gh-104169: Refactor tokenizer into lexer and wrappers (#110684)

* 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>
29 files changed:
Makefile.pre.in
Misc/NEWS.d/next/Core and Builtins/2023-10-11-12-48-03.gh-issue-104169.bPoX8u.rst [new file with mode: 0644]
PCbuild/_freeze_module.vcxproj
PCbuild/_freeze_module.vcxproj.filters
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters
Parser/action_helpers.c
Parser/lexer/buffer.c [new file with mode: 0644]
Parser/lexer/buffer.h [new file with mode: 0644]
Parser/lexer/lexer.c [new file with mode: 0644]
Parser/lexer/lexer.h [new file with mode: 0644]
Parser/lexer/state.c [new file with mode: 0644]
Parser/lexer/state.h [moved from Parser/tokenizer.h with 85% similarity]
Parser/peg_api.c
Parser/pegen.c
Parser/pegen_errors.c
Parser/string_parser.c
Parser/tokenizer.c [deleted file]
Parser/tokenizer/file_tokenizer.c [new file with mode: 0644]
Parser/tokenizer/helpers.c [new file with mode: 0644]
Parser/tokenizer/helpers.h [new file with mode: 0644]
Parser/tokenizer/readline_tokenizer.c [new file with mode: 0644]
Parser/tokenizer/string_tokenizer.c [new file with mode: 0644]
Parser/tokenizer/tokenizer.h [new file with mode: 0644]
Parser/tokenizer/utf8_tokenizer.c [new file with mode: 0644]
Python/Python-tokenize.c
Tools/c-analyzer/cpython/ignored.tsv
configure
configure.ac