compile_with_state

Function compile_with_state 

Source
pub fn compile_with_state(
    source: &str,
    fns: &[Box<dyn Function>],
    state: &TypeState,
    config: CompileConfig,
) -> Result
Expand description

Compiles the given source code with a specified compilation state and configuration.

This function performs parsing, compilation, and optional unused expression checking before returning the compilation result.

§Arguments

  • source - The source code to be compiled.
  • fns - A list of function definitions available during compilation.
  • state - The compilation state containing local and external environments.
  • config - The compilation configuration settings.

§Returns

A Result containing the compiled program or a diagnostic errors.

§Errors

On compilation error, a list of diagnostics is returned.