Function brane_ast::compile::compile_program

source ·
pub fn compile_program<R: Read>(
    reader: R,
    package_index: &PackageIndex,
    data_index: &DataIndex,
    options: &ParserOptions,
) -> CompileResult
Expand description

Runs the compiler passes in-order, all of them.

§Generic arguments

  • R: The Read-implementing type of the source text.

§Arguments

  • reader: The reader that provides access to the source code to compile.
  • package_index: The PackageIndex that is used to resolve imports.
  • data_index: The DataIndex that is used to resolve Data-structs.
  • options: The ParserOptions with which we parse the given file.

§Returns

The compiled Workflow if it got that far, or else the compiled UnresolvedWorkflow or Program. Will also output a list of any warnings that may have occurred (empty list is good).

§Errors

This function may error if the program was ill-formed. Multiple errors are returned simultaneously per-stage.