Skip to main content

Crate brink_analyzer

Crate brink_analyzer 

Source
Expand description

Cross-file semantic analysis for inkle’s ink narrative scripting language.

The analyzer merges per-file SymbolManifests from brink-ir into a unified SymbolIndex, then runs validation passes (name resolution, duplicate detection, type checking). Both brink-compiler and brink-lsp consume the analysis result.

Structs§

AnalysisOptions
Tooling options for analysis: the registered host manifest and the severity policy for its external checks. Defaults to no manifest.
AnalysisResult
The output of cross-file semantic analysis.
FileId
Opaque identifier for a source file within a multi-file project.
ResolvedParam
A merged parameter: name (from the ink declaration) and resolved type.
ResolvedType
A resolved type reference: the written name, its base type (if resolvable), and any closed-domain constraint (from a semantic type definition).
SymbolMeta
Per-symbol merged metadata (docs, types, values), surfaced to the IDE and used by the call-site checks. Keyed by the symbol’s DefinitionId on the AnalysisResult. For externals this merges inline docs with the registered host manifest; knots/stitches carry inline docs only; VAR/CONST add an inferred initializer value.
ValueMeta
Initializer-derived metadata for a VAR or CONST declaration. Purely presentational — ink variables are dynamically retyped at runtime, so this never drives diagnostics.

Enums§

ExternalCheckSeverity
Severity policy for manifest-driven external checks. Configurable as a compiler/IDE flag; defaults to Error (a registered manifest is binding).
InferredType
The type of a VAR/CONST initializer literal. Deliberately separate from the host-manifest BaseType vocabulary — Divert/List are ink runtime concepts that must not leak into the manifest serialization schema.

Functions§

analyze
Run cross-file semantic analysis with default options (no host manifest).
analyze_with_options
Run cross-file semantic analysis with explicit tooling options, including an optional host-capability manifest and its external-check severity.

Type Aliases§

ResolutionMap
Maps reference use-sites to their resolved definitions, with file provenance.