package obeam

  1. Overview
  2. Docs
module Sf = Simple_term_format
module Z = Aux.Z
type line_t = Base.int
val sexp_of_line_t : line_t -> Ppx_sexp_conv_lib.Sexp.t
type t =
  1. | AbstractCode of form_t
and form_t =
  1. | ModDecl of form_t Base.list
  2. | AttrExport of {
    1. line : line_t;
    2. function_arity_list : (Base.string * Base.int) Base.list;
    }
  3. | AttrExportType of {
    1. line : line_t;
    2. type_arity_list : (Base.string * Base.int) Base.list;
    }
  4. | AttrImport of {
    1. line : line_t;
    2. module_name : Base.string;
    3. function_arity_list : (Base.string * Base.int) Base.list;
    }
  5. | AttrMod of {
    1. line : line_t;
    2. module_name : Base.string;
    }
  6. | AttrFile of {
    1. line : line_t;
    2. file : Base.string;
    3. file_line : line_t;
    }
  7. | DeclFun of {
    1. line : line_t;
    2. function_name : Base.string;
    3. arity : Base.int;
    4. clauses : clause_t Base.list;
    }
  8. | SpecFun of {
    1. line : line_t;
    2. module_name : Base.string Base.option;
    3. function_name : Base.string;
    4. arity : Base.int;
    5. specs : type_t Base.list;
    }
  9. | DeclRecord of {
    1. line : line_t;
    2. fields : (line_t * Base.string * expr_t Base.option * type_t Base.option) Base.list;
    }
  10. | DeclType of {
    1. line : line_t;
    2. name : Base.string;
    3. tvars : (line_t * Base.string) Base.list;
    4. ty : type_t;
    }
  11. | DeclOpaqueType of {
    1. line : line_t;
    2. name : Base.string;
    3. tvars : (line_t * Base.string) Base.list;
    4. ty : type_t;
    }
  12. | AttrWild of {
    1. line : line_t;
    2. attribute : Base.string;
    3. term : Sf.t;
    }
  13. | FormEof
and literal_t =
  1. | LitAtom of {
    1. line : line_t;
    2. atom : Base.string;
    }
  2. | LitChar of {
    1. line : line_t;
    2. uchar : Base.Uchar.t;
    }
  3. | LitInteger of {
    1. line : line_t;
    2. integer : Base.int;
    }
  4. | LitBigInt of {
    1. line : line_t;
    2. bigint : Z.t;
    }
  5. | LitString of {
    1. line : line_t;
    2. str : Base.string;
    }
and pattern_t =
  1. | PatCons of {
    1. line : line_t;
    2. head : pattern_t;
    3. tail : pattern_t;
    }
  2. | PatNil of {
    1. line : line_t;
    }
  3. | PatMap of {
    1. line : line_t;
    2. assocs : pattern_assoc_t Base.list;
    }
  4. | PatTuple of {
    1. line : line_t;
    2. pats : pattern_t Base.list;
    }
  5. | PatUniversal of {
    1. line : line_t;
    }
  6. | PatVar of {
    1. line : line_t;
    2. id : Base.string;
    }
  7. | PatLit of {
    1. lit : literal_t;
    }
and pattern_assoc_t =
  1. | PatAssocExact of {
    1. line : line_t;
    2. key : pattern_t;
    3. value : pattern_t;
    }
and expr_t =
  1. | ExprBody of {
    1. exprs : expr_t Base.list;
    }
  2. | ExprCase of {
    1. line : line_t;
    2. expr : expr_t;
    3. clauses : clause_t Base.list;
    }
  3. | ExprCons of {
    1. line : line_t;
    2. head : expr_t;
    3. tail : expr_t;
    }
  4. | ExprNil of {
    1. line : line_t;
    }
  5. | ExprListComprehension of {
    1. line : line_t;
    2. expr : expr_t;
    3. qualifiers : qualifier_t Base.list;
    }
  6. | ExprLocalFunRef of {
    1. line : line_t;
    2. function_name : Base.string;
    3. arity : Base.int;
    }
  7. | ExprRemoteFunRef of {
    1. line : line_t;
    2. module_name : atom_or_var_t;
    3. function_name : atom_or_var_t;
    4. arity : integer_or_var_t;
    }
  8. | ExprFun of {
    1. line : line_t;
    2. name : Base.string Base.option;
    3. clauses : clause_t Base.list;
    }
  9. | ExprLocalCall of {
    1. line : line_t;
    2. function_expr : expr_t;
    3. args : expr_t Base.list;
    }
  10. | ExprRemoteCall of {
    1. line : line_t;
    2. line_remote : line_t;
    3. module_expr : expr_t;
    4. function_expr : expr_t;
    5. args : expr_t Base.list;
    }
  11. | ExprMapCreation of {
    1. line : line_t;
    2. assocs : expr_assoc_t Base.list;
    }
  12. | ExprMapUpdate of {
    1. line : line_t;
    2. map : expr_t;
    3. assocs : expr_assoc_t Base.list;
    }
  13. | ExprMatch of {
    1. line : line_t;
    2. pattern : pattern_t;
    3. body : expr_t;
    }
  14. | ExprBinOp of {
    1. line : line_t;
    2. op : Base.string;
    3. lhs : expr_t;
    4. rhs : expr_t;
    }
  15. | ExprTuple of {
    1. line : line_t;
    2. elements : expr_t Base.list;
    }
  16. | ExprVar of {
    1. line : line_t;
    2. id : Base.string;
    }
  17. | ExprLit of {
    1. lit : literal_t;
    }
and expr_assoc_t =
  1. | ExprAssoc of {
    1. line : line_t;
    2. key : expr_t;
    3. value : expr_t;
    }
  2. | ExprAssocExact of {
    1. line : line_t;
    2. key : expr_t;
    3. value : expr_t;
    }
and qualifier_t =
  1. | QualifierGenerator of {
    1. line : line_t;
    2. pattern : pattern_t;
    3. expr : expr_t;
    }
  2. | QualifierFilter of {
    1. filter : expr_t;
    }
and atom_or_var_t =
  1. | AtomVarAtom of {
    1. line : line_t;
    2. atom : Base.string;
    }
  2. | AtomVarVar of {
    1. line : line_t;
    2. id : Base.string;
    }
and integer_or_var_t =
  1. | IntegerVarInteger of {
    1. line : line_t;
    2. integer : Base.int;
    }
  2. | IntegerVarVar of {
    1. line : line_t;
    2. id : Base.string;
    }
and clause_t =
  1. | ClsCase of {
    1. line : line_t;
    2. pattern : pattern_t;
    3. guard_sequence : guard_sequence_t Base.option;
    4. body : expr_t;
    }
  2. | ClsFun of {
    1. line : line_t;
    2. patterns : pattern_t Base.list;
    3. guard_sequence : guard_sequence_t Base.option;
    4. body : expr_t;
    }
and guard_sequence_t =
  1. | GuardSeq of {
    1. guards : guard_t Base.list;
    }
and guard_t =
  1. | Guard of {
    1. guard_tests : guard_test_t Base.list;
    }
and guard_test_t =
  1. | GuardTestCall of {
    1. line : line_t;
    2. function_name : literal_t;
    3. args : guard_test_t Base.list;
    }
  2. | GuardTestMapCreation of {
    1. line : line_t;
    2. assocs : guard_test_assoc_t Base.list;
    }
  3. | GuardTestMapUpdate of {
    1. line : line_t;
    2. map : guard_test_t;
    3. assocs : guard_test_assoc_t Base.list;
    }
  4. | GuardTestBinOp of {
    1. line : line_t;
    2. op : Base.string;
    3. lhs : guard_test_t;
    4. rhs : guard_test_t;
    }
  5. | GuardTestTuple of {
    1. line : line_t;
    2. elements : guard_test_t Base.list;
    }
  6. | GuardTestVar of {
    1. line : line_t;
    2. id : Base.string;
    }
  7. | GuardTestLit of {
    1. lit : literal_t;
    }
and guard_test_assoc_t =
  1. | GuardTestAssoc of {
    1. line : line_t;
    2. key : guard_test_t;
    3. value : guard_test_t;
    }
  2. | GuardTestAssocExact of {
    1. line : line_t;
    2. key : guard_test_t;
    3. value : guard_test_t;
    }
and type_t =
  1. | TyAnn of {
    1. line : line_t;
    2. annotation : type_t;
    3. tyvar : type_t;
    }
  2. | TyBitstring of {
    1. line : line_t;
    2. m : type_t;
    3. n : type_t;
    }
  3. | TyPredef of {
    1. line : line_t;
    2. name : Base.string;
    3. args : type_t Base.list;
    }
  4. | TyBinOp of {
    1. line : line_t;
    2. op : Base.string;
    3. lhs : type_t;
    4. rhs : type_t;
    }
  5. | TyUnaryOp of {
    1. line : line_t;
    2. op : Base.string;
    3. operand : type_t;
    }
  6. | TyRange of {
    1. line : line_t;
    2. low : type_t;
    3. high : type_t;
    }
  7. | TyAnyMap of {
    1. line : line_t;
    }
  8. | TyMap of {
    1. line : line_t;
    2. assocs : type_assoc_t Base.list;
    }
  9. | TyVar of {
    1. line : line_t;
    2. id : Base.string;
    }
  10. | TyFunAny of {
    1. line : line_t;
    }
  11. | TyFunAnyArity of {
    1. line : line_t;
    2. line_any : line_t;
    3. ret : type_t;
    }
  12. | TyContFun of {
    1. line : line_t;
    2. function_type : type_t;
    3. constraints : type_func_cont_t;
    }
  13. | TyFun of {
    1. line : line_t;
    2. line_params : line_t;
    3. params : type_t Base.list;
    4. ret : type_t;
    }
  14. | TyAnyTuple of {
    1. line : line_t;
    }
  15. | TyTuple of {
    1. line : line_t;
    2. elements : type_t Base.list;
    }
  16. | TyUnion of {
    1. line : line_t;
    2. elements : type_t Base.list;
    }
  17. | TyUser of {
    1. line : line_t;
    2. name : Base.string;
    3. args : type_t Base.list;
    }
  18. | TyLit of {
    1. lit : literal_t;
    }
and type_assoc_t =
  1. | TyAssoc of {
    1. line : line_t;
    2. key : type_t;
    3. value : type_t;
    }
  2. | TyAssocExact of {
    1. line : line_t;
    2. key : type_t;
    3. value : type_t;
    }
and type_func_cont_t =
  1. | TyCont of {
    1. constraints : type_func_cont_t Base.list;
    }
  2. | TyContRel of {
    1. line : line_t;
    2. constraint_kind : type_func_cont_t;
    3. lhs : type_t;
    4. rhs : type_t;
    }
  3. | TyContIsSubType of {
    1. line : line_t;
    }
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
val sexp_of_form_t : form_t -> Base.Sexp.t
val sexp_of_literal_t : literal_t -> Ppx_sexp_conv_lib.Sexp.t
val sexp_of_pattern_t : pattern_t -> Base.Sexp.t
val sexp_of_pattern_assoc_t : pattern_assoc_t -> Base.Sexp.t
val sexp_of_expr_t : expr_t -> Base.Sexp.t
val sexp_of_expr_assoc_t : expr_assoc_t -> Base.Sexp.t
val sexp_of_qualifier_t : qualifier_t -> Base.Sexp.t
val sexp_of_atom_or_var_t : atom_or_var_t -> Ppx_sexp_conv_lib.Sexp.t
val sexp_of_integer_or_var_t : integer_or_var_t -> Ppx_sexp_conv_lib.Sexp.t
val sexp_of_clause_t : clause_t -> Base.Sexp.t
val sexp_of_guard_sequence_t : guard_sequence_t -> Base.Sexp.t
val sexp_of_guard_t : guard_t -> Base.Sexp.t
val sexp_of_guard_test_t : guard_test_t -> Base.Sexp.t
val sexp_of_guard_test_assoc_t : guard_test_assoc_t -> Base.Sexp.t
val sexp_of_type_t : type_t -> Base.Sexp.t
val sexp_of_type_assoc_t : type_assoc_t -> Base.Sexp.t
val sexp_of_type_func_cont_t : type_func_cont_t -> Base.Sexp.t
type err_t = Sf.t Err.t
val sexp_of_err_t : err_t -> Ppx_sexp_conv_lib.Sexp.t
val track : loc:Base.Source_code_position.t -> ('a, 'b Err.t) Base.Result.t -> ('a, 'b Err.t) Base.Result.t
val of_sf : Sf.t -> (t, err_t) Base.Result.t
val form_of_sf : Sf.t -> (form_t, err_t) Base.Result.t
val name_and_arity_of_sf : Sf.t -> (Base.string * Base.int, err_t) Base.Result.t
val tvar_of_sf : Sf.t -> (line_t * Base.string, err_t) Base.Result.t
val lit_of_sf : Sf.t -> (literal_t, err_t) Base.Result.t
val pat_of_sf : Sf.t -> (pattern_t, err_t) Base.Result.t
val pat_assoc_of_sf : Sf.t -> (pattern_assoc_t, err_t) Base.Result.t
val expr_of_sf : Sf.t -> (expr_t, err_t) Base.Result.t
val expr_assoc_of_sf : Sf.t -> (expr_assoc_t, err_t) Base.Result.t
val qualifier_of_sf : Sf.t -> (qualifier_t, err_t) Base.Result.t
val atom_or_var_of_sf : Sf.t -> (atom_or_var_t, err_t) Base.Result.t
val integer_or_var_of_sf : Sf.t -> (integer_or_var_t, Sf.t Err.t) Base.Result.t
val cls_of_sf : ?in_function:bool -> Sf.t -> (clause_t, err_t) Base.Result.t
val guard_sequence_of_sf : Sf.t -> (guard_sequence_t, err_t) Base.Result.t
val guard_of_sf : Sf.t -> (guard_t, err_t) Base.Result.t
val guard_test_of_sf : Sf.t -> (guard_test_t, err_t) Base.Result.t
val guard_test_assoc_of_sf : Sf.t -> (guard_test_assoc_t, err_t) Base.Result.t
val type_of_sf : Sf.t -> (type_t, err_t) Base.Result.t
val fun_type_of_sf : Sf.t -> (type_t, err_t) Base.Result.t
val type_fun_cont_of_sf : Sf.t -> (type_func_cont_t, err_t) Base.Result.t
val type_assoc_of_sf : Sf.t -> (type_assoc_t, err_t) Base.Result.t
val of_etf : Obeam__External_term_format.t -> (t, err_t) Base.Result.t
OCaml

Innovation. Community. Security.