summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-04-11 16:15:51 (GMT)
committerGitHub <noreply@github.com>2018-04-11 16:15:51 (GMT)
commitd08972fdb92cad6b813d22205752c97ea18df060 (patch)
treee5c7f912380d8896a70f1c2d6d0f8f9994bdc4f8
parentc4b695f85e141f57d22d8edf7bc2c756da136918 (diff)
downloadcpython-d08972fdb92cad6b813d22205752c97ea18df060.zip
cpython-d08972fdb92cad6b813d22205752c97ea18df060.tar.gz
cpython-d08972fdb92cad6b813d22205752c97ea18df060.tar.bz2
bpo-33260: Regenerate token.py after removing ASYNC and AWAIT. (GH-6447)
-rw-r--r--Doc/reference/expressions.rst2
-rw-r--r--Lib/token.py12
-rw-r--r--Lib/tokenize.py2
3 files changed, 7 insertions, 9 deletions
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index 151062b..e5af927 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -172,7 +172,7 @@ Common syntax elements for comprehensions are:
.. productionlist::
comprehension: `expression` `comp_for`
- comp_for: [ASYNC] "for" `target_list` "in" `or_test` [`comp_iter`]
+ comp_for: ["async"] "for" `target_list` "in" `or_test` [`comp_iter`]
comp_iter: `comp_for` | `comp_if`
comp_if: "if" `expression_nocond` [`comp_iter`]
diff --git a/Lib/token.py b/Lib/token.py
index 091f80b..ba13205 100644
--- a/Lib/token.py
+++ b/Lib/token.py
@@ -65,14 +65,12 @@ RARROW = 51
ELLIPSIS = 52
# Don't forget to update the table _PyParser_TokenNames in tokenizer.c!
OP = 53
-AWAIT = 54
-ASYNC = 55
-ERRORTOKEN = 56
+ERRORTOKEN = 54
# These aren't used by the C tokenizer but are needed for tokenize.py
-COMMENT = 57
-NL = 58
-ENCODING = 59
-N_TOKENS = 60
+COMMENT = 55
+NL = 56
+ENCODING = 57
+N_TOKENS = 58
# Special definitions for cooperation with parser
NT_OFFSET = 256
#--end constants--
diff --git a/Lib/tokenize.py b/Lib/tokenize.py
index f5c6ac7..6528b90 100644
--- a/Lib/tokenize.py
+++ b/Lib/tokenize.py
@@ -284,7 +284,7 @@ class Untokenizer:
self.encoding = tokval
continue
- if toknum in (NAME, NUMBER, ASYNC, AWAIT):
+ if toknum in (NAME, NUMBER):
tokval += ' '
# Insert a space between two consecutive strings