mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-133555: Allow regenerating the parser with Python < 3.14 (#133557)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
parent
90f476e0f8
commit
b48599b801
2 changed files with 10 additions and 0 deletions
|
|
@ -81,6 +81,11 @@ def __init__(self, rules: Dict[str, Rule], tokens: Set[str]):
|
|||
self.tokens.add("FSTRING_START")
|
||||
self.tokens.add("FSTRING_END")
|
||||
self.tokens.add("FSTRING_MIDDLE")
|
||||
# If python < 3.14 add the virtual tstring tokens
|
||||
if sys.version_info < (3, 14, 0, 'beta', 1):
|
||||
self.tokens.add("TSTRING_START")
|
||||
self.tokens.add("TSTRING_END")
|
||||
self.tokens.add("TSTRING_MIDDLE")
|
||||
|
||||
def visit_NameLeaf(self, node: NameLeaf) -> None:
|
||||
if node.value not in self.rules and node.value not in self.tokens:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue