From 83774a7ed52802ad5ef2b49a5fb3586492b50aba Mon Sep 17 00:00:00 2001 From: Borodinov Ilya Date: Mon, 11 Nov 2024 22:29:18 +0300 Subject: [PATCH] initial structure --- Cargo.toml | 14 ++++++++------ crates/ast/Cargo.toml | 6 ++++++ crates/ast/src/lib.rs | 14 ++++++++++++++ crates/codegen/Cargo.toml | 6 ++++++ crates/codegen/src/lib.rs | 14 ++++++++++++++ crates/parser/Cargo.toml | 6 ++++++ crates/parser/src/lib.rs | 14 ++++++++++++++ integrations/axum/Cargo.toml | 6 ++++++ integrations/axum/src/lib.rs | 14 ++++++++++++++ 9 files changed, 88 insertions(+), 6 deletions(-) create mode 100644 crates/ast/Cargo.toml create mode 100644 crates/ast/src/lib.rs create mode 100644 crates/codegen/Cargo.toml create mode 100644 crates/codegen/src/lib.rs create mode 100644 crates/parser/Cargo.toml create mode 100644 crates/parser/src/lib.rs create mode 100644 integrations/axum/Cargo.toml create mode 100644 integrations/axum/src/lib.rs 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); + } +}