mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
GH-98831: Refactor and fix cases generator (#99526)
Also complete cache effects for BINARY_SUBSCR family.
This commit is contained in:
parent
b629fdd88a
commit
4f5e1cb00a
6 changed files with 403 additions and 306 deletions
|
|
@ -115,7 +115,7 @@ newline = r"\n"
|
|||
matcher = re.compile(choice(id_re, number_re, str_re, char, newline, macro, comment_re, *operators.values()))
|
||||
letter = re.compile(r'[a-zA-Z_]')
|
||||
|
||||
keywords = (
|
||||
kwds = (
|
||||
'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST',
|
||||
'CONTINUE', 'DEFAULT', 'DO', 'DOUBLE', 'ELSE', 'ENUM', 'EXTERN',
|
||||
'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG',
|
||||
|
|
@ -124,9 +124,9 @@ keywords = (
|
|||
'SWITCH', 'TYPEDEF', 'UNION', 'UNSIGNED', 'VOID',
|
||||
'VOLATILE', 'WHILE'
|
||||
)
|
||||
for name in keywords:
|
||||
for name in kwds:
|
||||
globals()[name] = name
|
||||
keywords = { name.lower() : name for name in keywords }
|
||||
keywords = { name.lower() : name for name in kwds }
|
||||
|
||||
|
||||
def make_syntax_error(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue