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§
- bibliography 🔒
- Lower
#bibliography(...)directives into a semantic node. - image 🔒
- Raster image resolution and decode for
#image(...)directives. - image_
lower 🔒 - Lower
#imageand#figureparser directives into semantic nodes. - inline 🔒
- Lower inline parser nodes into semantic document children.
- list 🔒
- Lower parsed lists into semantic list nodes.
- pageref 🔒
- Page-reference resolution and its layout fixpoint (issue #72).
- resolve 🔒
- Cross-reference resolver (manifest §6 stage 3, MVP 1).
- set 🔒
- Lower
#setdirectives and coerce directive values. - set_
schema 🔒 - Schema for
#setdirectives recognised in MVP 1.5.
Structs§
- Document
Metadata - Document-level metadata harvested from
#set document(...)directives. The PDF backend writestitleandauthorto the Info dictionary;languageis captured for the catalog/Langentry that the next PDF-metadata slice will wire up. - Evaluator
- Lowerer from parse syntax to semantic document graph.
- Lower
Result - Result of lowering a [
SyntaxTree] into a [Document].
Enums§
- Page
Fixpoint Outcome - The result of driving page references to a fixpoint.
Constants§
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]: evaluate it, then run the §6 stage-3 resolver. The CLI calls this aftermos_parse::parseso a phase barrier can sit between parsing and lowering;loweris the parse-and-lower convenience used by tests and embedders. - resolve
- Run the resolver pass over
documentin 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 to its target’s page number, drawn fromlabel_pages(a label→1-based-page map produced by layout). Returns whether any text changed, so the fixpoint driver can tell when the document settled.