For now, the top-level crate just re-exports the interpreter

This commit is contained in:
Olivier 'reivilibre' 2023-03-01 21:23:03 +00:00
parent 475f9bc55e
commit c798107693
3 changed files with 11 additions and 15 deletions

2
Cargo.lock generated
View File

@ -461,7 +461,7 @@ dependencies = [
name = "hornbeam" name = "hornbeam"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"hornbeam_grammar", "hornbeam_interpreter",
] ]
[[package]] [[package]]

View File

@ -6,4 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
hornbeam_grammar = { version = "0.1.0", path = "../hornbeam_grammar" } hornbeam_interpreter = { version = "0.1.0", path = "../hornbeam_interpreter" }

View File

@ -1,14 +1,10 @@
pub fn add(left: usize, right: usize) -> usize { //! # TEMPORARY!
left + right //!
} //! This crate currently just re-exports all of `hornbeam_interpreter`.
//!
//! In the future, this crate will provide an abstraction layer over both the interpreter and
//! the compile-time template compiler, allowing to switch between them at will in a project
//! (or more likely: use the hot-reloadable interpreter in development and the high-performance
//! compiler for production).
#[cfg(test)] pub use hornbeam_interpreter::*;
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}