ยปCore Development>Code coverage>Lib/lib2to3/pgen2/token.py

Python code coverage for Lib/lib2to3/pgen2/token.py

#countcontent
1n/a#! /usr/bin/env python3
2n/a
3n/a"""Token constants (from "token.h")."""
4n/a
5n/a# Taken from Python (r53757) and modified to include some tokens
6n/a# originally monkeypatched in by pgen2.tokenize
7n/a
8n/a#--start constants--
9n/aENDMARKER = 0
10n/aNAME = 1
11n/aNUMBER = 2
12n/aSTRING = 3
13n/aNEWLINE = 4
14n/aINDENT = 5
15n/aDEDENT = 6
16n/aLPAR = 7
17n/aRPAR = 8
18n/aLSQB = 9
19n/aRSQB = 10
20n/aCOLON = 11
21n/aCOMMA = 12
22n/aSEMI = 13
23n/aPLUS = 14
24n/aMINUS = 15
25n/aSTAR = 16
26n/aSLASH = 17
27n/aVBAR = 18
28n/aAMPER = 19
29n/aLESS = 20
30n/aGREATER = 21
31n/aEQUAL = 22
32n/aDOT = 23
33n/aPERCENT = 24
34n/aBACKQUOTE = 25
35n/aLBRACE = 26
36n/aRBRACE = 27
37n/aEQEQUAL = 28
38n/aNOTEQUAL = 29
39n/aLESSEQUAL = 30
40n/aGREATEREQUAL = 31
41n/aTILDE = 32
42n/aCIRCUMFLEX = 33
43n/aLEFTSHIFT = 34
44n/aRIGHTSHIFT = 35
45n/aDOUBLESTAR = 36
46n/aPLUSEQUAL = 37
47n/aMINEQUAL = 38
48n/aSTAREQUAL = 39
49n/aSLASHEQUAL = 40
50n/aPERCENTEQUAL = 41
51n/aAMPEREQUAL = 42
52n/aVBAREQUAL = 43
53n/aCIRCUMFLEXEQUAL = 44
54n/aLEFTSHIFTEQUAL = 45
55n/aRIGHTSHIFTEQUAL = 46
56n/aDOUBLESTAREQUAL = 47
57n/aDOUBLESLASH = 48
58n/aDOUBLESLASHEQUAL = 49
59n/aAT = 50
60n/aATEQUAL = 51
61n/aOP = 52
62n/aCOMMENT = 53
63n/aNL = 54
64n/aRARROW = 55
65n/aAWAIT = 56
66n/aASYNC = 57
67n/aERRORTOKEN = 58
68n/aN_TOKENS = 59
69n/aNT_OFFSET = 256
70n/a#--end constants--
71n/a
72n/atok_name = {}
73n/afor _name, _value in list(globals().items()):
74n/a if type(_value) is type(0):
75n/a tok_name[_value] = _name
76n/a
77n/a
78n/adef ISTERMINAL(x):
79n/a return x < NT_OFFSET
80n/a
81n/adef ISNONTERMINAL(x):
82n/a return x >= NT_OFFSET
83n/a
84n/adef ISEOF(x):
85n/a return x == ENDMARKER