Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3)

Unified Diff: Include/token.h

Issue 3353: make built-in tokenizer available via Python C API
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Include/Python.h ('k') | Include/tokenizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Include/token.h
+++ b/Include/token.h
@@ -7,73 +7,73 @@
extern "C" {
#endif
-#undef TILDE /* Prevent clash of our definition with system macro. Ex AIX, ioctl.h */
+#undef PYTOK_TILDE /* Prevent clash of our definition with system macro. Ex AIX, ioctl.h */
-#define ENDMARKER 0
-#define NAME 1
-#define NUMBER 2
-#define STRING 3
-#define NEWLINE 4
-#define INDENT 5
-#define DEDENT 6
-#define LPAR 7
-#define RPAR 8
-#define LSQB 9
-#define RSQB 10
-#define COLON 11
-#define COMMA 12
-#define SEMI 13
-#define PLUS 14
-#define MINUS 15
-#define STAR 16
-#define SLASH 17
-#define VBAR 18
-#define AMPER 19
-#define LESS 20
-#define GREATER 21
-#define EQUAL 22
-#define DOT 23
-#define PERCENT 24
-#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 ATEQUAL 50
-#define RARROW 51
-#define ELLIPSIS 52
+#define PYTOK_ENDMARKER 0
+#define PYTOK_NAME 1
+#define PYTOK_NUMBER 2
+#define PYTOK_STRING 3
+#define PYTOK_NEWLINE 4
+#define PYTOK_INDENT 5
+#define PYTOK_DEDENT 6
+#define PYTOK_LPAR 7
+#define PYTOK_RPAR 8
+#define PYTOK_LSQB 9
+#define PYTOK_RSQB 10
+#define PYTOK_COLON 11
+#define PYTOK_COMMA 12
+#define PYTOK_SEMI 13
+#define PYTOK_PLUS 14
+#define PYTOK_MINUS 15
+#define PYTOK_STAR 16
+#define PYTOK_SLASH 17
+#define PYTOK_VBAR 18
+#define PYTOK_AMPER 19
+#define PYTOK_LESS 20
+#define PYTOK_GREATER 21
+#define PYTOK_EQUAL 22
+#define PYTOK_DOT 23
+#define PYTOK_PERCENT 24
+#define PYTOK_LBRACE 25
+#define PYTOK_RBRACE 26
+#define PYTOK_EQEQUAL 27
+#define PYTOK_NOTEQUAL 28
+#define PYTOK_LESSEQUAL 29
+#define PYTOK_GREATEREQUAL 30
+#define PYTOK_TILDE 31
+#define PYTOK_CIRCUMFLEX 32
+#define PYTOK_LEFTSHIFT 33
+#define PYTOK_RIGHTSHIFT 34
+#define PYTOK_DOUBLESTAR 35
+#define PYTOK_PLUSEQUAL 36
+#define PYTOK_MINEQUAL 37
+#define PYTOK_STAREQUAL 38
+#define PYTOK_SLASHEQUAL 39
+#define PYTOK_PERCENTEQUAL 40
+#define PYTOK_AMPEREQUAL 41
+#define PYTOK_VBAREQUAL 42
+#define PYTOK_CIRCUMFLEXEQUAL 43
+#define PYTOK_LEFTSHIFTEQUAL 44
+#define PYTOK_RIGHTSHIFTEQUAL 45
+#define PYTOK_DOUBLESTAREQUAL 46
+#define PYTOK_DOUBLESLASH 47
+#define PYTOK_DOUBLESLASHEQUAL 48
+#define PYTOK_AT 49
+#define PYTOK_ATEQUAL 50
+#define PYTOK_RARROW 51
+#define PYTOK_ELLIPSIS 52
/* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */
-#define OP 53
-#define ERRORTOKEN 54
-#define N_TOKENS 55
+#define PYTOK_OP 53
+#define PYTOK_ERRORTOKEN 54
+#define PYTOK_N_TOKENS 55
/* Special definitions for cooperation with parser */
-#define NT_OFFSET 256
+#define PYTOK_NT_OFFSET 256
-#define ISTERMINAL(x) ((x) < NT_OFFSET)
-#define ISNONTERMINAL(x) ((x) >= NT_OFFSET)
-#define ISEOF(x) ((x) == ENDMARKER)
+#define PYTOK_ISTERMINAL(x) ((x) < PYTOK_NT_OFFSET)
+#define PYTOK_ISNONTERMINAL(x) ((x) >= PYTOK_NT_OFFSET)
+#define PYTOK_ISEOF(x) ((x) == PYTOK_ENDMARKER)
PyAPI_DATA(const char *) _PyParser_TokenNames[]; /* Token names */
« no previous file with comments | « Include/Python.h ('k') | Include/tokenizer.h » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+