mirror of
https://github.com/python/cpython.git
synced 2024-12-19 14:53:39 +08:00
91759d9801
Now that the parser generator is written in Python (Parser/pgen) we can make use of it to regenerate the Lib/keyword file that contains the language keywords instead of parsing the autogenerated grammar files. This also allows checking in the CI that the autogenerated files are up to date.
56 lines
945 B
Python
56 lines
945 B
Python
"""Keywords (from "Grammar/Grammar")
|
|
|
|
This file is automatically generated; please don't muck it up!
|
|
|
|
To update the symbols in this file, 'cd' to the top directory of
|
|
the python source tree and run:
|
|
|
|
python3 -m Parser.pgen.keywordgen Grammar/Grammar \
|
|
Grammar/Tokens \
|
|
Lib/keyword.py
|
|
|
|
Alternatively, you can run 'make regen-keyword'.
|
|
"""
|
|
|
|
__all__ = ["iskeyword", "kwlist"]
|
|
|
|
kwlist = [
|
|
'False',
|
|
'None',
|
|
'True',
|
|
'and',
|
|
'as',
|
|
'assert',
|
|
'async',
|
|
'await',
|
|
'break',
|
|
'class',
|
|
'continue',
|
|
'def',
|
|
'del',
|
|
'elif',
|
|
'else',
|
|
'except',
|
|
'finally',
|
|
'for',
|
|
'from',
|
|
'global',
|
|
'if',
|
|
'import',
|
|
'in',
|
|
'is',
|
|
'lambda',
|
|
'nonlocal',
|
|
'not',
|
|
'or',
|
|
'pass',
|
|
'raise',
|
|
'return',
|
|
'try',
|
|
'while',
|
|
'with',
|
|
'yield'
|
|
]
|
|
|
|
iskeyword = frozenset(kwlist).__contains__
|