package libsail

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

Definition of Sail project files, and functions for working with them.

module ModId : sig ... end

Module identifiers are just integers, but we don't want to expose that representation to the world.

type mod_id = ModId.t
val global_scope : mod_id

The global scope is for code not defined in any module.

module ModSet : sig ... end
type l = Stdlib.Lexing.position * Stdlib.Lexing.position
type 'a spanned = 'a * l
val to_loc : l -> Parse_ast.l

Convert a project file location to a full Parse_ast location

type value
val bool_value : bool -> value
val string_value : string -> value
val parse_assignment : variables:value Libsail.Util.StringMap.t Stdlib.ref -> string -> bool
type exp =
  1. | E_app of string * exp spanned list
  2. | E_file of string * string
  3. | E_id of string
  4. | E_if of exp spanned * exp spanned * exp spanned
  5. | E_list of exp spanned list
  6. | E_op of exp spanned * string * exp spanned
  7. | E_parent
  8. | E_string of string
  9. | E_value of value
  10. | E_var of string
type 'a non_empty = 'a * 'a list
type dependency =
  1. | D_requires of exp spanned non_empty
  2. | D_after of exp spanned non_empty
  3. | D_before of exp spanned non_empty
type mdl_def =
  1. | M_dep of dependency
  2. | M_directory of exp spanned
  3. | M_module of mdl
  4. | M_files of exp spanned non_empty
and mdl = {
  1. name : string spanned;
  2. defs : mdl_def spanned list;
  3. span : l;
}
type def =
  1. | Def_root of string
  2. | Def_var of string spanned * exp spanned
  3. | Def_module of mdl
  4. | Def_test of string list
val mk_root : string -> def spanned
type project_structure
val initialize_project_structure : variables:value Libsail.Util.StringMap.t Stdlib.ref -> def spanned list -> project_structure
val get_module_id : project_structure -> string -> mod_id option
val get_children : mod_id -> project_structure -> ModSet.t
val required_modules : roots:ModSet.t -> project_structure -> mod_id -> bool

Create a predicate that returns true for any module that is (transitively) required by any module in the roots set of modules.

val module_name : project_structure -> mod_id -> string spanned
val valid_module_id : project_structure -> mod_id -> bool
val module_order : project_structure -> mod_id list
val module_files : project_structure -> mod_id -> string spanned list
val module_requires : project_structure -> mod_id -> mod_id list
val all_files : project_structure -> string spanned list
val all_modules : project_structure -> mod_id list
OCaml

Innovation. Community. Security.