Skip to content

Commit

Permalink
add pub
Browse files Browse the repository at this point in the history
  • Loading branch information
oflatt committed Feb 2, 2024
1 parent 185be05 commit 95427e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion tree_inputs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pub mod expr;
use schema::Program;

pub mod schema;

pub type Result = std::result::Result<(), egglog::Error>;

Expand Down
16 changes: 8 additions & 8 deletions tree_inputs/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@

use std::rc::Rc;

struct Program {
pub struct Program {
entry: Expr, // must be a function
functions: Vec<Expr>, // a list of other functions
}

enum Ctx {
pub enum Ctx {
Global,
}

enum Type {
pub enum Type {
IntT,
BoolT,
FuncT(Rc<Type>, Rc<Type>),
TupleT(Vec<Rc<Type>>),
}

enum BinaryOp {
pub enum BinaryOp {
Add,
Sub,
Mul,
Expand All @@ -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<Expr>, Rc<Expr>),
Uop(UnaryOp, Rc<Expr>),
Expand Down

0 comments on commit 95427e5

Please sign in to comment.