Expand description
Document-level semantic validation pass for Zenith.
This module wires together the validation submodule and re-exports the
public API surface. All logic lives in check.
§Public API
use zenith_core::{validate, KdlAdapter, KdlSource};
let src = r##"zenith version=1 {
project id="p" name="P"
tokens format="zenith-token-v1" { }
styles { }
document id="d" title="D" {
page id="pg" w=(px)100 h=(px)100 { }
}
}"##;
let doc = KdlAdapter.parse(src.as_bytes()).expect("parses");
let report = validate(&doc);
assert!(!report.has_errors());Structs§
- Validation
Report - The outcome of a full document validation pass.
Functions§
- apply_
policy - Apply
policyto an assembled diagnostic list, returning the adjusted list. - validate
- Run the full document validation pass against the document’s own in-file diagnostic policy and in-file brand contract.
- validate_
with_ policy - Run the full document validation pass, applying an externally supplied
policyandbrandcontract at their respective choke points.