Skip to content

Commit f56a805

Browse files
committed
gh-133555: allow to regenerate the parser with Python < 3.14
1 parent 14291fa commit f56a805

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Tools/peg_generator/pegen/parser_generator.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ def __init__(self, rules: Dict[str, Rule], tokens: Set[str]):
8181
self.tokens.add("FSTRING_START")
8282
self.tokens.add("FSTRING_END")
8383
self.tokens.add("FSTRING_MIDDLE")
84+
# If python < 3.14 add the virtual tstring tokens
85+
if sys.version_info < (3, 14):
86+
self.tokens.add("TSTRING_START")
87+
self.tokens.add("TSTRING_END")
88+
self.tokens.add("TSTRING_MIDDLE")
8489

8590
def visit_NameLeaf(self, node: NameLeaf) -> None:
8691
if node.value not in self.rules and node.value not in self.tokens:

0 commit comments

Comments
 (0)