mirror of
https://github.com/nineties/planckforth
synced 2024-12-27 21:58:35 +01:00
Add inner interpret loop
This commit is contained in:
parent
fbe4a77dc4
commit
ce31b9160e
1 changed files with 35 additions and 30 deletions
13
bootstrap.fs
13
bootstrap.fs
|
@ -1836,6 +1836,10 @@ stdin_ push-inputstream
|
||||||
: interpret
|
: interpret
|
||||||
word \ read name from input
|
word \ read name from input
|
||||||
|
|
||||||
|
: interpret-inner
|
||||||
|
begin
|
||||||
|
word \ read name from input
|
||||||
|
|
||||||
\ EOF at this point is not an error
|
\ EOF at this point is not an error
|
||||||
UNEXPECTED-EOF-ERROR = if QUIT throw then
|
UNEXPECTED-EOF-ERROR = if QUIT throw then
|
||||||
|
|
||||||
|
@ -1867,11 +1871,12 @@ stdin_ push-inputstream
|
||||||
[compile] literal
|
[compile] literal
|
||||||
then
|
then
|
||||||
then
|
then
|
||||||
|
again
|
||||||
;
|
;
|
||||||
|
|
||||||
: interpret-loop
|
: interpret-outer
|
||||||
begin
|
begin
|
||||||
['] interpret catch
|
['] interpret-inner catch
|
||||||
?dup if
|
?dup if
|
||||||
\ lookup error code
|
\ lookup error code
|
||||||
dup QUIT = if throw then
|
dup QUIT = if throw then
|
||||||
|
@ -1902,7 +1907,7 @@ stdin_ push-inputstream
|
||||||
:noname
|
:noname
|
||||||
rp0 rp! \ drop 3rd stage
|
rp0 rp! \ drop 3rd stage
|
||||||
|
|
||||||
['] interpret-loop catch bye
|
['] interpret-outer catch bye
|
||||||
; execute
|
; execute
|
||||||
|
|
||||||
( === [if]..[else]..[then] === )
|
( === [if]..[else]..[then] === )
|
||||||
|
@ -2293,7 +2298,7 @@ need-defined (read)
|
||||||
: included ( c-addr -- )
|
: included ( c-addr -- )
|
||||||
R/O open-file throw
|
R/O open-file throw
|
||||||
push-inputstream
|
push-inputstream
|
||||||
['] interpret-loop catch drop
|
['] interpret-outer catch drop
|
||||||
pop-inputstream close-file throw
|
pop-inputstream close-file throw
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue