Skip to main content

Module validate

Module validate 

Source
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§

ValidationReport
The outcome of a full document validation pass.

Functions§

apply_policy
Apply policy to 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 policy and brand contract at their respective choke points.