First version of vf-file1.fth that fully works, still with debug code

This commit is contained in:
Philip Zembrod
2024-11-09 06:15:25 +01:00
parent 2cb921222a
commit 2e780eed5d
2 changed files with 12 additions and 11 deletions

View File

@@ -219,7 +219,8 @@ test3.log: \
"1 load onlyforth" \
"use include.fb" \
"onlyforth dos also forth definitions" \
"1 1 thru" \
"\ ' read-seq alias iread-seq" \
"7 8 thru" \
"include test-blk.fth" \
"bye" \
"exit"

View File

@@ -23,9 +23,8 @@
variable incfile
variable increc
variable rec-offset
$80 constant dmabuf | $ff constant dmabuf-last
.( line 27 )
$80 constant dmabuf
$ff constant dmabuf-last
: readrec ( fcb -- f )
dup cr+ex@ increc !
@@ -45,12 +44,10 @@
." extra chars ignored" cr
BEGIN inc-fgetc eolf? 1+ UNTIL tibeof @ ;
| : probe-for-fb ( -- flag )
: probe-for-fb ( -- flag )
dmabuf BEGIN dup c@ #lf = IF drop 0 exit THEN
1+ dup dmabuf-last u> UNTIL drop 1 ;
.( line 50 )
$50 constant /stash
create stash[ /stash allot here constant ]stash
variable stash> stash[ stash> !
@@ -71,8 +68,11 @@
: include-inner ( -- )
increc push 0 isfile@ cr+ex!
isfile@ readrec Abort" can't read start of file"
probe-for-fb IF ." regular load " 1 load exit THEN
." stream include "
probe-for-fb IF 1 load exit THEN
\ ." stream include "
incfile push isfile@ incfile !
savetib >r interpret-via-tib isfile@ closefile r> restoretib ;
savetib >r interpret-via-tib
\ ." before isfile@ closefile"
\ isfile@ closefile
\ ." after isfile@ closefile"
r> restoretib ;