package b0

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module B0_fileSource

b0 file source and expansion.

Syntactic metadata

Sourcetype smeta

Metadata attached to syntactic constructs.

loc m is the text source location of i.

Sourceval loc_errf : smeta -> ('a, Format.formatter, unit, string) format4 -> 'a

loc_errf smeta fmt formats an error for the location in smeta. The result should be printed as is on the TTY.

b0 files sources

Sourcetype b0_boot = (string * smeta) list

The type for @@@B0.boot directive data. The list of strings.

Sourcetype b0_include = (string * smeta) * (B0_std.Fpath.t * smeta)

The type for @@@B0.include directive data. The scope name and the included file.

The type for #require directive data. The library name.

Sourcetype mod_use = B0_std.Fpath.t * smeta

The type for #mod_use directive data. The path to the module source.

Sourcetype t

The type for b0 files sources.

Sourceval of_string : file:B0_std.Fpath.t -> string -> (t, string) result

of_string ~file s parses a b0 file from s. file is the file used for locations, it must be absolute.

Sourceval file : t -> B0_std.Fpath.t

file f is the b0 file's file.

Sourceval b0_boots : t -> b0_boot list

b0_boots f are the individual @@@B0.boot directives.

Sourceval b0_includes : t -> b0_include list

b0_includes f are the @@@B0.includes directives. The scope name and the included file.

Sourceval requires : t -> require list

requires s are the library names of the #require directives.

Sourceval mod_uses : t -> mod_use list

mod_uses s are the file path of the #mod_use directives.

Sourceval ocaml_unit : t -> string * smeta

ocaml_unit s is the script's OCaml implementation unit.

Sourceval pp_dump : t B0_std.Fmt.t

pp_dump dumps the parsed b0 file.

Sourceval pp_locs : t B0_std.Fmt.t

pp_locs dumps the source text locations of s.

Expanded sources

Sourcetype expanded

The type for sources with expanded expanded directives and scoping instructions in place.

Sourceval expand : t -> (expanded, string) result

expand f expands f's includes.

Sourceval expanded_file_manifest : expanded -> B0_std.Fpath.t list

expanded_file_manifest e are all the files that contributed to the expansion of e (including the unexpanded source).

Sourceval expanded_b0_boots : expanded -> b0_boot list

expanded_b0_boots e are all the @@@B0.boots found during expansion.

Sourceval expanded_b0_includes : expanded -> b0_include list

expanded_b0_includes e are the expanded file includes whose scope names have been qualified.

Sourceval expanded_requires : expanded -> require list

expanded_requires e are all the requires that were found. This has duplicates.

Sourceval expanded_src : expanded -> string

expanded_src e is the expanded source with B0_scopeing and mod_uses spliced in instructions and the call to B0_driver.main.