Function brane_ast::compile::compile_snippet_to
source · pub fn compile_snippet_to<R: Read>(
state: &mut CompileState,
reader: R,
package_index: &PackageIndex,
data_index: &DataIndex,
options: &ParserOptions,
stage: CompileStage,
) -> CompileResult
Expand description
Runs the compiler in a stateful manner so that it may compile multiple snippets of the given workflow in succession.
§Generic arguments
R
: The Read-implementing type of thesource
text.
§Arguments
state
: The CompileState of any previous runs (useCompileState::new()
if there have not been any).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 resolveData
-structs.options
: The ParserOptions with which we parse the given file.stage
: The CompileStage up to which to run the pipeline. UseCompileStage::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.