package rotor

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

Module Sourcefile

type ast =
  1. | Interface of Parsetree.signature option * Compiler.Typedtree.signature option
  2. | Implementation of Parsetree.structure option * Compiler.Typedtree.structure option
    (*

    Parse trees contained in a source file.

    *)
type t = private {
  1. fileinfos : Fileinfos.t;
  2. contents : string;
  3. lines : string Containers.Array.t;
  4. ast : ast;
}

The type representing parsed source files.

val of_fileinfos : ?use_cache:bool -> Fileinfos.t -> t

Create a Sourcefile.t value from a Fileinfos.t value.

val get_module_deps : t -> Module.name_t list

Returns a list of the names of the modules upon which this source file depends. Throws a Sourcefile.Invalid_argument exception if there is no typed AST.

val process_ast : intf_f: ((Parsetree.signature option * Compiler.Typedtree.signature option) -> 'a) -> impl_f: ((Parsetree.structure option * Compiler.Typedtree.structure option) -> 'a) -> t -> 'a
val extract_src : t -> Compiler.Location.t -> Compiler.Location.t -> string
val diff : t -> string -> string
val initial_module_scope : t -> Modulescope.t