From 433f2db4d1dace1e4b00305ac9ec7945db321873 Mon Sep 17 00:00:00 2001 From: mlokr Date: Wed, 31 Jan 2024 17:54:38 +0100 Subject: [PATCH] fixing some warnings --- Cargo.lock | 4 ++++ Cargo.toml | 2 +- hbasm/src/ins.rs | 6 +++--- hbasm/src/lib.rs | 10 +++++----- hblang/Cargo.toml | 8 ++++++++ hblang/src/lib.rs | 14 ++++++++++++++ hbvm/Cargo.toml | 5 +---- 7 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 hblang/Cargo.toml create mode 100644 hblang/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index c231822..8cc8505 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,6 +200,10 @@ dependencies = [ "with_builtin_macros", ] +[[package]] +name = "hblang" +version = "0.1.0" + [[package]] name = "hbvm" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 02f5350..4c1db3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,3 @@ [workspace] resolver = "2" -members = ["hbasm", "hbbytecode", "hbvm", "hbvm_aos_on_linux", "hbxrt", "xtask"] +members = ["hbasm", "hbbytecode", "hblang", "hbvm", "hbvm_aos_on_linux", "hbxrt", "xtask"] diff --git a/hbasm/src/ins.rs b/hbasm/src/ins.rs index 590e23d..6b56a09 100644 --- a/hbasm/src/ins.rs +++ b/hbasm/src/ins.rs @@ -4,7 +4,7 @@ use { std::{cell::RefCell, rc::Rc}, }; -mod optypes { +pub mod optypes { use { crate::{ label::UnboundLabel, @@ -101,7 +101,7 @@ mod optypes { use crate::data::DataRef; } -mod rity { +pub mod rity { pub use super::optypes::{A, O, P, R}; pub type B = i64; pub type H = i64; @@ -109,7 +109,7 @@ mod rity { pub type D = i64; } -mod generic { +pub mod generic { use {crate::object::Object, rhai::EvalAltResult}; pub(super) fn convert_op(from: A) -> Result diff --git a/hbasm/src/lib.rs b/hbasm/src/lib.rs index 440de14..21c2910 100644 --- a/hbasm/src/lib.rs +++ b/hbasm/src/lib.rs @@ -1,8 +1,8 @@ -mod data; -mod ins; -mod label; -mod linker; -mod object; +pub mod data; +pub mod ins; +pub mod label; +pub mod linker; +pub mod object; use { object::Object, diff --git a/hblang/Cargo.toml b/hblang/Cargo.toml new file mode 100644 index 0000000..ea320ae --- /dev/null +++ b/hblang/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "hblang" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/hblang/src/lib.rs b/hblang/src/lib.rs new file mode 100644 index 0000000..7d12d9a --- /dev/null +++ b/hblang/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); + } +} diff --git a/hbvm/Cargo.toml b/hbvm/Cargo.toml index e8302d2..447ddf2 100644 --- a/hbvm/Cargo.toml +++ b/hbvm/Cargo.toml @@ -3,13 +3,10 @@ name = "hbvm" version = "0.1.0" edition = "2021" -[profile.release] -lto = true - [features] default = ["alloc"] alloc = [] nightly = [] [dependencies] -hbbytecode.path = "../hbbytecode" +hbbytecode = { path = "../hbbytecode" }