mirror of https://github.com/python/cpython.git
bpo-33260: Regenerate token.py after removing ASYNC and AWAIT. (GH-6447)
This commit is contained in:
parent
c4b695f85e
commit
d08972fdb9
|
@ -172,7 +172,7 @@ Common syntax elements for comprehensions are:
|
||||||
|
|
||||||
.. productionlist::
|
.. productionlist::
|
||||||
comprehension: `expression` `comp_for`
|
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_iter: `comp_for` | `comp_if`
|
||||||
comp_if: "if" `expression_nocond` [`comp_iter`]
|
comp_if: "if" `expression_nocond` [`comp_iter`]
|
||||||
|
|
||||||
|
|
12
Lib/token.py
12
Lib/token.py
|
@ -65,14 +65,12 @@ RARROW = 51
|
||||||
ELLIPSIS = 52
|
ELLIPSIS = 52
|
||||||
# Don't forget to update the table _PyParser_TokenNames in tokenizer.c!
|
# Don't forget to update the table _PyParser_TokenNames in tokenizer.c!
|
||||||
OP = 53
|
OP = 53
|
||||||
AWAIT = 54
|
ERRORTOKEN = 54
|
||||||
ASYNC = 55
|
|
||||||
ERRORTOKEN = 56
|
|
||||||
# These aren't used by the C tokenizer but are needed for tokenize.py
|
# These aren't used by the C tokenizer but are needed for tokenize.py
|
||||||
COMMENT = 57
|
COMMENT = 55
|
||||||
NL = 58
|
NL = 56
|
||||||
ENCODING = 59
|
ENCODING = 57
|
||||||
N_TOKENS = 60
|
N_TOKENS = 58
|
||||||
# Special definitions for cooperation with parser
|
# Special definitions for cooperation with parser
|
||||||
NT_OFFSET = 256
|
NT_OFFSET = 256
|
||||||
#--end constants--
|
#--end constants--
|
||||||
|
|
|
@ -284,7 +284,7 @@ def compat(self, token, iterable):
|
||||||
self.encoding = tokval
|
self.encoding = tokval
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if toknum in (NAME, NUMBER, ASYNC, AWAIT):
|
if toknum in (NAME, NUMBER):
|
||||||
tokval += ' '
|
tokval += ' '
|
||||||
|
|
||||||
# Insert a space between two consecutive strings
|
# Insert a space between two consecutive strings
|
||||||
|
|
Loading…
Reference in New Issue