validate

package
v0.2.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package validate resolves a parsed widget document into the typed IR and reports every finding of the error catalogue.

Two passes, and both run to completion. The first declares every identifier, so a reference can be told apart from a name that is merely written later; the second builds the IR in canonical block order, resolving each reference against the declaration table and reporting the invariants that can be decided locally. A third, whole-document sweep reports the relations no single statement can be wrong about on its own — an unreferenced role, a channel carried by no edge, a state field written by nothing, a cycle in the predicate graph.

Nothing here stops at the first finding. An author who fixes one error and re-runs to discover the next learns that the tool tells them a fraction of the truth, and starts guessing ahead of it.

Index

Constants

View Source
const DialectVersion = 0

DialectVersion is the one dialect version this interpreter implements. A document declaring any other version is refused rather than guessed at.

Variables

This section is empty.

Functions

func Document

func Document(file string, source []byte) (*ir.Document, []diag.Finding)

Document parses and validates one widget document. It always returns an IR value; the document is sound only when no finding is returned, and a caller that generates from an unsound document is generating from a guess.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL