Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f336f41c
Commit
f336f41c
authored
Jan 15, 2012
by
Meador Inge
Browse files
Options
Browse Files
Download
Plain Diff
Issue #13629: Renumber the tokens in token.h to match the _PyParser_TokenNames indexes.
parents
b5b4eb19
597d29ba
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
76 deletions
+78
-76
Include/token.h
Include/token.h
+30
-31
Lib/token.py
Lib/token.py
+30
-30
Misc/NEWS
Misc/NEWS
+3
-0
Python/graminit.c
Python/graminit.c
+15
-15
No files found.
Include/token.h
View file @
f336f41c
...
...
@@ -34,38 +34,37 @@ extern "C" {
#define EQUAL 22
#define DOT 23
#define PERCENT 24
/* #define BACKQUOTE 25 */
#define LBRACE 26
#define RBRACE 27
#define EQEQUAL 28
#define NOTEQUAL 29
#define LESSEQUAL 30
#define GREATEREQUAL 31
#define TILDE 32
#define CIRCUMFLEX 33
#define LEFTSHIFT 34
#define RIGHTSHIFT 35
#define DOUBLESTAR 36
#define PLUSEQUAL 37
#define MINEQUAL 38
#define STAREQUAL 39
#define SLASHEQUAL 40
#define PERCENTEQUAL 41
#define AMPEREQUAL 42
#define VBAREQUAL 43
#define CIRCUMFLEXEQUAL 44
#define LEFTSHIFTEQUAL 45
#define RIGHTSHIFTEQUAL 46
#define DOUBLESTAREQUAL 47
#define DOUBLESLASH 48
#define DOUBLESLASHEQUAL 49
#define AT 50
#define RARROW 51
#define ELLIPSIS 52
#define LBRACE 25
#define RBRACE 26
#define EQEQUAL 27
#define NOTEQUAL 28
#define LESSEQUAL 29
#define GREATEREQUAL 30
#define TILDE 31
#define CIRCUMFLEX 32
#define LEFTSHIFT 33
#define RIGHTSHIFT 34
#define DOUBLESTAR 35
#define PLUSEQUAL 36
#define MINEQUAL 37
#define STAREQUAL 38
#define SLASHEQUAL 39
#define PERCENTEQUAL 40
#define AMPEREQUAL 41
#define VBAREQUAL 42
#define CIRCUMFLEXEQUAL 43
#define LEFTSHIFTEQUAL 44
#define RIGHTSHIFTEQUAL 45
#define DOUBLESTAREQUAL 46
#define DOUBLESLASH 47
#define DOUBLESLASHEQUAL 48
#define AT 49
#define RARROW 50
#define ELLIPSIS 51
/* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */
#define OP 5
3
#define ERRORTOKEN 5
4
#define N_TOKENS 5
5
#define OP 5
2
#define ERRORTOKEN 5
3
#define N_TOKENS 5
4
/* Special definitions for cooperation with parser */
...
...
Lib/token.py
View file @
f336f41c
...
...
@@ -35,36 +35,36 @@ GREATER = 21
EQUAL
=
22
DOT
=
23
PERCENT
=
24
LBRACE
=
2
6
RBRACE
=
2
7
EQEQUAL
=
2
8
NOTEQUAL
=
2
9
LESSEQUAL
=
30
GREATEREQUAL
=
3
1
TILDE
=
3
2
CIRCUMFLEX
=
3
3
LEFTSHIFT
=
3
4
RIGHTSHIFT
=
3
5
DOUBLESTAR
=
3
6
PLUSEQUAL
=
3
7
MINEQUAL
=
3
8
STAREQUAL
=
3
9
SLASHEQUAL
=
40
PERCENTEQUAL
=
4
1
AMPEREQUAL
=
4
2
VBAREQUAL
=
4
3
CIRCUMFLEXEQUAL
=
4
4
LEFTSHIFTEQUAL
=
4
5
RIGHTSHIFTEQUAL
=
4
6
DOUBLESTAREQUAL
=
4
7
DOUBLESLASH
=
4
8
DOUBLESLASHEQUAL
=
4
9
AT
=
50
RARROW
=
5
1
ELLIPSIS
=
5
2
OP
=
5
3
ERRORTOKEN
=
5
4
N_TOKENS
=
5
5
LBRACE
=
2
5
RBRACE
=
2
6
EQEQUAL
=
2
7
NOTEQUAL
=
2
8
LESSEQUAL
=
29
GREATEREQUAL
=
3
0
TILDE
=
3
1
CIRCUMFLEX
=
3
2
LEFTSHIFT
=
3
3
RIGHTSHIFT
=
3
4
DOUBLESTAR
=
3
5
PLUSEQUAL
=
3
6
MINEQUAL
=
3
7
STAREQUAL
=
3
8
SLASHEQUAL
=
39
PERCENTEQUAL
=
4
0
AMPEREQUAL
=
4
1
VBAREQUAL
=
4
2
CIRCUMFLEXEQUAL
=
4
3
LEFTSHIFTEQUAL
=
4
4
RIGHTSHIFTEQUAL
=
4
5
DOUBLESTAREQUAL
=
4
6
DOUBLESLASH
=
4
7
DOUBLESLASHEQUAL
=
4
8
AT
=
49
RARROW
=
5
0
ELLIPSIS
=
5
1
OP
=
5
2
ERRORTOKEN
=
5
3
N_TOKENS
=
5
4
NT_OFFSET
=
256
#--end constants--
...
...
Misc/NEWS
View file @
f336f41c
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.3 Alpha 1?
Core and Builtins
-----------------
- Issue #13629: Renumber the tokens in token.h so that they match the indexes
into _PyParser_TokenNames.
- Issue #13752: Add a casefold() method to str.
- Issue #13761: Add a "flush" keyword argument to the print() function,
...
...
Python/graminit.c
View file @
f336f41c
...
...
@@ -1995,7 +1995,7 @@ static label labels[169] = {
{
258
,
0
},
{
327
,
0
},
{
259
,
0
},
{
50
,
0
},
{
49
,
0
},
{
289
,
0
},
{
7
,
0
},
{
330
,
0
},
...
...
@@ -2007,7 +2007,7 @@ static label labels[169] = {
{
1
,
"def"
},
{
1
,
0
},
{
263
,
0
},
{
5
1
,
0
},
{
5
0
,
0
},
{
302
,
0
},
{
11
,
0
},
{
301
,
0
},
...
...
@@ -2016,7 +2016,7 @@ static label labels[169] = {
{
22
,
0
},
{
12
,
0
},
{
16
,
0
},
{
3
6
,
0
},
{
3
5
,
0
},
{
266
,
0
},
{
267
,
0
},
{
270
,
0
},
...
...
@@ -2033,6 +2033,7 @@ static label labels[169] = {
{
273
,
0
},
{
336
,
0
},
{
311
,
0
},
{
36
,
0
},
{
37
,
0
},
{
38
,
0
},
{
39
,
0
},
...
...
@@ -2043,8 +2044,7 @@ static label labels[169] = {
{
44
,
0
},
{
45
,
0
},
{
46
,
0
},
{
47
,
0
},
{
49
,
0
},
{
48
,
0
},
{
1
,
"del"
},
{
326
,
0
},
{
1
,
"pass"
},
...
...
@@ -2063,7 +2063,7 @@ static label labels[169] = {
{
1
,
"import"
},
{
288
,
0
},
{
23
,
0
},
{
5
2
,
0
},
{
5
1
,
0
},
{
287
,
0
},
{
285
,
0
},
{
1
,
"as"
},
...
...
@@ -2105,38 +2105,38 @@ static label labels[169] = {
{
310
,
0
},
{
20
,
0
},
{
21
,
0
},
{
28
,
0
},
{
31
,
0
},
{
27
,
0
},
{
30
,
0
},
{
29
,
0
},
{
29
,
0
},
{
28
,
0
},
{
28
,
0
},
{
1
,
"is"
},
{
313
,
0
},
{
18
,
0
},
{
314
,
0
},
{
3
3
,
0
},
{
3
2
,
0
},
{
315
,
0
},
{
19
,
0
},
{
316
,
0
},
{
33
,
0
},
{
34
,
0
},
{
35
,
0
},
{
317
,
0
},
{
14
,
0
},
{
15
,
0
},
{
318
,
0
},
{
17
,
0
},
{
24
,
0
},
{
4
8
,
0
},
{
3
2
,
0
},
{
4
7
,
0
},
{
3
1
,
0
},
{
319
,
0
},
{
320
,
0
},
{
322
,
0
},
{
321
,
0
},
{
9
,
0
},
{
10
,
0
},
{
2
6
,
0
},
{
2
5
,
0
},
{
328
,
0
},
{
2
7
,
0
},
{
2
6
,
0
},
{
2
,
0
},
{
3
,
0
},
{
1
,
"None"
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment