When an evaluate string is split across a newline, the current string position is assumed to be the top-most item on the stack. However in the case of yaboot, items are left on the stack to be used by a subsequent line within the same evaluate statement and so subsequent lines are parsed incorrectly.
Fix this by saving the current string position on the r-stack across calls to (evaluate) so the stack remains correct for subsequent lines.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- forth/bootstrap/interpreter.fs | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/forth/bootstrap/interpreter.fs b/forth/bootstrap/interpreter.fs index 5187058..b66e95e 100644 --- a/forth/bootstrap/interpreter.fs +++ b/forth/bootstrap/interpreter.fs @@ -165,7 +165,9 @@ defer outer-interpreter over + over do i c@ 0a = if i over - + rot >r (evaluate) + r> i 1+ then loop