summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorBrian Cully <bjc@spork.org>2025-08-23 13:27:50 -0400
committerBrian Cully <bjc@spork.org>2025-08-23 13:27:50 -0400
commit39042a3476ffbdc79d1e49a69cb5103628eb7265 (patch)
tree2015faa21c5769640f815564c1021310eec4a378 /src/lib.rs
parent0753ea2b9e10b0f5030b05e84cd8490cc9ec7b34 (diff)
downloadautomathon-39042a3476ffbdc79d1e49a69cb5103628eb7265.tar.gz
automathon-39042a3476ffbdc79d1e49a69cb5103628eb7265.zip
render call and data stacks
Diffstat (limited to 'src/lib.rs')
-rwxr-xr-xsrc/lib.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 840a86c..f3c9a89 100755
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -119,11 +119,19 @@ impl ExportedInterp {
}
pub fn ip(&self) -> ExportedInstructionPointer {
- let Some(interp) = self.i.as_ref() else {
+ let Some(interp) = &self.i else {
return ExportedInstructionPointer { word: 0, offset: 0 }
};
(&interp.ip).into()
}
+
+ pub fn reset_ip(&mut self) {
+ let Some(interp) = &mut self.i else {
+ return;
+ };
+ interp.ip.word = 0;
+ interp.ip.offset = 0;
+ }
}
#[wasm_bindgen]