hm-asm-web should not panic if it receives invalid asm code

This commit is contained in:
Henrik Böving
2021-03-05 19:59:16 +01:00
parent 3b49e98d97
commit f2a0966b17
3 changed files with 21 additions and 9 deletions

View File

@@ -5,6 +5,9 @@ two functions to javascript.
- `simulate(code: &str, cycles: usize)`, its return value is equivalent to the one of `hm_asm_simulator::simulate::simulate`
- `assemble(code: &str)`, its return vlaue is equivalent to the one of `hm_asm_simulator::generate::generate_binary`
If either of the functions should fail they will return their Rust error as a String. In the case of a grammar based
error, this would be a nice pest.rs error.
## Demo
In `demo/` You'll find a demo app that compiles and simulates a simple program inside of the console.
You can test it with