TaglessFinal.Statement
This module provides a type that represents a Python statement.
type ('alias, 'arguments, 'bin_op, 'except_handler, 'expr, 'identifier, 'keyword, 'location, 'match_case, 'with_item, 'stmt)
t =
private {
function_def : location:'location ->
name:'identifier ->
args:'arguments ->
body:'stmt list ->
decorator_list:'expr list ->
returns:'expr option ->
type_comment:string option ->
'stmt; | (* Represent a function definition (i.e.
|
async_function_def : location:'location ->
name:'identifier ->
args:'arguments ->
body:'stmt list ->
decorator_list:'expr list ->
returns:'expr option ->
type_comment:string option ->
'stmt; | (* Represent an async function definition (i.e. |
class_def : location:'location ->
name:'identifier ->
bases:'expr list ->
keywords:'keyword list ->
body:'stmt list ->
decorator_list:'expr list ->
'stmt; | (* Represent a class definition (i.e.
|
return : location:'location -> value:'expr option -> 'stmt; | (* Represent a
|
delete : location:'location -> targets:'expr list -> 'stmt; | (* Represent a
|
assign : location:'location ->
targets:'expr list ->
value:'expr ->
type_comment:string option ->
'stmt; | (* Represent an unannotated assignment statement.
|
aug_assign : location:'location ->
target:'expr ->
op:'bin_op ->
value:'expr ->
'stmt; | (* Represent an augmented assignment statement (see PEP 203).
|
ann_assign : location:'location ->
target:'expr ->
annotation:'expr ->
value:'expr option ->
simple:bool ->
'stmt; | (* Represent an annotated assignment statement (see PEP 526).
|
for_ : location:'location ->
target:'expr ->
iter:'expr ->
body:'stmt list ->
orelse:'stmt list ->
type_comment:string option ->
'stmt; | (* Represent a
|
async_for : location:'location ->
target:'expr ->
iter:'expr ->
body:'stmt list ->
orelse:'stmt list ->
type_comment:string option ->
'stmt; | (* Represent an |
while_ : location:'location ->
test:'expr ->
body:'stmt list ->
orelse:'stmt list ->
'stmt; | (* Represent a
|
if_ : location:'location ->
test:'expr ->
body:'stmt list ->
orelse:'stmt list ->
'stmt; | (* Represent a
|
with_ : location:'location ->
items:'with_item list ->
body:'stmt list ->
type_comment:string option ->
'stmt; | (* Represent a
|
async_with : location:'location ->
items:'with_item list ->
body:'stmt list ->
type_comment:string option ->
'stmt; | (* Represent an |
match_ : location:'location ->
subject:'expr ->
cases:'match_case list ->
'stmt; | (* Represent a
|
raise_ : location:'location -> exc:'expr option -> cause:'expr option -> 'stmt; | (* Represent a
|
try_ : location:'location ->
body:'stmt list ->
handlers:'except_handler list ->
orelse:'stmt list ->
finalbody:'stmt list ->
'stmt; | (* Represent a
|
try_star : location:'location ->
body:'stmt list ->
handlers:'except_handler list ->
orelse:'stmt list ->
finalbody:'stmt list ->
'stmt; | (* Represent a Arguments here means the same thing as the |
assert_ : location:'location -> test:'expr -> msg:'expr option -> 'stmt; | (* Represent an
|
import : location:'location -> names:'alias list -> 'stmt; | (* Represent an
|
import_from : location:'location ->
module_:'identifier option ->
names:'alias list ->
level:int ->
'stmt; | (* Represent a
|
global : location:'location -> names:'identifier list -> 'stmt; | (* Represent a
|
nonlocal : location:'location -> names:'identifier list -> 'stmt; | (* Represent a
|
expr : location:'location -> value:'expr -> 'stmt; | (* Represent an expression statement.
|
pass : location:'location -> 'stmt; | (* Represent a |
break : location:'location -> 'stmt; | (* Represent a |
continue : location:'location -> 'stmt; | (* Represent a |
}
val make :
function_def:
( location:'a ->
name:'b ->
args:'c ->
body:'d list ->
decorator_list:'e list ->
returns:'e option ->
type_comment:string option ->
'd ) ->
async_function_def:
( location:'a ->
name:'b ->
args:'c ->
body:'d list ->
decorator_list:'e list ->
returns:'e option ->
type_comment:string option ->
'd ) ->
class_def:
( location:'a ->
name:'b ->
bases:'e list ->
keywords:'f list ->
body:'d list ->
decorator_list:'e list ->
'd ) ->
return:( location:'a -> value:'e option -> 'd ) ->
delete:( location:'a -> targets:'e list -> 'd ) ->
assign:
( location:'a ->
targets:'e list ->
value:'e ->
type_comment:string option ->
'd ) ->
aug_assign:( location:'a -> target:'e -> op:'g -> value:'e -> 'd ) ->
ann_assign:
( location:'a ->
target:'e ->
annotation:'e ->
value:'e option ->
simple:bool ->
'd ) ->
for_:
( location:'a ->
target:'e ->
iter:'e ->
body:'d list ->
orelse:'d list ->
type_comment:string option ->
'd ) ->
async_for:
( location:'a ->
target:'e ->
iter:'e ->
body:'d list ->
orelse:'d list ->
type_comment:string option ->
'd ) ->
while_:( location:'a -> test:'e -> body:'d list -> orelse:'d list -> 'd ) ->
if_:( location:'a -> test:'e -> body:'d list -> orelse:'d list -> 'd ) ->
with_:
( location:'a ->
items:'h list ->
body:'d list ->
type_comment:string option ->
'd ) ->
async_with:
( location:'a ->
items:'h list ->
body:'d list ->
type_comment:string option ->
'd ) ->
match_:( location:'a -> subject:'e -> cases:'i list -> 'd ) ->
raise_:( location:'a -> exc:'e option -> cause:'e option -> 'd ) ->
try_:
( location:'a ->
body:'d list ->
handlers:'j list ->
orelse:'d list ->
finalbody:'d list ->
'd ) ->
try_star:
( location:'a ->
body:'d list ->
handlers:'j list ->
orelse:'d list ->
finalbody:'d list ->
'd ) ->
assert_:( location:'a -> test:'e -> msg:'e option -> 'd ) ->
import:( location:'a -> names:'k list -> 'd ) ->
import_from:
( location:'a -> module_:'b option -> names:'k list -> level:int -> 'd ) ->
global:( location:'a -> names:'b list -> 'd ) ->
nonlocal:( location:'a -> names:'b list -> 'd ) ->
expr:( location:'a -> value:'e -> 'd ) ->
pass:( location:'a -> 'd ) ->
break:( location:'a -> 'd ) ->
continue:( location:'a -> 'd ) ->
unit ->
( 'k, 'c, 'g, 'j, 'e, 'b, 'f, 'a, 'i, 'h, 'd ) t
Constructor of t
.