diff --git a/Cargo.lock b/Cargo.lock index c2318229..8cc8505a 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 02f53508..4c1db3e3 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 590e23dd..6b56a092 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 440de14a..21c29108 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 00000000..ea320ae3 --- /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 00000000..7d12d9af --- /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 e8302d24..447ddf25 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" }