-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor central ADTs into a core module for modularity
This is a refactor in preparation for adding procedural macros in #112 Crates that define proc macros can only export proc macros. Therefore, these must be a seperate crate than Conjure Oxide (Conjure Macros). To avoid circular dependencies, datatypes previously defined in Conjure Oxide that are also needed in Conjure Macros have been refactored into a Conjure Core Crate. This creates the following dependency graph: Conjure Core -----> Conjure Macros | | | v ------------------> Conjure Oxide Conjure Oxide will still be the sole "user interface", and will re-export members of core and macros when these should be public facing. Co-authored-by: Niklas Dewally <niklas@dewally.com>
- Loading branch information
1 parent
0e803ca
commit e86f7b2
Showing
16 changed files
with
71 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"rust": { | ||
{ | ||
"rust-analyzer.check.command": "check", | ||
"editor.defaultFormatter": "rust-lang.rust-analyzer", | ||
"editor.formatOnSave": true | ||
"editor.formatOnSave": true, | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
pub mod ast; | ||
pub mod error; | ||
pub mod find_conjure; | ||
pub mod parse; | ||
mod solvers; | ||
|
||
pub use ast::Model; | ||
pub use conjure_core::ast; // re-export core::ast as conjure_oxide::ast | ||
pub use conjure_core::ast::Model; // rexport core::ast::Model as conjure_oxide::Model | ||
pub use conjure_core::solvers::Solver; | ||
|
||
pub use error::Error; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
mod error; | ||
pub mod minion; | ||
pub use crate::ast::Model; | ||
pub use error::*; | ||
mod solver_list; | ||
pub use solver_list::*; | ||
|
||
pub trait FromConjureModel | ||
where | ||
Self: Sized, | ||
{ | ||
fn from_conjure(model: Model) -> Result<Self, SolverError>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "conjure_core" | ||
version = "0.0.1" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
serde = { version = "1.0.192", features = ["derive"] } | ||
serde_json = "1.0.108" | ||
serde_with = "3.4.0" | ||
strum = "0.25.0" | ||
strum_macros = "0.25.3" | ||
thiserror = "1.0.50" | ||
|
||
[lints] | ||
workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Core datatypes for use in Conjure Oxide. | ||
|
||
This crate is internal to conjure_oxide, and should not be treated as a stable | ||
API. Relevant types are re-exported through conjure_oxide. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pub mod ast; | ||
|
||
pub mod solvers; | ||
pub use solvers::Solver; |
File renamed without changes.