Merge token module into 2and3 (#1146)

* Merge token module; add values from 3.5

* Move token to 2and3

* Switch to ellipsis for token
This commit is contained in:
David Euresti
2017-04-06 21:46:14 -04:00
committed by Matthias Kramm
parent 166e56a8f0
commit 6e75432504
3 changed files with 71 additions and 125 deletions

View File

@@ -1,62 +0,0 @@
from typing import Dict
ENDMARKER = 0
NAME = 0
NUMBER = 0
STRING = 0
NEWLINE = 0
INDENT = 0
DEDENT = 0
LPAR = 0
RPAR = 0
LSQB = 0
RSQB = 0
COLON = 0
COMMA = 0
SEMI = 0
PLUS = 0
MINUS = 0
STAR = 0
SLASH = 0
VBAR = 0
AMPER = 0
LESS = 0
GREATER = 0
EQUAL = 0
DOT = 0
PERCENT = 0
BACKQUOTE = 0
LBRACE = 0
RBRACE = 0
EQEQUAL = 0
NOTEQUAL = 0
LESSEQUAL = 0
GREATEREQUAL = 0
TILDE = 0
CIRCUMFLEX = 0
LEFTSHIFT = 0
RIGHTSHIFT = 0
DOUBLESTAR = 0
PLUSEQUAL = 0
MINEQUAL = 0
STAREQUAL = 0
SLASHEQUAL = 0
PERCENTEQUAL = 0
AMPEREQUAL = 0
VBAREQUAL = 0
CIRCUMFLEXEQUAL = 0
LEFTSHIFTEQUAL = 0
RIGHTSHIFTEQUAL = 0
DOUBLESTAREQUAL = 0
DOUBLESLASH = 0
DOUBLESLASHEQUAL = 0
AT = 0
OP = 0
ERRORTOKEN = 0
N_TOKENS = 0
NT_OFFSET = 0
tok_name = ... # type: Dict[int, str]
def ISTERMINAL(x) -> bool: ...
def ISNONTERMINAL(x) -> bool: ...
def ISEOF(x) -> bool: ...

71
stdlib/2and3/token.pyi Normal file
View File

@@ -0,0 +1,71 @@
import sys
from typing import Dict
ENDMARKER = ... # type: int
NAME = ... # type: int
NUMBER = ... # type: int
STRING = ... # type: int
NEWLINE = ... # type: int
INDENT = ... # type: int
DEDENT = ... # type: int
LPAR = ... # type: int
RPAR = ... # type: int
LSQB = ... # type: int
RSQB = ... # type: int
COLON = ... # type: int
COMMA = ... # type: int
SEMI = ... # type: int
PLUS = ... # type: int
MINUS = ... # type: int
STAR = ... # type: int
SLASH = ... # type: int
VBAR = ... # type: int
AMPER = ... # type: int
LESS = ... # type: int
GREATER = ... # type: int
EQUAL = ... # type: int
DOT = ... # type: int
PERCENT = ... # type: int
if sys.version_info < (3,):
BACKQUOTE = ... # type: int
LBRACE = ... # type: int
RBRACE = ... # type: int
EQEQUAL = ... # type: int
NOTEQUAL = ... # type: int
LESSEQUAL = ... # type: int
GREATEREQUAL = ... # type: int
TILDE = ... # type: int
CIRCUMFLEX = ... # type: int
LEFTSHIFT = ... # type: int
RIGHTSHIFT = ... # type: int
DOUBLESTAR = ... # type: int
PLUSEQUAL = ... # type: int
MINEQUAL = ... # type: int
STAREQUAL = ... # type: int
SLASHEQUAL = ... # type: int
PERCENTEQUAL = ... # type: int
AMPEREQUAL = ... # type: int
VBAREQUAL = ... # type: int
CIRCUMFLEXEQUAL = ... # type: int
LEFTSHIFTEQUAL = ... # type: int
RIGHTSHIFTEQUAL = ... # type: int
DOUBLESTAREQUAL = ... # type: int
DOUBLESLASH = ... # type: int
DOUBLESLASHEQUAL = ... # type: int
AT = ... # type: int
if sys.version_info >= (3,):
RARROW = ... # type: int
ELLIPSIS = ... # type: int
if sys.version_info >= (3, 5):
ATEQUAL = ... # type: int
AWAIT = ... # type: int
ASYNC = ... # type: int
OP = ... # type: int
ERRORTOKEN = ... # type: int
N_TOKENS = ... # type: int
NT_OFFSET = ... # type: int
tok_name = ... # type: Dict[int, str]
def ISTERMINAL(x: int) -> bool: ...
def ISNONTERMINAL(x: int) -> bool: ...
def ISEOF(x: int) -> bool: ...

View File

@@ -1,63 +0,0 @@
from typing import Dict
ENDMARKER = 0
NAME = 0
NUMBER = 0
STRING = 0
NEWLINE = 0
INDENT = 0
DEDENT = 0
LPAR = 0
RPAR = 0
LSQB = 0
RSQB = 0
COLON = 0
COMMA = 0
SEMI = 0
PLUS = 0
MINUS = 0
STAR = 0
SLASH = 0
VBAR = 0
AMPER = 0
LESS = 0
GREATER = 0
EQUAL = 0
DOT = 0
PERCENT = 0
LBRACE = 0
RBRACE = 0
EQEQUAL = 0
NOTEQUAL = 0
LESSEQUAL = 0
GREATEREQUAL = 0
TILDE = 0
CIRCUMFLEX = 0
LEFTSHIFT = 0
RIGHTSHIFT = 0
DOUBLESTAR = 0
PLUSEQUAL = 0
MINEQUAL = 0
STAREQUAL = 0
SLASHEQUAL = 0
PERCENTEQUAL = 0
AMPEREQUAL = 0
VBAREQUAL = 0
CIRCUMFLEXEQUAL = 0
LEFTSHIFTEQUAL = 0
RIGHTSHIFTEQUAL = 0
DOUBLESTAREQUAL = 0
DOUBLESLASH = 0
DOUBLESLASHEQUAL = 0
AT = 0
RARROW = 0
ELLIPSIS = 0
OP = 0
ERRORTOKEN = 0
N_TOKENS = 0
NT_OFFSET = 0
tok_name = ... # type: Dict[int, str]
def ISTERMINAL(x: int) -> bool: ...
def ISNONTERMINAL(x: int) -> bool: ...
def ISEOF(x: int) -> bool: ...