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. | Callback of {
    1. line : line_t;
    2. function_name : Base.string;
    3. arity : Base.int;
    4. specs : type_t Base.list;
    }
  10. | DeclRecord of {
    1. line : line_t;
    2. name : Base.string;
    3. fields : record_field_t Base.list;
    }
  11. | DeclType of {
    1. line : line_t;
    2. name : Base.string;
    3. tvars : (line_t * Base.string) Base.list;
    4. ty : type_t;
    }
  12. | DeclOpaqueType of {
    1. line : line_t;
    2. name : Base.string;
    3. tvars : (line_t * Base.string) Base.list;
    4. ty : type_t;
    }
  13. | AttrWild of {
    1. line : line_t;
    2. attribute : Base.string;
    3. term : Sf.t;
    }
  14. | FormEof
and record_field_t =
  1. | RecordField of {
    1. line : line_t;
    2. line_field_name : line_t;
    3. field_name : Base.string;
    4. ty : type_t Base.option;
    5. default_expr : expr_t Base.option;
    }
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. | LitFloat of {
    1. line : line_t;
    2. float : Base.float;
    }
  4. | LitInteger of {
    1. line : line_t;
    2. integer : Base.int;
    }
  5. | LitBigInt of {
    1. line : line_t;
    2. bigint : Z.t;
    }
  6. | LitString of {
    1. line : line_t;
    2. str : chars;
    }
and chars =
  1. | Asciis of Base.string
  2. | CharList of Base.int Base.list
and pattern_t =
  1. | PatBitstr of {
    1. line : line_t;
    2. elements : pattern_bin_element_t Base.list;
    }
  2. | PatCompound of {
    1. line : line_t;
    2. lhs : pattern_t;
    3. rhs : pattern_t;
    }
  3. | PatCons of {
    1. line : line_t;
    2. head : pattern_t;
    3. tail : pattern_t;
    }
  4. | PatNil of {
    1. line : line_t;
    }
  5. | PatMap of {
    1. line : line_t;
    2. assocs : pattern_assoc_t Base.list;
    }
  6. | PatBinOp of {
    1. line : line_t;
    2. op : Base.string;
    3. lhs : pattern_t;
    4. rhs : pattern_t;
    }
  7. | PatUnaryOp of {
    1. line : line_t;
    2. op : Base.string;
    3. operand : pattern_t;
    }
  8. | PatRecordFieldIndex of {
    1. line : line_t;
    2. name : Base.string;
    3. line_field_name : line_t;
    4. field_name : Base.string;
    }
  9. | PatRecord of {
    1. line : line_t;
    2. name : Base.string;
    3. record_fields : (line_t * atom_or_wildcard * pattern_t) Base.list;
    }
  10. | PatTuple of {
    1. line : line_t;
    2. pats : pattern_t Base.list;
    }
  11. | PatUniversal of {
    1. line : line_t;
    }
  12. | PatVar of {
    1. line : line_t;
    2. id : Base.string;
    }
  13. | 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 pattern_bin_element_t =
  1. | PatBinElement of {
    1. pattern : pattern_t;
    2. size : expr_t Base.option;
    3. tsl : type_spec_t Base.list Base.option;
    }
and expr_t =
  1. | ExprBody of {
    1. exprs : expr_t Base.list;
    }
  2. | ExprBitstr of {
    1. line : line_t;
    2. elements : expr_bin_element_t Base.list;
    }
  3. | ExprBitstrComprehension of {
    1. line : line_t;
    2. expr : expr_t;
    3. qualifiers : qualifier_t Base.list;
    }
  4. | ExprBlock of {
    1. line : line_t;
    2. exprs : expr_t Base.list;
    }
  5. | ExprCase of {
    1. line : line_t;
    2. expr : expr_t;
    3. clauses : clause_t Base.list;
    }
  6. | ExprCatch of {
    1. line : line_t;
    2. expr : expr_t;
    }
  7. | ExprCons of {
    1. line : line_t;
    2. head : expr_t;
    3. tail : expr_t;
    }
  8. | ExprNil of {
    1. line : line_t;
    }
  9. | ExprListComprehension of {
    1. line : line_t;
    2. expr : expr_t;
    3. qualifiers : qualifier_t Base.list;
    }
  10. | ExprLocalFunRef of {
    1. line : line_t;
    2. function_name : Base.string;
    3. arity : Base.int;
    }
  11. | 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;
    }
  12. | ExprFun of {
    1. line : line_t;
    2. name : Base.string Base.option;
    3. clauses : clause_t Base.list;
    }
  13. | ExprLocalCall of {
    1. line : line_t;
    2. function_expr : expr_t;
    3. args : expr_t Base.list;
    }
  14. | 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;
    }
  15. | ExprIf of {
    1. line : line_t;
    2. clauses : clause_t Base.list;
    }
  16. | ExprMapCreation of {
    1. line : line_t;
    2. assocs : expr_assoc_t Base.list;
    }
  17. | ExprMapUpdate of {
    1. line : line_t;
    2. map : expr_t;
    3. assocs : expr_assoc_t Base.list;
    }
  18. | ExprMatch of {
    1. line : line_t;
    2. pattern : pattern_t;
    3. body : expr_t;
    }
  19. | ExprBinOp of {
    1. line : line_t;
    2. op : Base.string;
    3. lhs : expr_t;
    4. rhs : expr_t;
    }
  20. | ExprUnaryOp of {
    1. line : line_t;
    2. op : Base.string;
    3. operand : expr_t;
    }
  21. | ExprReceive of {
    1. line : line_t;
    2. clauses : clause_t Base.list;
    }
  22. | ExprReceiveAfter of {
    1. line : line_t;
    2. clauses : clause_t Base.list;
    3. timeout : expr_t;
    4. body : expr_t Base.list;
    }
  23. | ExprRecord of {
    1. line : line_t;
    2. name : Base.string;
    3. record_fields : record_field_for_expr Base.list;
    }
  24. | ExprRecordFieldAccess of {
    1. line : line_t;
    2. expr : expr_t;
    3. name : Base.string;
    4. line_field_name : line_t;
    5. field_name : Base.string;
    }
  25. | ExprRecordFieldIndex of {
    1. line : line_t;
    2. name : Base.string;
    3. line_field_name : line_t;
    4. field_name : Base.string;
    }
  26. | ExprRecordUpdate of {
    1. line : line_t;
    2. expr : expr_t;
    3. name : Base.string;
    4. update_fields : record_field_for_expr Base.list;
    }
  27. | ExprTuple of {
    1. line : line_t;
    2. elements : expr_t Base.list;
    }
  28. | ExprTry of {
    1. line : line_t;
    2. exprs : expr_t Base.list;
    3. case_clauses : clause_t Base.list;
    4. catch_clauses : clause_t Base.list;
    5. after : expr_t Base.list;
    }
  29. | ExprVar of {
    1. line : line_t;
    2. id : Base.string;
    }
  30. | 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;
    }
  3. | QualifierBitstrGenerator of {
    1. line : line_t;
    2. pattern : pattern_t;
    3. expr : 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 record_field_for_expr =
  1. | RecordFieldForExpr of {
    1. line : line_t;
    2. line_name : line_t;
    3. name : Base.string;
    4. value : expr_t;
    }
and type_spec_t =
  1. | TypeSpec of {
    1. atom : Base.string;
    2. value : Base.int Base.option;
    }
and expr_bin_element_t =
  1. | ExprBinElement of {
    1. expr : expr_t;
    2. size : expr_t Base.option;
    3. tsl : type_spec_t Base.list Base.option;
    }
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. | ClsCatch of {
    1. line : line_t;
    2. line_cls : line_t;
    3. line_stacktrace : line_t;
    4. exception_class : atom_or_var_t;
    5. pattern : pattern_t;
    6. stacktrace : Base.string;
    7. guard_sequence : guard_sequence_t Base.option;
    8. body : expr_t;
    }
  3. | ClsFun of {
    1. line : line_t;
    2. patterns : pattern_t Base.list;
    3. guard_sequence : guard_sequence_t Base.option;
    4. body : expr_t;
    }
  4. | ClsIf of {
    1. line : line_t;
    2. guard_sequence : guard_sequence_t;
    3. 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. | GuardTestBitstr of {
    1. line : line_t;
    2. elements : guard_test_bin_element_t Base.list;
    }
  2. | GuardTestCons of {
    1. line : line_t;
    2. head : guard_test_t;
    3. tail : guard_test_t;
    }
  3. | GuardTestCall of {
    1. line : line_t;
    2. function_name : literal_t;
    3. args : guard_test_t Base.list;
    }
  4. | GuardTestRemoteCall of {
    1. line : line_t;
    2. line_remote : line_t;
    3. line_module_name : line_t;
    4. module_name : Base.string;
    5. line_function_name : line_t;
    6. function_name : Base.string;
    7. args : guard_test_t Base.list;
    }
  5. | GuardTestMapCreation of {
    1. line : line_t;
    2. assocs : guard_test_assoc_t Base.list;
    }
  6. | GuardTestMapUpdate of {
    1. line : line_t;
    2. map : guard_test_t;
    3. assocs : guard_test_assoc_t Base.list;
    }
  7. | GuardTestNil of {
    1. line : line_t;
    }
  8. | GuardTestBinOp of {
    1. line : line_t;
    2. op : Base.string;
    3. lhs : guard_test_t;
    4. rhs : guard_test_t;
    }
  9. | GuardTestUnaryOp of {
    1. line : line_t;
    2. op : Base.string;
    3. operand : guard_test_t;
    }
  10. | GuardTestRecord of {
    1. line : line_t;
    2. name : Base.string;
    3. record_fields : (line_t * atom_or_wildcard * guard_test_t) Base.list;
    }
  11. | GuardTestRecordFieldAccess of {
    1. line : line_t;
    2. record : guard_test_t;
    3. name : Base.string;
    4. line_field_name : line_t;
    5. field_name : Base.string;
    }
  12. | GuardTestRecordFieldIndex of {
    1. line : line_t;
    2. name : Base.string;
    3. line_field_name : line_t;
    4. field_name : Base.string;
    }
  13. | GuardTestTuple of {
    1. line : line_t;
    2. elements : guard_test_t Base.list;
    }
  14. | GuardTestVar of {
    1. line : line_t;
    2. id : Base.string;
    }
  15. | 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 atom_or_wildcard =
  1. | AtomWildcardAtom of {
    1. line : line_t;
    2. atom : Base.string;
    }
  2. | AtomWildcardWildcard of {
    1. line : line_t;
    }
and guard_test_bin_element_t =
  1. | GuardTestBinElement of {
    1. guard_test : guard_test_t;
    2. size : guard_test_t Base.option;
    3. tsl : type_spec_t Base.list Base.option;
    }
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. | TyRecord of {
    1. line : line_t;
    2. line_name : line_t;
    3. name : Base.string;
    4. field_types : record_field_type_t Base.list;
    }
  15. | TyRemote of {
    1. line : line_t;
    2. line_module_name : line_t;
    3. module_name : Base.string;
    4. line_type_name : line_t;
    5. type_name : Base.string;
    6. params : type_t Base.list;
    }
  16. | TyAnyTuple of {
    1. line : line_t;
    }
  17. | TyTuple of {
    1. line : line_t;
    2. elements : type_t Base.list;
    }
  18. | TyUnion of {
    1. line : line_t;
    2. elements : type_t Base.list;
    }
  19. | TyUser of {
    1. line : line_t;
    2. name : Base.string;
    3. args : type_t Base.list;
    }
  20. | 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;
    }
and record_field_type_t =
  1. | RecordFieldType of {
    1. line : line_t;
    2. line_name : line_t;
    3. name : Base.string;
    4. ty : type_t;
    }
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
val sexp_of_form_t : form_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_record_field_t : record_field_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_literal_t : literal_t -> Ppx_sexp_conv_lib.Sexp.t
val sexp_of_chars : chars -> Ppx_sexp_conv_lib.Sexp.t
val sexp_of_pattern_t : pattern_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_pattern_assoc_t : pattern_assoc_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_pattern_bin_element_t : pattern_bin_element_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_expr_t : expr_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_expr_assoc_t : expr_assoc_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_qualifier_t : qualifier_t -> Base__.Ppx_sexp_conv_lib.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_record_field_for_expr : record_field_for_expr -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_type_spec_t : type_spec_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_expr_bin_element_t : expr_bin_element_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_clause_t : clause_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_guard_sequence_t : guard_sequence_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_guard_t : guard_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_guard_test_t : guard_test_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_guard_test_assoc_t : guard_test_assoc_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_atom_or_wildcard : atom_or_wildcard -> Ppx_sexp_conv_lib.Sexp.t
val sexp_of_guard_test_bin_element_t : guard_test_bin_element_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_type_t : type_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_type_assoc_t : type_assoc_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_type_func_cont_t : type_func_cont_t -> Base__.Ppx_sexp_conv_lib.Sexp.t
val sexp_of_record_field_type_t : record_field_type_t -> Base__.Ppx_sexp_conv_lib.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 tsl_of_sf : Sf.t -> (type_spec_t list, Sf.t Err.t) Base.Result.t
val bin_element_of_sf : value_of_sf:(Sf.t -> ('a, Sf.t Err.t) Base.Result.t) -> size_of_sf:(Sf.t -> ('b, Sf.t Err.t) Base.Result.t) -> Sf.t -> ('a * 'b option * type_spec_t list option, Sf.t 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 record_field_of_sf : Sf.t -> (record_field_t, 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, Sf.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, Sf.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 record_field_for_expr_of_sf : Sf.t -> (record_field_for_expr, Sf.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, Sf.t Err.t) Base.Result.t
val guard_test_assoc_of_sf : Sf.t -> (guard_test_assoc_t, err_t) Base.Result.t
val atom_or_wildcard_of_sf : Sf.t -> (atom_or_wildcard, Sf.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 record_field_type_of_sf : Sf.t -> (record_field_type_t, Sf.t Err.t) Base.Result.t
val of_etf : Obeam__External_term_format.t -> (t, err_t) Base.Result.t
OCaml

Innovation. Community. Security.