Skip to content

Commit

Permalink
Merge pull request #663 from conjure-cp/nik/scoping/02-move-model-to-ast
Browse files Browse the repository at this point in the history
refactor(ast)!: move conjure_core::model to conjure_core::ast::model
  • Loading branch information
ozgurakgun authored Feb 9, 2025
2 parents 775b2e2 + 55781f0 commit 32fd43f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion conjure_oxide/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
pub use conjure_core::ast;
pub use conjure_core::error::Error;
pub use conjure_core::metadata::Metadata;
pub use conjure_core::model::Model;
pub use conjure_core::parse::{get_example_model, get_example_model_by_path, model_from_json};
pub use conjure_core::rule_engine;
pub use conjure_core::rule_engine::{
Expand All @@ -14,6 +13,7 @@ pub use conjure_core::rule_engine::{
pub use conjure_core::rules;
pub use conjure_core::solver;
pub use conjure_core::solver::SolverFamily;
pub use conjure_core::Model;

pub mod find_conjure;
pub mod utils;
Expand Down
2 changes: 1 addition & 1 deletion conjure_oxide/tests/model_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Tests for various functionalities of the Model

use conjure_core::model::Model;
use conjure_core::ast::Model;
use conjure_oxide::ast::*;

#[test]
Expand Down
7 changes: 5 additions & 2 deletions crates/conjure_core/src/ast/mod.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
pub mod pretty;
pub mod types;

mod atom;
mod domains;
mod expressions;
mod literals;
pub mod pretty;
pub mod model;
mod symbol_table;
pub mod types;
mod variables;

pub use atom::Atom;
pub use domains::Domain;
pub use domains::Range;
pub use expressions::Expression;
pub use literals::Literal;
pub use model::Model;
pub use symbol_table::Name;
pub use symbol_table::SymbolTable;
pub use types::ReturnType;
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions crates/conjure_core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
pub extern crate self as conjure_core;

pub use model::Model;
pub use ast::model::Model;

pub mod ast;
pub mod bug;
pub mod context;
pub mod error;
pub mod metadata;
pub mod model;
pub mod parse;
pub mod rule_engine;
pub mod rules;
Expand Down
3 changes: 1 addition & 2 deletions crates/conjure_core/src/rule_engine/rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use std::hash::Hash;

use thiserror::Error;

use crate::ast::{DecisionVariable, Expression, Name, SymbolTable};
use crate::model::Model;
use crate::ast::{DecisionVariable, Expression, Model, Name, SymbolTable};

#[derive(Debug, Error)]
pub enum ApplicationError {
Expand Down

0 comments on commit 32fd43f

Please sign in to comment.