package b0
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=dba2fc571f39f3b8e87ee55c77bdec7ec6a5ddc7d99b8b20aeda848af546be04
md5=51ee1d66acc4d7f87bdceac1341b7711
doc/b0.b0/B0_def/Scope/index.html
Module B0_def.Scope
Scopes are used to track and scope B0 definitions created by libraries and B0 files.
Library scopes
lib l
sets up a scope for library l
. Must be called before making any static definition in a library. FIXME example.
B0 file scopes
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.
Definition sealing
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.