Module Core.Local_env

type md_expr = [
| `Structure
| `Functor
]
type path = [ `Psig_module of string | md_expr ] list

path is a DFS representation of recursive signature item

type psig_value

psig_value stores the function with the associated specification found in the attributes.

The path and actual signature_item is stored inside psig_value in order to be retrived in the respective structure_item

type t
val get_path : psig_value -> path

get_path psig_value returns the path inside psig_value

val get_properties : psig_value -> Properties.t

get_properties psig_value returns the properties inside psig_value

val get_name : psig_value -> string

get_name psig_value returns the function name inside psig_value

val get_value : psig_value -> Ppxlib.signature_item option

get_value psig_value returns the actual value inside psig_value

val get_file_name : unit -> string

get_file_name () returns the file_name inside the environment t

Default value is "_none_" if the file_name has not been set

val get_file_name_exn : unit -> string

get_file_name_exn () returns the file_name inside the environment t

Raise an exception if the file_name has not been set

val get_file_name_opt : unit -> string option

get_file_name_opt () returns the file_name inside the environment t

Returns None if the file_name has not been set

val get_psig_values : unit -> psig_value list

get_psig_values () returns the list of psig_value in the environment t

val env_with_psig_value : psig_value -> unit

env_with_psig_value psig_value add psig_value to the environment t

val env_with_file_name : string -> unit

env_with_file_name file_name set the file_name in the environment t

val add_env : ?⁠path:path -> ?⁠properties:Properties.t -> ?⁠value:Ppxlib.signature_item -> string -> unit

add_env name build and add a psig_value in the environment t

val init_env : ?⁠file_name:string -> unit -> unit

init_env reset the environment to default state, file_name being processed can be set at this point with the parameter file_name

val store_env : unit -> unit

store_env store on disk the environment t

val fetch_env : string -> unit

fetch_env file_path restore the environment t from the disk using file_name to fetch the correct environment

val pp : Stdlib.Format.formatter -> unit

pp () pretty print the current environment, exposed only for internal testing