diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2019-03-04 07:26:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-04 07:26:13 (GMT) |
commit | 8bc401a55ce5dfcdd225c20786ba8e221a0bf29b (patch) | |
tree | e4af4e10c64a0a02c17feea7a2916e1b9d5ae209 /Parser/pgen/token.py | |
parent | 97c288df614dd7856f5a0336925f56a7a2a5bc74 (diff) | |
download | cpython-8bc401a55ce5dfcdd225c20786ba8e221a0bf29b.zip cpython-8bc401a55ce5dfcdd225c20786ba8e221a0bf29b.tar.gz cpython-8bc401a55ce5dfcdd225c20786ba8e221a0bf29b.tar.bz2 |
Clean implementation of Parser/pgen and fix some style issues (GH-12156)
Diffstat (limited to 'Parser/pgen/token.py')
-rw-r--r-- | Parser/pgen/token.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Parser/pgen/token.py b/Parser/pgen/token.py index f9d45c4..008e241 100644 --- a/Parser/pgen/token.py +++ b/Parser/pgen/token.py @@ -1,5 +1,6 @@ import itertools + def generate_tokens(tokens): numbers = itertools.count(0) for line in tokens: @@ -16,6 +17,7 @@ def generate_tokens(tokens): yield ('N_TOKENS', next(numbers)) yield ('NT_OFFSET', 256) + def generate_opmap(tokens): for line in tokens: line = line.strip() |