summaryrefslogtreecommitdiffstats
path: root/src/forth/interp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/forth/interp.rs')
-rw-r--r--src/forth/interp.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/forth/interp.rs b/src/forth/interp.rs
index e41f0d9..512c022 100644
--- a/src/forth/interp.rs
+++ b/src/forth/interp.rs
@@ -216,9 +216,10 @@ impl Interp {
Ok(self.ip.offset < self.wordlist.0[self.ip.word].len())
}
- pub fn run(&mut self) -> Result<(), RuntimeError> {
- while self.tick()? {}
- Ok(())
+ pub fn run(&mut self) -> Result<usize, RuntimeError> {
+ let mut count = 0;
+ while self.tick()? { count += 1 }
+ Ok(count)
}
}