Skip to main content

Module parser

Module parser 

Source

Structs§

ScriptParser

Functions§

parse_expression_str
Parse one expression from source text with an empty module scope, for tooling that shows lowering without running (docs demos, explain output). No imports exist here, so bare function calls fail and qualified calls fail against the empty table; only INSPECT passes through untouched. Arithmetic, comparison, variables, env reads, keypaths, and literals lower normally, with literal only subtrees folded before flattening.
parse_guard_expr_str
parse_script
parse_script_with_modules
Parse with a module provenance table so calls resolve statically: qualified MODULE::NAME checks membership, bare NAME resolves through SCRIPT definitions and IMPORTed modules, and anything else fails at parse time instead of at runtime.
parse_script_with_preseed
Parse a snippet with an enclosing parse’s visible scope state, so re-parsed inner commands (async bodies) resolve calls identically. The snippet never defines, only reads: seeds affect lookup alone.