|
toText(node_id)
Returns textual representation of a node id. |
|
|
|
py_cst(f)
Decorator used to filter arguments of cst module functions on
fiber-specific nodes. |
|
|
|
|
|
|
|
|
|
|
|
single_input(*args)
single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE |
|
|
|
file_input(*args)
file_input: (NEWLINE | stmt)* ENDMARKER |
|
|
|
eval_input(*args)
eval_input: testlist NEWLINE* ENDMARKER |
|
|
|
decorator(*args)
decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE |
|
|
|
|
|
funcdef(*args)
funcdef: [decorators] 'def' NAME parameters ':' suite |
|
|
|
parameters(*args)
parameters: '(' [varargslist] ')' |
|
|
|
varargslist(*args)
varargslist: (fpdef ['=' test] ',')* ('*' NAME [',' '**' NAME] |
'**' NAME) | fpdef ['=' test] (',' fpdef ['=' test])* [','] |
|
|
|
fpdef(*args)
fpdef: NAME | '(' fplist ')' |
|
|
|
fplist(*args)
fplist: fpdef (',' fpdef)* [','] |
|
|
|
stmt(*args)
stmt: simple_stmt | compound_stmt |
|
|
|
simple_stmt(*args)
simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE |
|
|
|
small_stmt(*args)
small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt |
flow_stmt | import_stmt | global_stmt | exec_stmt | assert_stmt |
|
|
|
expr_stmt(*args)
expr_stmt: testlist (augassign testlist | ('=' testlist)*) |
|
|
|
augassign(*args)
augassign: '+=' | '-=' | '*=' | '/=' | '%=' | '&=' | '|=' |
'^=' | '<<=' | '>>=' | '**=' | '//=' |
|
|
|
print_stmt(*args)
print_stmt: 'print' ( '>>' test [ (',' test)+ [','] ] | [
test (',' test)* [','] ] ) |
|
|
|
del_stmt(*args)
del_stmt: 'del' exprlist |
|
|
|
|
|
flow_stmt(*args)
flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt |
yield_stmt |
|
|
|
|
|
|
|
|
|
|
|
raise_stmt(*args)
raise_stmt: 'raise' [test [',' test [',' test]]] |
|
|
|
import_stmt(*args)
import_stmt: import_name | import_from |
|
|
|
import_name(*args)
import_name: 'import' dotted_as_names |
|
|
|
import_from(*args)
import_from: 'from' dotted_name 'import' ('*' | '('
import_as_names ')' | import_as_names) |
|
|
|
|
|
import_as_names(*args)
import_as_names: import_as_name (',' import_as_name)* [','] |
|
|
|
|
|
dotted_as_names(*args)
dotted_as_names: dotted_as_name (',' dotted_as_name)* |
|
|
|
|
|
global_stmt(*args)
global_stmt: 'global' NAME (',' NAME)* |
|
|
|
assert_stmt(*args)
assert_stmt: 'assert' test [',' test] |
|
|
|
exec_stmt(*args)
exec_stmt: 'exec' expr ['in' test [',' test]] |
|
|
|
compound_stmt(*args)
compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt |
funcdef | classdef |
|
|
|
if_stmt(*args)
if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':'
suite] |
|
|
|
while_stmt(*args)
while_stmt: 'while' test ':' suite ['else' ':' suite] |
|
|
|
for_stmt(*args)
for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':'
suite] |
|
|
|
try_stmt(*args)
try_stmt: ('try' ':' suite (except_clause ':' suite)+ ['else' ':'
suite] | 'try' ':' suite 'finally' ':' suite) |
|
|
|
|
|
suite(*args)
suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT |
|
|
|
|
|
|
|
|
|
|
|
test(*args)
test: and_test ('or' and_test)* | lambdef |
|
|
|
and_test(*args)
end_test: not_test ('and' not_test)* |
|
|
|
not_test(*args)
not_test: 'not' not_test | comparison |
|
|
|
|
|
comparison(*args)
comparison: expr (comp_op expr)* |
|
|
|
expr(*args)
expr: xor_expr ('|' xor_expr)* |
|
|
|
xor_expr(*args)
xor_expr: and_expr ('^' and_expr)* |
|
|
|
and_expr(*args)
and_expr: shift_expr ('&' shift_expr)* |
|
|
|
shift_expr(*args)
shift_expr: arith_expr (('<<'|'>>') arith_expr)* |
|
|
|
arith_expr(*args)
arith_expr: term (('+'|'-') term)* |
|
|
|
term(*args)
term: factor (('*'|'/'|'%'|'//') factor)* |
|
|
|
factor(*args)
factor: ('+'|'-'|'~') factor | power |
|
|
|
power(*args)
power: atom trailer* ['**' factor] |
|
|
|
atom(*args)
atom: '(' [testlist_gexp] ')' | '[' [listmaker] ']' | '{'
[dictmaker] '}' | '`' testlist1 '`' | NAME | NUMBER | STRING+ |
|
|
|
exprlist(*args)
exprlist: expr (',' expr)* [','] |
|
|
|
lambdef(*args)
lambdef: 'lambda' [varargslist] ':' test |
|
|
|
|
|
listmaker(*args)
listmaker: test ( list_for | (',' test)* [','] ) |
|
|
|
trailer(*args)
trailer : '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME |
|
|
|
testlist(*args)
testlist: test (',' test)* [','] |
|
|
|
|
|
dictmaker(*args)
dictmaker: test ':' test (',' test ':' test)* [','] |
|
|
|
subscriptlist(*args)
subscriptlist: subscript (',' subscript)* [','] |
|
|
|
subscript(*args)
subscript: '.' '.' '.' | [test] ':' [test] [sliceop] | test |
|
|
|
|
|
classdef(*args)
classdef: 'class' NAME ['(' testlist ')'] ':' suite |
|
|
|
arglist(*args)
arglist: (argument ',')* (argument [',']| '*' test [',' '**' test]
| '**' test) |
|
|
|
argument(*args)
argument: [test '='] test [gen_for] |
|
|
|
list_iter(*args)
list_iter: list_for | list_if |
|
|
|
list_for(*args)
list_for: 'for' exprlist 'in' testlist_safe [list_iter] |
|
|
|
list_if(*args)
list_if: 'if' test [list_iter] |
|
|
|
gen_iter(*args)
gen_iter: gen_for | gen_if |
|
|
|
gen_for(*args)
gen_for: 'for' exprlist 'in' test [gen_iter] |
|
|
|
gen_if(*args)
gen_if: 'if' test [gen_iter] |
|
|
|
|