Skip to main content

Crate mos_core

Crate mos_core 

Source
Expand description

Core types for the Mosaic typesetting engine.

Implements the document model (manifest §5) and diagnostics surface (manifest §31). Every other crate depends on this one; nothing here depends on parsing, layout, or backends.

Re-exports§

pub use codes::DiagnosticCategory;
pub use codes::DiagnosticCode;
pub use codes::DiagnosticDef;

Modules§

codes
Diagnostic code registry — the single source of truth for every diagnostic the compiler can emit.

Structs§

CollectingSink
Collects every diagnostic and remembers whether any was an error.
ContentHash
Opaque content / dependency hash.
Diagnostic
A user-facing diagnostic (manifest §16, §31).
DiagnosticAbort
A phase aborted for structural reasons (see the module docs). Carries no payload: the diagnostics explaining why have already been emitted to the sink.
Document
The lowered semantic document graph (manifest §5, §6 stage 2).
Node
A semantic document node (manifest §5.1).
NodeId
Stable identifier for a document node.
SourceSpan
A byte-range location in a source file (manifest §6 stage 1).
StyleId
Identifier for a resolved style bundle.
Suggestion
A machine-actionable fix for a Diagnostic.

Enums§

AttrValue
Attribute value carried on a semantic Node.
CoreError
Convenience top-level error type for crates that want a single Result alias without inventing their own.
DiagnosticAnnotation
A sub-message attached to a Diagnostic.
NodeKind
The kinds of nodes Mosaic recognises (manifest §5.1).
Severity
Diagnostic severity (manifest §31).

Traits§

DiagnosticSink
Receiver for diagnostics emitted during a compiler phase.

Functions§

linecol
Convert a byte offset into a 1-based (line, column) pair.

Type Aliases§

AttrMap
Attribute map carried on each node. Keys are interned strings in a later iteration; for now plain String keys are fine for the stub.
DiagnosticResult
Result of a compiler phase. Ok(T) on (possibly diagnostic-bearing) completion; Err(DiagnosticAbort) only on a structural abort.
Result