Skip to main content

compile_from_scope

Function compile_from_scope 

Source
pub fn compile_from_scope(
    scope: &BindingScope,
    source_dir: Option<&Path>,
    polydat_lib_paths: Vec<PathBuf>,
    strict: bool,
    context: &str,
    cursor_limit: Option<u64>,
    pragmas: &PragmaSet,
) -> Result<ScopeKernel, String>
Expand description

Compile a Polydat Kernel from a pre-built BindingScope.

The scope has already been validated and carries structured provenance. This function emits the scope to Polydat source, collects required outputs, and compiles via the standard Polydat compiler.

pragmas carries the chain-walked effective pragma state for the scope (typically obtained from ScopeTree::nodes[idx].pragmas). Pragma directives matching the effective state are prepended to the emitted source so the Polydat compiler’s existing AST-pragma extraction (SRD 15 §“Module-Level Pragmas”) drives the assembler’s strict-wire flags. Pass &PragmaSet::default() to disable pragma effects for legacy callers.