Move streamfile-smart include into sfileint.fth, removing the need for

include.fb in test
This commit is contained in:
Philip Zembrod 2024-11-09 12:08:25 +01:00
parent c4cf299819
commit 5877b0e3e2
2 changed files with 9 additions and 6 deletions

View File

@ -211,17 +211,13 @@ test-blk.log: \
test3.log: \
$(patsubst %, $(cpmfilesdir)/%, v4th3.com sfileint.fth \
include.fb log2file.fb core.fr) \
log2file.fb core.fr) \
$(patsubst tests/%, $(cpmfilesdir)/%, $(wildcard tests/*.fth) \
tests/empty.fb) | emu
./emulator/run-in-runcpm.sh \
"v4th3 sfileint.fth" \
"include-inner" \
"onlyforth" \
"use include.fb" \
"onlyforth dos also forth definitions" \
"\ ' read-seq alias iread-seq" \
"7 8 thru" \
"include test-blk.fth" \
"bye" \
"exit"

View File

@ -370,7 +370,14 @@ Forth definitions
: from isfile push use ;
: loadfrom ( n -- )
isfile push fromfile push use load close ;
: include 1 loadfrom ;
: include ( -- )
rec-offset push isfile push fromfile push
use cr file?
include-inner
incfile @
IF increc @ incfile @ cr+ex!
incfile @ readrec Abort" error re-reading after include"
THEN ;
: eof ( -- f ) isfile@ dup filesize @ swap record @ = ;