From 95427e547eeb60b6ed9ce441d0e590c47aa95841 Mon Sep 17 00:00:00 2001 From: oflatt Date: Fri, 2 Feb 2024 08:10:36 -0800 Subject: [PATCH] add pub --- tree_inputs/src/lib.rs | 4 +++- tree_inputs/src/schema.rs | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tree_inputs/src/lib.rs b/tree_inputs/src/lib.rs index 07156af46..7976461f3 100644 --- a/tree_inputs/src/lib.rs +++ b/tree_inputs/src/lib.rs @@ -1,4 +1,6 @@ -pub mod expr; +use schema::Program; + +pub mod schema; pub type Result = std::result::Result<(), egglog::Error>; diff --git a/tree_inputs/src/schema.rs b/tree_inputs/src/schema.rs index aa35745c5..4ac4a6df5 100644 --- a/tree_inputs/src/schema.rs +++ b/tree_inputs/src/schema.rs @@ -4,23 +4,23 @@ use std::rc::Rc; -struct Program { +pub struct Program { entry: Expr, // must be a function functions: Vec, // a list of other functions } -enum Ctx { +pub enum Ctx { Global, } -enum Type { +pub enum Type { IntT, BoolT, FuncT(Rc, Rc), TupleT(Vec>), } -enum BinaryOp { +pub enum BinaryOp { Add, Sub, Mul, @@ -30,22 +30,22 @@ enum BinaryOp { Write, } -enum UnaryOp { +pub enum UnaryOp { Not, Print, } -enum Constant { +pub enum Constant { Int(i64), Bool(bool), } -enum Order { +pub enum Order { Parallel, Sequential, } -enum Expr { +pub enum Expr { Const(Ctx, Constant), Bop(BinaryOp, Rc, Rc), Uop(UnaryOp, Rc),