]> git.madduck.net Git - etc/vim.git/blob - blib2to3/pgen2/token.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

c37b0d58481b16450746f66210f88921969d2d7d
[etc/vim.git] / blib2to3 / pgen2 / token.py
1 """Token constants (from "token.h")."""
2
3 #  Taken from Python (r53757) and modified to include some tokens
4 #   originally monkeypatched in by pgen2.tokenize
5
6 #--start constants--
7 ENDMARKER = 0
8 NAME = 1
9 NUMBER = 2
10 STRING = 3
11 NEWLINE = 4
12 INDENT = 5
13 DEDENT = 6
14 LPAR = 7
15 RPAR = 8
16 LSQB = 9
17 RSQB = 10
18 COLON = 11
19 COMMA = 12
20 SEMI = 13
21 PLUS = 14
22 MINUS = 15
23 STAR = 16
24 SLASH = 17
25 VBAR = 18
26 AMPER = 19
27 LESS = 20
28 GREATER = 21
29 EQUAL = 22
30 DOT = 23
31 PERCENT = 24
32 BACKQUOTE = 25
33 LBRACE = 26
34 RBRACE = 27
35 EQEQUAL = 28
36 NOTEQUAL = 29
37 LESSEQUAL = 30
38 GREATEREQUAL = 31
39 TILDE = 32
40 CIRCUMFLEX = 33
41 LEFTSHIFT = 34
42 RIGHTSHIFT = 35
43 DOUBLESTAR = 36
44 PLUSEQUAL = 37
45 MINEQUAL = 38
46 STAREQUAL = 39
47 SLASHEQUAL = 40
48 PERCENTEQUAL = 41
49 AMPEREQUAL = 42
50 VBAREQUAL = 43
51 CIRCUMFLEXEQUAL = 44
52 LEFTSHIFTEQUAL = 45
53 RIGHTSHIFTEQUAL = 46
54 DOUBLESTAREQUAL = 47
55 DOUBLESLASH = 48
56 DOUBLESLASHEQUAL = 49
57 AT = 50
58 ATEQUAL = 51
59 OP = 52
60 COMMENT = 53
61 NL = 54
62 RARROW = 55
63 AWAIT = 56
64 ASYNC = 57
65 ERRORTOKEN = 58
66 N_TOKENS = 59
67 NT_OFFSET = 256
68 #--end constants--
69
70 tok_name = {}
71 for _name, _value in list(globals().items()):
72     if type(_value) is type(0):
73         tok_name[_value] = _name
74
75
76 def ISTERMINAL(x):
77     return x < NT_OFFSET
78
79 def ISNONTERMINAL(x):
80     return x >= NT_OFFSET
81
82 def ISEOF(x):
83     return x == ENDMARKER