Module Superbol_project.Config

Type definitions

module TYPES : sig ... end
include module type of TYPES with type path = TYPES.path and type config = TYPES.config
type path = TYPES.path =
  1. | RelativeToProjectRoot of string
  2. | RelativeToFileDir of string
type config = TYPES.config = {
  1. mutable cobol_config : Cobol_config.t;
  2. mutable source_format : Cobol_config.source_format_spec;
  3. mutable libpath : path list;
  4. mutable libexts : string list;
  5. mutable indent_config : (string * int) list;
  6. toml_handle : Ezr_toml.toml_handle;
}
exception ERROR of Superbol_project__.Project_diagnostics.error
type t = config

TOML file management

val new_default : unit -> t
val load_file : ?verbose:bool -> string -> t Cobol_common.Diagnostics.with_diags

load_file ~verbose config_filename loads the given project configuration file. Raises ERROR or Sys_error in case of failure.

val save : ?verbose:bool -> config_filename:string -> t -> unit
val reload : ?verbose:bool -> config_filename:string -> t -> bool Cobol_common.Diagnostics.with_diags

reload ~verbose ~config_filename config returns true, possibly along diagnostics, if the reloaded configuration has changed.

Accessors

val copybook_lookup_config_for : filename:string -> t -> Cobol_common.Copybook.lookup_config

copybook_lookup_config_for ~filename project constructs a copybook lookup configuration (that notably indicates directory names where copybooks are looked up) for a given source file name, in a project with the given configuration.

Intermediate conversion utilities

Those may also raise ERROR

val cobol_config_from_dialect_name : verbose:bool -> string -> Cobol_config.t Cobol_common.Diagnostics.with_diags
val cobol_source_format : string -> Cobol_config.source_format_spec

Cached representation

exception BAD_CHECKSUM
type cached
val to_cache : t -> cached
val of_cache : config_filename:string -> cached -> t