Module Melange_ppx_lib.Ast_io

module Compiler_version = Ppxlib_ast.Compiler_version;
module type OCaml_version = Ppxlib_ast.OCaml_version;
module Intf_or_impl: { ... };
type input_version = (module OCaml_version);
let fall_back_input_version: (module OCaml_version);
type t = {
  1. input_name: string,
  2. input_version: input_version,
  3. ast: Intf_or_impl.t,
};
type read_error =
  1. | Not_a_binary_ast
  2. | Unknown_version(string, input_version)
  3. | Source_parse_error(Ppxlib_ast.Location_error.t, input_version)
  4. | System_error(Ppxlib_ast.Location_error.t, input_version)
;
type input_source =
  1. | Stdin
  2. | File(string)
;
type input_kind =
  1. | Possibly_source of {
    1. filename: string,
    2. parse_fun: Lexing.lexbuf => Intf_or_impl.t,
    }
  2. | Necessarily_binary
;
let read: input_source => input_kind:input_kind => result(t, read_error);
let read_exn: input_source => input_kind:input_kind => t;