Skip to main content

Crate mos_eval

Crate mos_eval 

Source
Expand description

Expression and scripting evaluator (manifest §4, §25).

The “evaluator” is really a lowerer + resolver: it walks a [SyntaxTree] from mos-parse and builds the typed semantic [Document] graph from mos-core (manifest §6 stage 2), then runs the resolve pass to assign section numbers and rewrite @label cross-references (§6 stage 3, MVP 1).

Modules§

suggest 🔒
Conservative nearest-match selection for “did you mean” diagnostics.

Structs§

DocumentMetadata
Document-level metadata harvested from #set document(...) directives.
EvaluationState 🔒
Evaluator
Lowerer from parse syntax to semantic document graph.
LowerResult
Result of lowering a [SyntaxTree] into a [Document].

Enums§

PageFixpointOutcome
The result of driving page references to a fixpoint.

Constants§

DOC_ATTR
Attribute key holding a node’s attached /** … */ doc-comment text. Read by the LSP hover handler.
LABEL_SPAN_END_ATTR 🔒
LABEL_SPAN_START_ATTR 🔒

Functions§

insert_label_attributes 🔒
lower
Convenience: parse + lower + resolve in one step. Concatenates the diagnostics from each stage so callers can render them uniformly.
lower_raw_block 🔒
lower_tree
Lower an already-parsed [SyntaxTree].
resolve
Run the resolver pass over document in place. Returns any diagnostics produced; the document is modified regardless of whether errors are present so partial output is still renderable.
resolve_page_reference_fixpoint
Drive page-reference resolution to a fixpoint against an injected layout.
resolve_page_references
Rewrite every @page(label) reference’s visible text.