Skip to main content

presolve_compiler/
semantic_reference.rs

1use crate::semantic_id::SemanticId;
2use crate::semantic_provenance::SourceProvenance;
3
4/// A resolved directed relationship between compiler semantic entities.
5#[derive(Debug, Clone, PartialEq, Eq)]
6pub struct SemanticReference {
7    pub kind: SemanticReferenceKind,
8    pub source: SemanticId,
9    pub target: SemanticId,
10    pub provenance: SourceProvenance,
11}
12
13#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
14pub enum SemanticReferenceKind {
15    ActionState,
16    ComputedState,
17    ComputedComputed,
18    /// A direct, compiler-recognized projection from one Computed value onto
19    /// the lifecycle record of an exact Resource declaration.
20    ComputedResource,
21    EffectState,
22    EffectComputed,
23    ProvidesContext,
24    ConsumesContext,
25    ResolvesToProvider,
26    EventMethod,
27    TemplateState,
28    TemplateComputed,
29    TemplateLocal,
30    FieldBindingField,
31    FieldBindingForm,
32    ValidationRuleField,
33}