There was an error while loading. Please reload this page.
1 parent d4ecc81 commit 71e364bCopy full SHA for 71e364b
1 file changed
src/wasm/api.rs
@@ -6,24 +6,8 @@ use crate::{
6
domain::Text,
7
lexer::{Lexer, Token},
8
wasm::repr::WasmCodeObject,
9
- Engine, MemphisContext,
10
};
11
12
-#[wasm_bindgen]
13
-pub fn greet() -> String {
14
- "Hello from WebAssembly!".to_string()
15
-}
16
-
17
18
-pub fn evaluate(code: String) -> String {
19
- // Set the panic hook for better error messages in the browser console
20
- set_once();
21
22
- let mut context = MemphisContext::stdin(Engine::Treewalk);
23
- let result = context.eval(Text::new(&code)).expect("Failed to evaluate.");
24
- result.to_string()
25
26
27
#[wasm_bindgen]
28
pub fn compile(text: String) -> Result<JsValue, JsValue> {
29
set_once();
0 commit comments