mirror of
https://github.com/forth-ev/VolksForth.git
synced 2025-08-05 19:25:41 +00:00
First version of vf-file1.fth that fully works, still with debug code
This commit is contained in:
@@ -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"
|
||||
|
@@ -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 ;
|
||||
|
Reference in New Issue
Block a user