mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
* test_select.py: (some) tests for built-in select module
* test_grammar.py, testall.out: added test for funny things in string literals * token.py, symbol.py: definitions used with built-in parser module. * tokenize.py: added double-quote recognition
This commit is contained in:
parent
52f2c05401
commit
b31c7f732a
6 changed files with 155 additions and 1 deletions
60
Lib/symbol.py
Executable file
60
Lib/symbol.py
Executable file
|
|
@ -0,0 +1,60 @@
|
|||
# Non-terminal symbols of Python grammar (from "graminit.h")
|
||||
|
||||
single_input = 256
|
||||
file_input = 257
|
||||
eval_input = 258
|
||||
lambda_input = 259
|
||||
funcdef = 260
|
||||
parameters = 261
|
||||
varargslist = 262
|
||||
fpdef = 263
|
||||
fplist = 264
|
||||
stmt = 265
|
||||
simple_stmt = 266
|
||||
small_stmt = 267
|
||||
expr_stmt = 268
|
||||
print_stmt = 269
|
||||
del_stmt = 270
|
||||
pass_stmt = 271
|
||||
flow_stmt = 272
|
||||
break_stmt = 273
|
||||
continue_stmt = 274
|
||||
return_stmt = 275
|
||||
raise_stmt = 276
|
||||
import_stmt = 277
|
||||
global_stmt = 278
|
||||
access_stmt = 279
|
||||
accesstype = 280
|
||||
exec_stmt = 281
|
||||
compound_stmt = 282
|
||||
if_stmt = 283
|
||||
while_stmt = 284
|
||||
for_stmt = 285
|
||||
try_stmt = 286
|
||||
except_clause = 287
|
||||
suite = 288
|
||||
test = 289
|
||||
and_test = 290
|
||||
not_test = 291
|
||||
comparison = 292
|
||||
comp_op = 293
|
||||
expr = 294
|
||||
xor_expr = 295
|
||||
and_expr = 296
|
||||
shift_expr = 297
|
||||
arith_expr = 298
|
||||
term = 299
|
||||
factor = 300
|
||||
atom = 301
|
||||
trailer = 302
|
||||
subscript = 303
|
||||
exprlist = 304
|
||||
testlist = 305
|
||||
dictmaker = 306
|
||||
classdef = 307
|
||||
|
||||
names = dir()
|
||||
sym_name = {}
|
||||
for name in names:
|
||||
number = eval(name)
|
||||
sym_name[number] = name
|
||||
Loading…
Add table
Add a link
Reference in a new issue