Module Cobol_config

This library is used to build configuration modules, either from file or from a dialect. All the from_ functions will fail if a file is not found, or use the default value of any options that is badly typed in the configuration file or not set in the configuration file.

module Types : sig ... end

Module containing most of the types definitions used in Cobol_config.

include module type of Types
type doc = Pretty.simple
type configuration = Types.configuration = {
  1. name : string;
}

Global configuration representative (default, gcos, gcos-strict, etc). Just a name for now, but we could add some more info later (like configuration files read).

class type showable = object ... end

Any object with a pretty-printing method.

class virtual 'a kind : name:string -> object ... end

Kind (type) of configuration options.

val all_configs : showable list Stdlib.ref
val configurable_name_style : [> `Bold | `Yellow ] list
val configurable_kind_style : [> `Cyan ] list
class virtual 'a configurable : name:string -> kind:'a kind -> ?short:doc option -> doc -> object ... end

Any object that is configurable.

module FEATURE = Types.FEATURE
type 'a feature = 'a FEATURE.t
type 'a feature_support = 'a FEATURE.support
module DIAG = Types.DIAG
module Value = Types.Value
type 'a valued_option = 'a Value.v
type 'a value = 'a Value.t
type defaultbyte = Types.defaultbyte =
  1. | Char of char
  2. | Init
  3. | None
type standard = Types.standard =
  1. | GnuCOBOL
  2. | MicroFocus
  3. | IBM
  4. | MVS
  5. | BS2000
  6. | ACU
  7. | RM
  8. | STD85
  9. | STD2002
  10. | STD2014
type source_format = Types.source_format =
  1. | SFFree
  2. | SFFixed
  3. | SFVariable
  4. | SFXOpen
  5. | SFxCard
  6. | SFCRT
  7. | SFTrm
  8. | SFCOBOLX
type source_format_spec = Types.source_format_spec =
  1. | Auto
  2. | SF of source_format
type binary_size = Types.binary_size =
  1. | B_2_4_8
  2. | B_1_2_4_8
  3. | B_1__8
type binary_byteorder = Types.binary_byteorder =
  1. | Native
  2. | Big_endian
type assign_clause = Types.assign_clause =
  1. | Dynamic
  2. | External
  3. | IBM
  4. | MF
type screen_section_rules = Types.screen_section_rules =
  1. | ACU
  2. | GC
  3. | MF
  4. | RM
  5. | STD
  6. | XOPEN
type dpc_in_data = Types.dpc_in_data =
  1. | None
  2. | XML
  3. | Json
  4. | All
type words_spec = (string * word_spec) list
and word_spec = Types.word_spec =
  1. | ReserveWord of {
    1. preserve_context_sensitivity : bool;
    }
  2. | ReserveAlias of {
    1. alias_for : string;
    2. preserve_context_sensitivity : bool;
    }
  3. | NotReserved
module DIALECT = Types.DIALECT
type dialect = DIALECT.t
module type CONFIG = Types.CONFIG
module type PP_OPTS = Types.PP_OPTS
module type COMP_OPTS = Types.COMP_OPTS
module type T = Types.T
type t = (module T)
module Options : sig ... end
module Default : sig ... end
module Diagnostics : sig ... end
exception ERROR of Diagnostics.error
val print_options : Stdlib.Format.formatter -> unit
val default : (module T)
val default_search_path : string list Stdlib.Lazy.t

Search path (suspension).

When evaluated (via Lazy.force), default_search_path is a path that is equivalent to

".:$XDG_CONFIG_HOME/superbol:$COB_CONFIG_DIR"

.

Changing environment variables or the current working directory has no impact on the resulting path when done after evaluation.

val from_file : ?search_path:string list -> ?verbose:bool -> string -> (module T) Cobol_common.Diagnostics.with_diags

from_file ~search_path filename loads a configuration module from the given filename. Note: the evaluation of default_search_path is forces in case search_path is not provided.

val from_dialect : ?search_path:string list -> ?verbose:bool -> Types.DIALECT.t -> (module T) Cobol_common.Diagnostics.with_diags

from_dialect ~search_path dialect returns the configuration module according to the dialect defaults. The caveat about default_search_path given for from_file applies here as well.

val dialect : t -> dialect