diff --git a/Cargo.toml b/Cargo.toml index feaf251..39fb07a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,8 @@ -[package] -name = "Cogs" -version = "0.1.0" -edition = "2021" - -[dependencies] +[workspace] +members = [ + "crates/ast", + "crates/codegen", + "crates/parser", + "integrations/axum" +] +resolver = "2" diff --git a/crates/ast/Cargo.toml b/crates/ast/Cargo.toml new file mode 100644 index 0000000..ec10812 --- /dev/null +++ b/crates/ast/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cogs_ast" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/crates/ast/src/lib.rs b/crates/ast/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/crates/ast/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/crates/codegen/Cargo.toml b/crates/codegen/Cargo.toml new file mode 100644 index 0000000..e4f8fab --- /dev/null +++ b/crates/codegen/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cogs_codegen" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/crates/codegen/src/lib.rs b/crates/codegen/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/crates/codegen/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/crates/parser/Cargo.toml b/crates/parser/Cargo.toml new file mode 100644 index 0000000..1f550d8 --- /dev/null +++ b/crates/parser/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cogs_parser" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/crates/parser/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/integrations/axum/Cargo.toml b/integrations/axum/Cargo.toml new file mode 100644 index 0000000..7842e54 --- /dev/null +++ b/integrations/axum/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "cogs_axum" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/integrations/axum/src/lib.rs b/integrations/axum/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/integrations/axum/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}