Skip to main content

compile_source

Function compile_source 

Source
pub fn compile_source(
    source: &str,
    options: &CompileOptions,
    cancel: Option<Arc<AtomicBool>>,
) -> Result<BytecodeChunk, CompileError>
Expand description

Compiles source into a decoded bytecode chunk.

A malformed program is reported as the wire-compatible Ok(BytecodeChunk::Error { .. }) chunk, with its ":<line>: <message>" payload rendered from the structured CompileErrorKind::Parse failure the strict channel reports.

ยงErrors

Returns an internal error for compiler limits, or CompileErrorKind::Cancelled when the cancel flag is set at a cooperative compiler safepoint.