File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,7 +31,5 @@ local result = asm:parse(tokenizer)
3131-- 5. Execution
3232local interpreter = LuASM :interpreter (result )
3333
34- interpreter :next_instruction ()
35- interpreter :next_instruction ()
36- interpreter :next_instruction ()
34+ while interpreter :next_instruction () do end
3735
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ local Tokenizer = {}
105105--- Abstract method that must be overridden by a concrete tokenizer.
106106function Tokenizer .get_next_line ()
107107 error (" This function has to be implemented!" )
108- return nil
108+ return false
109109end
110110
111111--- Creates a new tokenizer without a specific implementation.
@@ -442,7 +442,7 @@ function interpreter:next_instruction()
442442 :: start::
443443
444444 if self .data .parsed_lines < self .ip then
445- return nil
445+ return false
446446 end
447447
448448 local line = self .data .instructions [self .ip ]
@@ -451,7 +451,9 @@ function interpreter:next_instruction()
451451 goto start
452452 end
453453
454- line :run (self )
454+ local result = line :run (self )
455+
456+ return result == nil or result
455457end
456458
457459--- Creates a new interpreter instance.
You can’t perform that action at this time.
0 commit comments