Change INCLUDE so that it saves and restores the tib before and after

interpret-via-tib instead of clearing it after.
This way, commands after a .fth include can be passed to v4fthfile.com,
e.g. a bye to terminate a make-controlled test run.
This commit is contained in:
Philip Zembrod 2022-01-15 23:44:11 +01:00
parent 7dafbfcc3e
commit c612a61455
2 changed files with 27 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -20,9 +20,9 @@
\ *** Block No. 1, Hexblock 1
\ load screen phz 06jan22
\ load screen phz 15jan22
1 3 +thru
1 4 +thru
@ -77,18 +77,37 @@
\ *** Block No. 4, Hexblock 4
\ interpret-via-tib include phz 06jan22
\ save/restoretib phz 15jan22
100 constant /stash
create stash[ /stash allot here constant ]stash
variable stash> stash[ stash> !
: savetib ( -- n )
#tib @ >in @ - dup stash> @ + ]stash u>
abort" tib stash overflow" >r
tib >in @ + stash> @ r@ cmove
r@ stash> +! r> ;
: restoretib ( n -- )
dup >r negate stash> +! stash> @ tib r@ cmove
r> #tib ! >in off ;
\ *** Block No. 5, Hexblock 5
\ interpret-via-tib include phz 15jan22
: interpret-via-tib
BEGIN freadline >r .status >in off interpret
r> UNTIL ;
: include ( -- )
pushfile use
pushfile use
probe-for-fb isfile@ freset IF 1 load close exit THEN
blk @ Abort" no include from blk"
interpret-via-tib close
#tib off >in off ;
savetib >r interpret-via-tib close r> restoretib ;