commit | 8bc401a55ce5dfcdd225c20786ba8e221a0bf29b | [log] [tgz] |
---|---|---|
author | Pablo Galindo <Pablogsal@gmail.com> | Mon Mar 04 07:26:13 2019 +0000 |
committer | GitHub <noreply@github.com> | Mon Mar 04 07:26:13 2019 +0000 |
tree | e4af4e10c64a0a02c17feea7a2916e1b9d5ae209 | |
parent | 97c288df614dd7856f5a0336925f56a7a2a5bc74 [diff] [blame] |
Clean implementation of Parser/pgen and fix some style issues (GH-12156)
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 @@ yield ('N_TOKENS', next(numbers)) yield ('NT_OFFSET', 256) + def generate_opmap(tokens): for line in tokens: line = line.strip()