Module Ocaml_typing.Cms_format

cms and cmsi files format.

module Uid = Shape.Uid
type cms_infos = {
  1. cms_modname : Compilation_unit.t;
  2. cms_comments : (string * Ocaml_parsing.Location.t) list;
  3. cms_sourcefile : string option;
  4. cms_builddir : string;
  5. cms_source_digest : string option;
  6. cms_initial_env : Env.t option;
  7. cms_uid_to_loc : string Ocaml_parsing.Location.loc Shape.Uid.Tbl.t;
  8. cms_uid_to_attributes : Ocaml_parsing.Parsetree.attributes Shape.Uid.Tbl.t;
  9. cms_shape_format : Ocaml_utils.Clflags.shape_format;
  10. cms_impl_shape : Shape.t option;
  11. cms_ident_occurrences : (Ocaml_parsing.Longident.t Ocaml_parsing.Location.loc * Shape_reduce.result) array;
  12. cms_declaration_dependencies : (Cmt_format.dependency_kind * Uid.t * Uid.t) list;
  13. cms_externals : Vicuna_value_shapes.extfun array;
}
type error =
  1. | Not_a_shape of string
exception Error of error
val read : string -> cms_infos

read filename opens filename, and extract the cms_infos. It can be used with .cms and .cmsi files.

save_cms filename modname sourcefile shape writes a cms(i) file.

val register_toplevel_attributes : Shape.Uid.t -> attributes:Ocaml_parsing.Parsetree.attribute list -> loc:Ocaml_parsing.Location.t -> unit
val read_magic_number : in_channel -> string
val clear : unit -> unit
val shape_format_to_string : Ocaml_utils.Clflags.shape_format -> string