From eec2d768cd1567345d7191f55f1818303e9130f1 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 17 Oct 2010 09:46:11 +0000 Subject: #8968: add actual name of token constants. --- Doc/library/token.rst | 63 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/Doc/library/token.rst b/Doc/library/token.rst index bc5c19e..991762f 100644 --- a/Doc/library/token.rst +++ b/Doc/library/token.rst @@ -12,8 +12,8 @@ in the Python distribution for the definitions of the names in the context of the language grammar. The specific numeric values which the names map to may change between Python versions. -This module also provides one data object and some functions. The functions -mirror definitions in the Python C header files. +The module also provides a mapping from numeric codes to names and some +functions. The functions mirror definitions in the Python C header files. .. data:: tok_name @@ -38,6 +38,65 @@ mirror definitions in the Python C header files. Return true if *x* is the marker indicating the end of input. +The token constants are: + +.. data:: ENDMARKER + NAME + NUMBER + STRING + NEWLINE + INDENT + DEDENT + LPAR + RPAR + LSQB + RSQB + COLON + COMMA + SEMI + PLUS + MINUS + STAR + SLASH + VBAR + AMPER + LESS + GREATER + EQUAL + DOT + PERCENT + BACKQUOTE + LBRACE + RBRACE + EQEQUAL + NOTEQUAL + LESSEQUAL + GREATEREQUAL + TILDE + CIRCUMFLEX + LEFTSHIFT + RIGHTSHIFT + DOUBLESTAR + PLUSEQUAL + MINEQUAL + STAREQUAL + SLASHEQUAL + PERCENTEQUAL + AMPEREQUAL + VBAREQUAL + CIRCUMFLEXEQUAL + LEFTSHIFTEQUAL + RIGHTSHIFTEQUAL + DOUBLESTAREQUAL + DOUBLESLASH + DOUBLESLASHEQUAL + AT + OP + ERRORTOKEN + N_TOKENS + NT_OFFSET + + .. seealso:: Module :mod:`parser` -- cgit v0.12