B0_def.Scope
Scopes are used to track and scope B0 definitions created by libraries and B0 files.
lib l
sets up a scope for library l
. Must be called before making any static definition in a library. FIXME example.
Note. This is used by the implementation of the driver API, if you are fiddling with this you are likely doing something wrong.
val root : B00_std.Fpath.t -> unit
root file
initializes B0 file scoping for the root B0 file at the absolute file path file
.
This installs a Printexc
.set_uncaught_exception_handler to handle uncaught and Duplicate
. If that happens the error is logged and the program exit
s with B0_driver.Exit.b0_file_error
.
val open' : string -> B00_std.Fpath.t -> unit
open' name
opens scope name
to add the definitions of the absolute file path file
.
Warning. Scope unicity is not checked by the module this is expected to be handled by the client.
close ()
closes the last open'
ed scope.
seal ()
prevents further definitions from being made. This function is called at the end of the root B0 file.
Exception thrown if a definition is made after seal
was invoked. The argument is an error message to print. The backtrace should point to the location of the illegal definition.