Moved NovaForth into a crate with a build script

This commit is contained in:
2024-08-11 21:19:43 -05:00
parent bd54ae1ef0
commit 98c95b55f4
23 changed files with 2209 additions and 19 deletions
+1 -1
View File
@@ -21,4 +21,4 @@ pub fn source_map(snippet: String) -> JsValue {
#[wasm_bindgen]
pub fn compile_forge(src: String) -> Result<String, String> {
build_boot(src.as_str(), true).map(|s| s.join("\n")).map_err(|e| format!("{}", e))
}
}
+4 -4
View File
@@ -1,3 +1,4 @@
use novaforth::{PRELUDE, ROM, SYMBOLS};
use wasm_bindgen::prelude::wasm_bindgen;
#[wasm_bindgen]
@@ -6,11 +7,10 @@ pub struct NovaForth;
#[wasm_bindgen]
impl NovaForth {
pub fn rom() -> Vec<u8> {
Vec::from(*include_bytes!("../4th/4th.rom"))
Vec::from(ROM)
}
pub fn symbols() -> String {
include_str!("../4th/4th.rom.sym").into()
String::from(SYMBOLS)
}
pub fn prelude() -> String { include_str!("../4th/prelude.f").into() }
pub fn prelude() -> String { String::from(PRELUDE) }
}