package pyre-ast

  1. Overview
  2. Docs

See TaglessFinal.Statement.

type t = private
  1. | FunctionDef of {
    1. location : Location.t;
    2. name : Identifier.t;
    3. args : Arguments.t;
    4. body : t list;
    5. decorator_list : Expression.t list;
    6. returns : Expression.t option;
    7. type_comment : string option;
    8. type_params : TypeParam.t list;
    }
  2. | AsyncFunctionDef of {
    1. location : Location.t;
    2. name : Identifier.t;
    3. args : Arguments.t;
    4. body : t list;
    5. decorator_list : Expression.t list;
    6. returns : Expression.t option;
    7. type_comment : string option;
    8. type_params : TypeParam.t list;
    }
  3. | ClassDef of {
    1. location : Location.t;
    2. name : Identifier.t;
    3. bases : Expression.t list;
    4. keywords : Keyword.t list;
    5. body : t list;
    6. decorator_list : Expression.t list;
    7. type_params : TypeParam.t list;
    }
  4. | Return of {
    1. location : Location.t;
    2. value : Expression.t option;
    }
  5. | Delete of {
    1. location : Location.t;
    2. targets : Expression.t list;
    }
  6. | Assign of {
    1. location : Location.t;
    2. targets : Expression.t list;
    3. value : Expression.t;
    4. type_comment : string option;
    }
  7. | TypeAlias of {
    1. location : Location.t;
    2. name : Expression.t;
    3. type_params : TypeParam.t list;
    4. value : Expression.t;
    }
  8. | AugAssign of {
    1. location : Location.t;
    2. target : Expression.t;
    3. op : BinaryOperator.t;
    4. value : Expression.t;
    }
  9. | AnnAssign of {
    1. location : Location.t;
    2. target : Expression.t;
    3. annotation : Expression.t;
    4. value : Expression.t option;
    5. simple : bool;
    }
  10. | For of {
    1. location : Location.t;
    2. target : Expression.t;
    3. iter : Expression.t;
    4. body : t list;
    5. orelse : t list;
    6. type_comment : string option;
    }
  11. | AsyncFor of {
    1. location : Location.t;
    2. target : Expression.t;
    3. iter : Expression.t;
    4. body : t list;
    5. orelse : t list;
    6. type_comment : string option;
    }
  12. | While of {
    1. location : Location.t;
    2. test : Expression.t;
    3. body : t list;
    4. orelse : t list;
    }
  13. | If of {
    1. location : Location.t;
    2. test : Expression.t;
    3. body : t list;
    4. orelse : t list;
    }
  14. | With of {
    1. location : Location.t;
    2. items : WithItem.t list;
    3. body : t list;
    4. type_comment : string option;
    }
  15. | AsyncWith of {
    1. location : Location.t;
    2. items : WithItem.t list;
    3. body : t list;
    4. type_comment : string option;
    }
  16. | Match of {
    1. location : Location.t;
    2. subject : Expression.t;
    3. cases : MatchCase.t list;
    }
  17. | Raise of {
    1. location : Location.t;
    2. exc : Expression.t option;
    3. cause : Expression.t option;
    }
  18. | Try of {
    1. location : Location.t;
    2. body : t list;
    3. handlers : ExceptionHandler.t list;
    4. orelse : t list;
    5. finalbody : t list;
    }
  19. | TryStar of {
    1. location : Location.t;
    2. body : t list;
    3. handlers : ExceptionHandler.t list;
    4. orelse : t list;
    5. finalbody : t list;
    }
  20. | Assert of {
    1. location : Location.t;
    2. test : Expression.t;
    3. msg : Expression.t option;
    }
  21. | Import of {
    1. location : Location.t;
    2. names : ImportAlias.t list;
    }
  22. | ImportFrom of {
    1. location : Location.t;
    2. module_ : Identifier.t option;
    3. names : ImportAlias.t list;
    4. level : int;
    }
  23. | Global of {
    1. location : Location.t;
    2. names : Identifier.t list;
    }
  24. | Nonlocal of {
    1. location : Location.t;
    2. names : Identifier.t list;
    }
  25. | Expr of {
    1. location : Location.t;
    2. value : Expression.t;
    }
  26. | Pass of {
    1. location : Location.t;
    }
  27. | Break of {
    1. location : Location.t;
    }
  28. | Continue of {
    1. location : Location.t;
    }
include Sexplib0.Sexpable.S with type t := t
val t_of_sexp : Sexplib0__.Sexp.t -> t
val sexp_of_t : t -> Sexplib0__.Sexp.t
include Ppx_compare_lib.Comparable.S with type t := t
val compare : t Base__Ppx_compare_lib.compare
include Ppx_hash_lib.Hashable.S with type t := t
val hash_fold_t : t Base__Ppx_hash_lib.hash_fold
val hash : t -> Base__Ppx_hash_lib.Std.Hash.hash_value
val make_functiondef_of_t : location:Location.t -> name:Identifier.t -> args:Arguments.t -> ?body:t list -> ?decorator_list:Expression.t list -> ?returns:Expression.t -> ?type_comment:string -> ?type_params:TypeParam.t list -> unit -> t
val make_asyncfunctiondef_of_t : location:Location.t -> name:Identifier.t -> args:Arguments.t -> ?body:t list -> ?decorator_list:Expression.t list -> ?returns:Expression.t -> ?type_comment:string -> ?type_params:TypeParam.t list -> unit -> t
val make_classdef_of_t : location:Location.t -> name:Identifier.t -> ?bases:Expression.t list -> ?keywords:Keyword.t list -> ?body:t list -> ?decorator_list:Expression.t list -> ?type_params:TypeParam.t list -> unit -> t
val make_return_of_t : location:Location.t -> ?value:Expression.t -> unit -> t
val make_delete_of_t : location:Location.t -> ?targets:Expression.t list -> unit -> t
val make_assign_of_t : location:Location.t -> ?targets:Expression.t list -> value:Expression.t -> ?type_comment:string -> unit -> t
val make_typealias_of_t : location:Location.t -> name:Expression.t -> ?type_params:TypeParam.t list -> value:Expression.t -> unit -> t
val make_augassign_of_t : location:Location.t -> target:Expression.t -> op:BinaryOperator.t -> value:Expression.t -> unit -> t
val make_annassign_of_t : location:Location.t -> target:Expression.t -> annotation:Expression.t -> ?value:Expression.t -> simple:bool -> unit -> t
val make_for_of_t : location:Location.t -> target:Expression.t -> iter:Expression.t -> ?body:t list -> ?orelse:t list -> ?type_comment:string -> unit -> t
val make_asyncfor_of_t : location:Location.t -> target:Expression.t -> iter:Expression.t -> ?body:t list -> ?orelse:t list -> ?type_comment:string -> unit -> t
val make_while_of_t : location:Location.t -> test:Expression.t -> ?body:t list -> ?orelse:t list -> unit -> t
val make_if_of_t : location:Location.t -> test:Expression.t -> ?body:t list -> ?orelse:t list -> unit -> t
val make_with_of_t : location:Location.t -> ?items:WithItem.t list -> ?body:t list -> ?type_comment:string -> unit -> t
val make_asyncwith_of_t : location:Location.t -> ?items:WithItem.t list -> ?body:t list -> ?type_comment:string -> unit -> t
val make_match_of_t : location:Location.t -> subject:Expression.t -> ?cases:MatchCase.t list -> unit -> t
val make_raise_of_t : location:Location.t -> ?exc:Expression.t -> ?cause:Expression.t -> unit -> t
val make_try_of_t : location:Location.t -> ?body:t list -> ?handlers:ExceptionHandler.t list -> ?orelse:t list -> ?finalbody:t list -> unit -> t
val make_trystar_of_t : location:Location.t -> ?body:t list -> ?handlers:ExceptionHandler.t list -> ?orelse:t list -> ?finalbody:t list -> unit -> t
val make_assert_of_t : location:Location.t -> test:Expression.t -> ?msg:Expression.t -> unit -> t
val make_import_of_t : location:Location.t -> ?names:ImportAlias.t list -> unit -> t
val make_importfrom_of_t : location:Location.t -> ?module_:Identifier.t -> ?names:ImportAlias.t list -> level:int -> unit -> t
val make_global_of_t : location:Location.t -> ?names:Identifier.t list -> unit -> t
val make_nonlocal_of_t : location:Location.t -> ?names:Identifier.t list -> unit -> t
val make_expr_of_t : location:Location.t -> value:Expression.t -> unit -> t
val make_pass_of_t : location:Location.t -> unit -> t
val make_break_of_t : location:Location.t -> unit -> t
val make_continue_of_t : location:Location.t -> unit -> t
OCaml

Innovation. Community. Security.