Function brane_ast::compile::compile_program_to

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

Runs the compiler passes in-order, up to the specified pass.

§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.
  • stage: The CompileStage up to which to run the pipeline. Use CompileStage::All to do the entire thing.

§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.