From 81b61610a409909bc85ad2aef53ae4abd38db867 Mon Sep 17 00:00:00 2001 From: German Nikolishin Date: Mon, 5 Feb 2024 19:48:59 +0000 Subject: [PATCH] add semantics crate --- crates/semantics/Cargo.toml | 13 +++++++++++++ crates/semantics/src/lib.rs | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 crates/semantics/Cargo.toml create mode 100644 crates/semantics/src/lib.rs diff --git a/crates/semantics/Cargo.toml b/crates/semantics/Cargo.toml new file mode 100644 index 0000000..e324f76 --- /dev/null +++ b/crates/semantics/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "folidity-semantics" +authors.workspace = true +categories.workspace = true +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +repository.workspace = true +version.workspace = true + + +[dependencies] diff --git a/crates/semantics/src/lib.rs b/crates/semantics/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/crates/semantics/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}