LibSourceLib: record of operations, backtrack, low-level sections
This module provides a general mechanism to keep a trace of all operations and to backtrack (undo) those operations. It provides also the section mechanism (at a low level; discharge is not known at this step).
type node = | Leaf of Libobject.t| CompilingLibrary of Nametab.object_prefix| OpenedModule of is_type * export * Nametab.object_prefix * Summary.frozen| OpenedSection of Nametab.object_prefix * Summary.frozenval open_atomic_objects :
Libobject.open_filter ->
int ->
Nametab.object_prefix ->
lib_atomic_objects ->
unitclassify_segment seg verifies that there are no OpenedThings, clears ClosedSections and FrozenStates and divides Leafs according to their answers to the classify_object function in three groups: Substitute, Keep, Anticipate respectively. The order of each returned list is the same as in the input list.
segment_of_objects prefix objs forms a list of Leafs
Low-level adding operations
Adding operations (which call the cache method, and getting the current list of operations (most recent ones coming first).
The function contents gives access to the current entire segment
The function contents_after returns the current library segment, starting from a given section path.
User-side names
Kernel-side names
Are we inside an opened section
Are we inside an opened module type
Returns the opening node of a given name
val start_module :
export ->
Names.module_ident ->
Names.ModPath.t ->
Summary.frozen ->
Nametab.object_prefixval start_modtype :
Names.module_ident ->
Names.ModPath.t ->
Summary.frozen ->
Nametab.object_prefixval end_module :
unit ->
Libobject.object_name
* Nametab.object_prefix
* Summary.frozen
* library_segmentval end_modtype :
unit ->
Libobject.object_name
* Nametab.object_prefix
* Summary.frozen
* library_segmentThe function library_dp returns the DirPath.t of the current compiling library (or default_library)
Extract the library part of a name even if in a section
States).Keep only the libobject structure, not the objects themselves
Section management for discharge
val discharge_abstract_universe_context :
Section.abstr_info ->
Univ.AUContext.t ->
Univ.universe_level_subst * Univ.AUContext.t