vize_l0 0.498.0

L0 - the Davinci foundation level: ids, side tables, keys, dumps, diagnostics, passes and facts
Documentation
//! The production fact-group identity table.
//!
//! A group's [`AnalysisId`] is also its bit in every pass's
//! [`Preserved`](crate::pass::Preserved) mask, so ids must be unique across
//! every crate that registers a producer. This table is the single
//! allocation point: a P4-3 wave (or any later provider) takes its group's id
//! from here and adds new ids here, never mints a literal of its own.
//!
//! Ids `0..32` are production groups; ids `32..64` stay free for test and
//! bench fixtures, which never share a registry with production groups.

use crate::pass::AnalysisId;

/// `Bindings` — script bindings and their spans (P4-3a).
pub const BINDINGS: AnalysisId = AnalysisId::new(1);
/// `UndefinedRefs` — template identifiers no binding resolves (P4-3a).
pub const UNDEFINED_REFS: AnalysisId = AnalysisId::new(2);
/// `UnusedBindings` — setup bindings nothing reads (P4-3c).
pub const UNUSED_BINDINGS: AnalysisId = AnalysisId::new(3);
/// `ComponentUsages` — component usages keyed by resolved identity (P4-3b).
pub const COMPONENT_USAGES: AnalysisId = AnalysisId::new(4);
/// `RenderTree` — the cross-file render-tree edges (P4-3b).
pub const RENDER_TREE: AnalysisId = AnalysisId::new(5);
/// `Reactivity` — the L3 reactivity lattice with its verdict axis (P4-3d).
pub const REACTIVITY: AnalysisId = AnalysisId::new(6);
/// `EffectGraph` — effect dependency sets (P4-3e).
pub const EFFECT_GRAPH: AnalysisId = AnalysisId::new(7);
/// `ProvideInject` — provide/inject pairs (P4-3f).
pub const PROVIDE_INJECT: AnalysisId = AnalysisId::new(8);
/// `RaceConditions` — async-setup races (P4-3f).
pub const RACE_CONDITIONS: AnalysisId = AnalysisId::new(9);
/// `HtmlElements` — authored template elements a nesting witness cites (P4-11b).
pub const HTML_ELEMENTS: AnalysisId = AnalysisId::new(10);
/// `HtmlComposedNesting` — nesting proven only in a parent's context (P4-11b).
pub const HTML_COMPOSED_NESTING: AnalysisId = AnalysisId::new(11);
/// `ExpressionFacts` — foreign-dialect expression facts over the P6-1b
/// contract world.
pub const EXPRESSION_FACTS: AnalysisId = AnalysisId::new(12);
/// `PartialHoles` — L1 `Unexpected` / `Missing` holes beside a partial page (P5-10).
pub const PARTIAL_HOLES: AnalysisId = AnalysisId::new(13);
/// `PartialRegions` — kept L2 fragments in the well-formed regions (P5-10).
pub const PARTIAL_REGIONS: AnalysisId = AnalysisId::new(14);
/// `PartialScopes` — scope names of those fragments (P5-10).
pub const PARTIAL_SCOPES: AnalysisId = AnalysisId::new(15);
/// Original selected authored lint headers, scoped to one genuine element.
pub const NATIVE_LINT_HEADERS: AnalysisId = AnalysisId::new(16);
/// Original selected authored attributes, keyed by their genuine ordinals.
pub const NATIVE_LINT_ATTRIBUTES: AnalysisId = AnalysisId::new(17);
/// Unsupported-ARIA counterexamples derived from original header/attribute facts.
pub const NATIVE_UNSUPPORTED_ARIA: AnalysisId = AnalysisId::new(18);
/// Closed original direct-child interpolation markers, keyed by actual ordinal.
pub const NATIVE_DIRECT_INTERPOLATIONS: AnalysisId = AnalysisId::new(19);
/// Textarea counterexamples derived from genuine header and marker facts.
pub const NATIVE_TEXTAREA_MUSTACHE: AnalysisId = AnalysisId::new(20);

/// The first id tests and bench fixtures may use.
pub const FIXTURE_BASE: u8 = 32;

/// Every allocated production id, in id order.
pub const PRODUCTION: [AnalysisId; 20] = [
    BINDINGS,
    UNDEFINED_REFS,
    UNUSED_BINDINGS,
    COMPONENT_USAGES,
    RENDER_TREE,
    REACTIVITY,
    EFFECT_GRAPH,
    PROVIDE_INJECT,
    RACE_CONDITIONS,
    HTML_ELEMENTS,
    HTML_COMPOSED_NESTING,
    EXPRESSION_FACTS,
    PARTIAL_HOLES,
    PARTIAL_REGIONS,
    PARTIAL_SCOPES,
    NATIVE_LINT_HEADERS,
    NATIVE_LINT_ATTRIBUTES,
    NATIVE_UNSUPPORTED_ARIA,
    NATIVE_DIRECT_INTERPOLATIONS,
    NATIVE_TEXTAREA_MUSTACHE,
];

// Unique, ascending, and below the fixture range.
const _: () = {
    let mut rest: &[AnalysisId] = &PRODUCTION;
    let mut previous = None;
    while let [id, tail @ ..] = rest {
        assert!(id.index() < FIXTURE_BASE);
        if let Some(previous) = previous {
            assert!(previous < id.index());
        }
        previous = Some(id.index());
        rest = tail;
    }
};