summaryrefslogtreecommitdiffstats
path: root/PCbuild
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2023-10-11 15:14:44 (GMT)
committerGitHub <noreply@github.com>2023-10-11 15:14:44 (GMT)
commit01481f2dc13341c84b64d6dffc08ffed022712a6 (patch)
tree706f721ed9a7e5fa7e1c6cb3c3026191c7c95475 /PCbuild
parenteb50cd37eac47dd4dc71ab42d0582dfb6eac4515 (diff)
downloadcpython-01481f2dc13341c84b64d6dffc08ffed022712a6.zip
cpython-01481f2dc13341c84b64d6dffc08ffed022712a6.tar.gz
cpython-01481f2dc13341c84b64d6dffc08ffed022712a6.tar.bz2
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>
Diffstat (limited to 'PCbuild')
-rw-r--r--PCbuild/_freeze_module.vcxproj9
-rw-r--r--PCbuild/_freeze_module.vcxproj.filters23
-rw-r--r--PCbuild/pythoncore.vcxproj15
-rw-r--r--PCbuild/pythoncore.vcxproj.filters37
4 files changed, 78 insertions, 6 deletions
diff --git a/PCbuild/_freeze_module.vcxproj b/PCbuild/_freeze_module.vcxproj
index bdcf29b..aaa63fe 100644
--- a/PCbuild/_freeze_module.vcxproj
+++ b/PCbuild/_freeze_module.vcxproj
@@ -172,7 +172,14 @@
<ClCompile Include="..\Parser\action_helpers.c" />
<ClCompile Include="..\Parser\string_parser.c" />
<ClCompile Include="..\Parser\token.c" />
- <ClCompile Include="..\Parser\tokenizer.c" />
+ <ClCompile Include="..\Parser\lexer\buffer.c" />
+ <ClCompile Include="..\Parser\lexer\state.c" />
+ <ClCompile Include="..\Parser\lexer\lexer.c" />
+ <ClCompile Include="..\Parser\tokenizer\string_tokenizer.c" />
+ <ClCompile Include="..\Parser\tokenizer\file_tokenizer.c" />
+ <ClCompile Include="..\Parser\tokenizer\utf8_tokenizer.c" />
+ <ClCompile Include="..\Parser\tokenizer\readline_tokenizer.c" />
+ <ClCompile Include="..\Parser\tokenizer\helpers.c" />
<ClCompile Include="..\PC\invalid_parameter_handler.c" />
<ClCompile Include="..\PC\msvcrtmodule.c" />
<ClCompile Include="..\PC\winreg.c" />
diff --git a/PCbuild/_freeze_module.vcxproj.filters b/PCbuild/_freeze_module.vcxproj.filters
index 45333fa..279736b 100644
--- a/PCbuild/_freeze_module.vcxproj.filters
+++ b/PCbuild/_freeze_module.vcxproj.filters
@@ -397,7 +397,28 @@
<ClCompile Include="..\Parser\token.c">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\Parser\tokenizer.c">
+ <ClCompile Include="..\Parser\lexer\lexer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Parser\lexer\buffer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Parser\lexer\state.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Parser\tokenizer\string_tokenizer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Parser\tokenizer\utf8_tokenizer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Parser\tokenizer\file_tokenizer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Parser\tokenizer\readline_tokenizer.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Parser\tokenizer\helpers.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\Python\traceback.c">
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index 43a79fd..f240779 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -362,7 +362,11 @@
<ClInclude Include="..\Objects\stringlib\replace.h" />
<ClInclude Include="..\Objects\stringlib\split.h" />
<ClInclude Include="..\Objects\unicodetype_db.h" />
- <ClInclude Include="..\Parser\tokenizer.h" />
+ <ClInclude Include="..\Parser\lexer\state.h" />
+ <ClInclude Include="..\Parser\lexer\lexer.h" />
+ <ClInclude Include="..\Parser\lexer\buffer.h" />
+ <ClInclude Include="..\Parser\tokenizer\helpers.h" />
+ <ClInclude Include="..\Parser\tokenizer\tokenizer.h" />
<ClInclude Include="..\Parser\string_parser.h" />
<ClInclude Include="..\Parser\pegen.h" />
<ClInclude Include="..\PC\errmap.h" />
@@ -507,7 +511,14 @@
<ClCompile Include="..\Objects\unionobject.c" />
<ClCompile Include="..\Objects\weakrefobject.c" />
<ClCompile Include="..\Parser\myreadline.c" />
- <ClCompile Include="..\Parser\tokenizer.c" />
+ <ClCompile Include="..\Parser\lexer\state.c" />
+ <ClCompile Include="..\Parser\lexer\lexer.c" />
+ <ClCompile Include="..\Parser\lexer\buffer.c" />
+ <ClCompile Include="..\Parser\tokenizer\string_tokenizer.c" />
+ <ClCompile Include="..\Parser\tokenizer\file_tokenizer.c" />
+ <ClCompile Include="..\Parser\tokenizer\utf8_tokenizer.c" />
+ <ClCompile Include="..\Parser\tokenizer\readline_tokenizer.c" />
+ <ClCompile Include="..\Parser\tokenizer\helpers.c" />
<ClCompile Include="..\Parser\token.c" />
<ClCompile Include="..\Parser\pegen.c" />
<ClCompile Include="..\Parser\pegen_errors.c" />
diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters
index 59159ed..6e13eb8 100644
--- a/PCbuild/pythoncore.vcxproj.filters
+++ b/PCbuild/pythoncore.vcxproj.filters
@@ -291,7 +291,19 @@
<ClInclude Include="..\Objects\unicodetype_db.h">
<Filter>Objects</Filter>
</ClInclude>
- <ClInclude Include="..\Parser\tokenizer.h">
+ <ClInclude Include="..\Parser\lexer\lexer.h">
+ <Filter>Parser</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Parser\lexer\state.h">
+ <Filter>Parser</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Parser\lexer\buffer.h">
+ <Filter>Parser</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Parser\tokenizer\tokenizer.h">
+ <Filter>Parser</Filter>
+ </ClInclude>
+ <ClInclude Include="..\Parser\tokenizer\helpers.h">
<Filter>Parser</Filter>
</ClInclude>
<ClInclude Include="..\PC\errmap.h">
@@ -1139,7 +1151,28 @@
<ClCompile Include="..\Parser\myreadline.c">
<Filter>Parser</Filter>
</ClCompile>
- <ClCompile Include="..\Parser\tokenizer.c">
+ <ClCompile Include="..\Parser\lexer\lexer.c">
+ <Filter>Parser</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Parser\lexer\state.c">
+ <Filter>Parser</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Parser\lexer\buffer.c">
+ <Filter>Parser</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Parser\tokenizer\string_tokenizer.c">
+ <Filter>Parser</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Parser\tokenizer\file_tokenizer.c">
+ <Filter>Parser</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Parser\tokenizer\utf8_tokenizer.c">
+ <Filter>Parser</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Parser\tokenizer\readline_tokenizer.c">
+ <Filter>Parser</Filter>
+ </ClCompile>
+ <ClCompile Include="..\Parser\tokenizer\helpers.c">
<Filter>Parser</Filter>
</ClCompile>
<ClCompile Include="..\Parser\token.c">