Variable types -> metadata

This commit is contained in:
2026-05-05 16:17:01 -06:00
parent 5dcbcbe522
commit 3aec75adf5
2 changed files with 8 additions and 2 deletions

View File

@@ -325,6 +325,7 @@ impl ir::ProgramInfo for ProgramInfo {
type AssumptionMeta = Infallible;
type RuleMeta = AstNode;
type RuleBodyMeta = AstNode;
type VariableMeta = Infallible;
type ExprMeta = AstNode;
type BinaryOp = BinaryOpKind;
type UnaryOp = ir::UnaryOpKind;

View File

@@ -135,10 +135,10 @@ pub struct RuleBody<T: ProgramInfo> {
/// Metadata for this rule body.
pub meta: T::RuleBodyMeta,
/// The type of each variable.
/// The metadata for each variable.
///
/// Also defines the upper bound on valid variable indices.
pub vars: Vec<Type>,
pub vars: Vec<T::VariableMeta>,
/// Maps relation indices to the IDs of loaded relations.
pub loaded: Vec<T::RelationLabel>,
@@ -435,6 +435,9 @@ pub trait ProgramInfo {
/// Metadata for a rule body.
type RuleBodyMeta: Info;
/// Metadata for each variable in a rule body.
type VariableMeta: Info;
/// Metadata for each expression tree node.
type ExprMeta: Info;
@@ -464,6 +467,7 @@ macro_rules! def_bound_info {
AssumptionMeta: $bounds,
RuleMeta: $bounds,
RuleBodyMeta: $bounds,
VariableMeta: $bounds,
ExprMeta: $bounds,
BinaryOp: $bounds,
UnaryOp: $bounds,
@@ -479,6 +483,7 @@ macro_rules! def_bound_info {
AssumptionMeta: $bounds,
RuleMeta: $bounds,
RuleBodyMeta: $bounds,
VariableMeta: $bounds,
ExprMeta: $bounds,
BinaryOp: $bounds,
UnaryOp: $bounds,