From c50c16b9dbc54ac6b764a88c35242ab386f36d8f Mon Sep 17 00:00:00 2001 From: _ <_@_> Date: Sun, 1 Oct 2023 01:36:40 -0500 Subject: [PATCH] :bug: bug: fix io.write and take off the `max_iters` restriction The math is lining up with PUC Lua and LuaJIT. Now I can actually check the speed. --- src/main.rs | 3 +-- src/state.rs | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7037b29..c6182e7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -64,11 +64,10 @@ fn main () -> Result <(), state::StepError> { vm.debug_print = true; } - let max_iters = 2000; let mut in_break = false; let mut last_input = String::new (); - for _ in 0..max_iters { + loop { if in_break || breakpoints.iter ().any (|bp| vm.at_breakpoint (bp)) { in_break = true; dbg! (&vm.stack); diff --git a/src/state.rs b/src/state.rs index 9658d66..9951f83 100644 --- a/src/state.rs +++ b/src/state.rs @@ -68,7 +68,6 @@ fn lw_io_write (l: &mut State, num_args: usize) -> usize { _ => panic! ("Can't io.write this value"), } } - println! (""); // TODO: PUC Lua actually returns the file handle here. 0 }