Moved NovaForth into a crate with a build script
This commit is contained in:
+1
-1
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user