diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-22 11:18:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-22 11:18:40 +0200 |
| commit | 8ac658114dec4964479baecfbc439fceb40eaa79 (patch) | |
| tree | e66c4c3beda293a6fdf01763306697d15d0af157 /Lib/test/test_symbol.py | |
| parent | c1b4b0f6160e1919394586f44b12538505fed300 (diff) | |
| download | cpython-git-8ac658114dec4964479baecfbc439fceb40eaa79.tar.gz | |
bpo-30455: Generate all token related code and docs from Grammar/Tokens. (GH-10370)
"Include/token.h", "Lib/token.py" (containing now some data moved from
"Lib/tokenize.py") and new files "Parser/token.c" (containing the code
moved from "Parser/tokenizer.c") and "Doc/library/token-list.inc" (included
in "Doc/library/token.rst") are now generated from "Grammar/Tokens" by
"Tools/scripts/generate_token.py". The script overwrites files only if
needed and can be used on the read-only sources tree.
"Lib/symbol.py" is now generated by "Tools/scripts/generate_symbol_py.py"
instead of been executable itself.
Added new make targets "regen-token" and "regen-symbol" which are now
dependencies of "regen-all".
The documentation contains now strings for operators and punctuation tokens.
Diffstat (limited to 'Lib/test/test_symbol.py')
| -rw-r--r-- | Lib/test/test_symbol.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_symbol.py b/Lib/test/test_symbol.py index c1306f5432..ed86aec36b 100644 --- a/Lib/test/test_symbol.py +++ b/Lib/test/test_symbol.py @@ -6,6 +6,9 @@ import subprocess SYMBOL_FILE = support.findfile('symbol.py') +GEN_SYMBOL_FILE = os.path.join(os.path.dirname(__file__), + '..', '..', 'Tools', 'scripts', + 'generate_symbol_py.py') GRAMMAR_FILE = os.path.join(os.path.dirname(__file__), '..', '..', 'Include', 'graminit.h') TEST_PY_FILE = 'symbol_test.py' @@ -22,7 +25,7 @@ class TestSymbolGeneration(unittest.TestCase): def _generate_symbols(self, grammar_file, target_symbol_py_file): proc = subprocess.Popen([sys.executable, - SYMBOL_FILE, + GEN_SYMBOL_FILE, grammar_file, target_symbol_py_file], stderr=subprocess.PIPE) stderr = proc.communicate()[1] |
