forked from koniifer/ableos
fixing some warnings
This commit is contained in:
parent
e335e55aa0
commit
433f2db4d1
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -200,6 +200,10 @@ dependencies = [
|
||||||
"with_builtin_macros",
|
"with_builtin_macros",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hblang"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hbvm"
|
name = "hbvm"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
members = ["hbasm", "hbbytecode", "hbvm", "hbvm_aos_on_linux", "hbxrt", "xtask"]
|
members = ["hbasm", "hbbytecode", "hblang", "hbvm", "hbvm_aos_on_linux", "hbxrt", "xtask"]
|
||||||
|
|
|
@ -4,7 +4,7 @@ use {
|
||||||
std::{cell::RefCell, rc::Rc},
|
std::{cell::RefCell, rc::Rc},
|
||||||
};
|
};
|
||||||
|
|
||||||
mod optypes {
|
pub mod optypes {
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
label::UnboundLabel,
|
label::UnboundLabel,
|
||||||
|
@ -101,7 +101,7 @@ mod optypes {
|
||||||
use crate::data::DataRef;
|
use crate::data::DataRef;
|
||||||
}
|
}
|
||||||
|
|
||||||
mod rity {
|
pub mod rity {
|
||||||
pub use super::optypes::{A, O, P, R};
|
pub use super::optypes::{A, O, P, R};
|
||||||
pub type B = i64;
|
pub type B = i64;
|
||||||
pub type H = i64;
|
pub type H = i64;
|
||||||
|
@ -109,7 +109,7 @@ mod rity {
|
||||||
pub type D = i64;
|
pub type D = i64;
|
||||||
}
|
}
|
||||||
|
|
||||||
mod generic {
|
pub mod generic {
|
||||||
use {crate::object::Object, rhai::EvalAltResult};
|
use {crate::object::Object, rhai::EvalAltResult};
|
||||||
|
|
||||||
pub(super) fn convert_op<A, B>(from: A) -> Result<B, EvalAltResult>
|
pub(super) fn convert_op<A, B>(from: A) -> Result<B, EvalAltResult>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
mod data;
|
pub mod data;
|
||||||
mod ins;
|
pub mod ins;
|
||||||
mod label;
|
pub mod label;
|
||||||
mod linker;
|
pub mod linker;
|
||||||
mod object;
|
pub mod object;
|
||||||
|
|
||||||
use {
|
use {
|
||||||
object::Object,
|
object::Object,
|
||||||
|
|
8
hblang/Cargo.toml
Normal file
8
hblang/Cargo.toml
Normal file
|
@ -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]
|
14
hblang/src/lib.rs
Normal file
14
hblang/src/lib.rs
Normal file
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,13 +3,10 @@ name = "hbvm"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[profile.release]
|
|
||||||
lto = true
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["alloc"]
|
default = ["alloc"]
|
||||||
alloc = []
|
alloc = []
|
||||||
nightly = []
|
nightly = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
hbbytecode.path = "../hbbytecode"
|
hbbytecode = { path = "../hbbytecode" }
|
||||||
|
|
Loading…
Reference in a new issue