From 3aec75adf5729048bb7993de96c989e80f5d154d Mon Sep 17 00:00:00 2001 From: Marceline Cramer Date: Tue, 5 May 2026 16:17:01 -0600 Subject: [PATCH] Variable types -> metadata --- crates/frontend/src/ast.rs | 1 + crates/ir/src/lib.rs | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/frontend/src/ast.rs b/crates/frontend/src/ast.rs index 46cee35..5f8271d 100644 --- a/crates/frontend/src/ast.rs +++ b/crates/frontend/src/ast.rs @@ -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; diff --git a/crates/ir/src/lib.rs b/crates/ir/src/lib.rs index f2eeb46..580519f 100644 --- a/crates/ir/src/lib.rs +++ b/crates/ir/src/lib.rs @@ -135,10 +135,10 @@ pub struct RuleBody { /// 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, + pub vars: Vec, /// Maps relation indices to the IDs of loaded relations. pub loaded: Vec, @@ -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,