package errpy

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Errpy.AstSource

Sourcetype num =
  1. | Int of int
  2. | Float of float
  3. | Complex of float
  4. | Big_int of string
    (*

    pyast uses Py.Object.t for Big_int, but this is presumably not what we want (if it's an opaque wrapper for a CPython object). Just have the source text representing the integer digits for now instead.

    *)
Sourcetype object_ = num
Sourcetype constant_desc =
  1. | Ellipsis
  2. | Bool of bool
  3. | Num of num
  4. | Str of string
  5. | ByteStr of string
Sourcetype constant = constant_desc option
Sourcetype singleton = bool option
Sourcetype withitem = {
  1. context_expr : expr;
  2. optional_vars : expr option;
}
Sourceand recoverableerrorwithlocation = {
  1. error : string;
  2. lineno : int;
  3. col_offset : int;
  4. end_lineno : int;
  5. end_col_offset : int;
}
Sourceand unaryop =
  1. | Invert
  2. | Not
  3. | UAdd
  4. | USub
Sourceand type_ignore =
  1. | TypeIgnore of {
    1. lineno : int;
    2. tag : string;
    }
Sourceand stmt = {
  1. desc : stmt_desc;
  2. lineno : int;
  3. col_offset : int;
  4. end_lineno : int option;
  5. end_col_offset : int option;
}
Sourceand stmt_desc =
  1. | FunctionDef of {
    1. name : string;
    2. args : arguments;
    3. body : stmt list;
    4. decorator_list : expr list;
    5. returns : expr option;
    6. type_comment : string option;
    }
  2. | AsyncFunctionDef of {
    1. name : string;
    2. args : arguments;
    3. body : stmt list;
    4. decorator_list : expr list;
    5. returns : expr option;
    6. type_comment : string option;
    }
  3. | ClassDef of {
    1. name : string;
    2. bases : expr list;
    3. keywords : keyword list;
    4. body : stmt list;
    5. decorator_list : expr list;
    }
  4. | Return of expr option
  5. | Delete of expr list
  6. | Assign of {
    1. targets : expr list;
    2. value : expr;
    3. type_comment : string option;
    }
  7. | AugAssign of {
    1. target : expr;
    2. op : operator;
    3. value : expr;
    }
  8. | AnnAssign of {
    1. target : expr;
    2. annotation : expr;
    3. value : expr option;
    4. simple : int;
    }
  9. | For of {
    1. target : expr;
    2. iter : expr;
    3. body : stmt list;
    4. orelse : stmt list;
    5. type_comment : string option;
    }
  10. | AsyncFor of {
    1. target : expr;
    2. iter : expr;
    3. body : stmt list;
    4. orelse : stmt list;
    5. type_comment : string option;
    }
  11. | While of {
    1. test : expr;
    2. body : stmt list;
    3. orelse : stmt list;
    }
  12. | If of {
    1. test : expr;
    2. body : stmt list;
    3. orelse : stmt list;
    }
  13. | With of {
    1. items : withitem list;
    2. body : stmt list;
    3. type_comment : string option;
    }
  14. | AsyncWith of {
    1. items : withitem list;
    2. body : stmt list;
    3. type_comment : string option;
    }
  15. | Match of {
    1. subject : expr;
    2. cases : match_case list;
    }
  16. | Raise of {
    1. exc : expr option;
    2. cause : expr option;
    }
  17. | Try of {
    1. body : stmt list;
    2. handlers : excepthandler list;
    3. orelse : stmt list;
    4. finalbody : stmt list;
    }
  18. | Assert of {
    1. test : expr;
    2. msg : expr option;
    }
  19. | Import of alias list
  20. | ImportFrom of {
    1. module_ : string option;
    2. names : alias list;
    3. level : int option;
    }
  21. | Global of string list
  22. | Nonlocal of string list
  23. | Expr of expr
  24. | Pass
  25. | Break
  26. | Continue
Sourceand slice = expr
Sourceand pattern = {
  1. desc : pattern_desc;
  2. lineno : int;
  3. col_offset : int;
  4. end_lineno : int;
  5. end_col_offset : int;
}
Sourceand pattern_desc =
  1. | MatchValue of expr
  2. | MatchSingleton of constant
  3. | MatchSequence of pattern list
  4. | MatchMapping of {
    1. keys : expr list;
    2. patterns : pattern list;
    3. rest : string option;
    }
  5. | MatchClass of {
    1. cls : expr;
    2. patterns : pattern list;
    3. kwd_attrs : string list;
    4. kwd_patterns : pattern list;
    }
  6. | MatchStar of string option
  7. | MatchAs of {
    1. pattern : pattern option;
    2. name : string option;
    }
  8. | MatchOr of pattern list
Sourceand operator =
  1. | Add
  2. | Sub
  3. | Mult
  4. | MatMult
  5. | Div
  6. | Mod
  7. | Pow
  8. | LShift
  9. | RShift
  10. | BitOr
  11. | BitXor
  12. | BitAnd
  13. | FloorDiv
Sourceand mod_ =
  1. | Module of {
    1. body : stmt list;
    2. type_ignores : type_ignore list;
    }
  2. | Interactive of stmt list
  3. | Expression of expr
  4. | FunctionType of {
    1. argtypes : expr list;
    2. returns : expr;
    }
Sourceand match_case = {
  1. pattern : pattern;
  2. guard : expr option;
  3. body : stmt list;
}
Sourceand keyword = {
  1. arg : string option;
  2. value : expr;
  3. lineno : int;
  4. col_offset : int;
  5. end_lineno : int option;
  6. end_col_offset : int option;
}
Sourceand expr_context =
  1. | Load
  2. | Store
  3. | Del
Sourceand expr = {
  1. desc : expr_desc;
  2. lineno : int;
  3. col_offset : int;
  4. end_lineno : int option;
  5. end_col_offset : int option;
}
Sourceand expr_desc =
  1. | BoolOp of {
    1. op : boolop;
    2. values : expr list;
    }
  2. | NamedExpr of {
    1. target : expr;
    2. value : expr;
    }
  3. | BinOp of {
    1. left : expr;
    2. op : operator;
    3. right : expr;
    }
  4. | UnaryOp of {
    1. op : unaryop;
    2. operand : expr;
    }
  5. | Lambda of {
    1. args : arguments;
    2. body : expr;
    }
  6. | IfExp of {
    1. test : expr;
    2. body : expr;
    3. orelse : expr;
    }
  7. | Dict of {
    1. keys : expr option list;
    2. values : expr list;
    }
  8. | Set of expr list
  9. | ListComp of {
    1. elt : expr;
    2. generators : comprehension list;
    }
  10. | SetComp of {
    1. elt : expr;
    2. generators : comprehension list;
    }
  11. | DictComp of {
    1. key : expr;
    2. value : expr;
    3. generators : comprehension list;
    }
  12. | GeneratorExp of {
    1. elt : expr;
    2. generators : comprehension list;
    }
  13. | Await of expr
  14. | Yield of expr option
  15. | YieldFrom of expr
  16. | Compare of {
    1. left : expr;
    2. ops : cmpop list;
    3. comparators : expr list;
    }
  17. | Call of {
    1. func : expr;
    2. args : expr list;
    3. keywords : keyword list;
    }
  18. | FormattedValue of {
    1. value : expr;
    2. conversion : int option;
    3. format_spec : expr option;
    }
  19. | JoinedStr of expr list
  20. | Constant of {
    1. value : constant;
    2. kind : string option;
    }
  21. | Attribute of {
    1. value : expr;
    2. attr : string;
    3. ctx : expr_context;
    }
  22. | Subscript of {
    1. value : expr;
    2. slice : expr;
    3. ctx : expr_context;
    }
  23. | Starred of {
    1. value : expr;
    2. ctx : expr_context;
    }
  24. | Name of {
    1. id : string;
    2. ctx : expr_context;
    }
  25. | List of {
    1. elts : expr list;
    2. ctx : expr_context;
    }
  26. | Tuple of {
    1. elts : expr list;
    2. ctx : expr_context;
    }
  27. | Slice of {
    1. lower : expr option;
    2. upper : expr option;
    3. step : expr option;
    }
Sourceand excepthandler = {
  1. desc : excepthandler_desc;
  2. lineno : int;
  3. col_offset : int;
  4. end_lineno : int option;
  5. end_col_offset : int option;
}
Sourceand excepthandler_desc =
  1. | ExceptHandler of {
    1. type_ : expr option;
    2. name : string option;
    3. body : stmt list;
    }
Sourceand comprehension = {
  1. target : expr;
  2. iter : expr;
  3. ifs : expr list;
  4. is_async : bool;
}
Sourceand cmpop =
  1. | Eq
  2. | NotEq
  3. | Lt
  4. | LtE
  5. | Gt
  6. | GtE
  7. | Is
  8. | IsNot
  9. | In
  10. | NotIn
Sourceand boolop =
  1. | And
  2. | Or
Sourceand arguments = {
  1. posonlyargs : arg list;
  2. args : arg list;
  3. vararg : arg option;
  4. kwonlyargs : arg list;
  5. kw_defaults : expr option list;
  6. kwarg : arg option;
  7. defaults : expr list;
}
Sourceand arg = {
  1. arg : string;
  2. annotation : expr option;
  3. type_comment : string option;
  4. lineno : int;
  5. col_offset : int;
  6. end_lineno : int option;
  7. end_col_offset : int option;
}
Sourceand alias = {
  1. name : string;
  2. asname : string option;
  3. lineno : int;
  4. col_offset : int;
  5. end_lineno : int option;
  6. end_col_offset : int option;
}
Sourceval show_recoverableerrorwithlocation : recoverableerrorwithlocation -> Ppx_deriving_runtime.string
Sourceval show_excepthandler_desc : excepthandler_desc -> Ppx_deriving_runtime.string
Sourcetype arguments_args =
  1. | Expr_list of expr list
  2. | Arg_list of arg list
Sourcetype arguments_kwarg =
  1. | Identifier_opt of string option
  2. | Arg_opt of arg option
Sourcetype arguments_vararg =
  1. | Identifier_opt of string option
  2. | Arg_opt of arg option
Sourcetype excepthandler_excepthandler_name =
  1. | Identifier_opt of string option
  2. | Expr_opt of expr option
Sourceval show_excepthandler_excepthandler_name : excepthandler_excepthandler_name -> Ppx_deriving_runtime.string
Sourcetype expr_bytes_s =
  1. | String of string
  2. | Bytes of string
Sourcetype expr_subscript_slice =
  1. | Slice of slice
  2. | Expr of expr
Sourceval show_expr_subscript_slice : expr_subscript_slice -> Ppx_deriving_runtime.string
Sourcetype expr_yieldfrom_value =
  1. | Expr_opt of expr option
  2. | Expr of expr
Sourceval show_expr_yieldfrom_value : expr_yieldfrom_value -> Ppx_deriving_runtime.string
Sourcetype keyword_arg =
  1. | Identifier_opt of string option
  2. | Identifier of string
Sourcetype stmt_importfrom_module =
  1. | Identifier_opt of string option
  2. | Identifier of string
Sourceval show_stmt_importfrom_module : stmt_importfrom_module -> Ppx_deriving_runtime.string