Skip to main content

analyze

Function analyze 

Source
pub fn analyze<O: PineOutput>(
    program: &Program,
    builtins: &HashMap<String, Value<O>>,
    loader: Option<&dyn LibraryLoader>,
) -> Vec<Diagnostic>
Expand description

Run semantic analysis over a parsed program and return every error found. An empty result means the program passed all implemented semantic checks.

builtins is the runtime’s registered built-ins (from pine_builtins::register_namespace_objects plus the per-bar variables) — the names that resolve without a user declaration. It is taken as the full value map so later passes can inspect the objects’ types.

loader, when present, resolves imported libraries so alias.export resolves cross-file (and a library’s own errors are reported, tagged with the library path). Without it, imports declare only the alias.