mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Reduced number of temporary names used at module scope. Use underscores in
front of temporary names in the module namespace.
This commit is contained in:
parent
00eb96a126
commit
e3dbc7e422
1 changed files with 4 additions and 5 deletions
|
@ -56,12 +56,11 @@ N_TOKENS = 39
|
||||||
NT_OFFSET = 256
|
NT_OFFSET = 256
|
||||||
#--end constants--
|
#--end constants--
|
||||||
|
|
||||||
names = dir()
|
|
||||||
tok_name = {}
|
tok_name = {}
|
||||||
for name in names:
|
for _name, _value in globals().items():
|
||||||
number = eval(name)
|
if type(_value) is type(0):
|
||||||
if type(number) is type(0):
|
tok_name[_value] = _name
|
||||||
tok_name[number] = name
|
|
||||||
|
|
||||||
def ISTERMINAL(x):
|
def ISTERMINAL(x):
|
||||||
return x < NT_OFFSET
|
return x < NT_OFFSET
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue