summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
af30751)
* fth/system.fth (INCLUDED): Rewrite existing $INCLUDE to use addr+len strings.
($INCLUDE): Call INCLUDED.
(INCLUDE.MARK.START): Also take addr+len string as argument.
\ -------------- INCLUDE ------------------------------------------
variable TRACE-INCLUDE
\ -------------- INCLUDE ------------------------------------------
variable TRACE-INCLUDE
-: INCLUDE.MARK.START ( $filename -- , mark start of include for FILE?)
+: INCLUDE.MARK.START ( c-addr u -- , mark start of include for FILE?)
-: $INCLUDE ( $filename -- )
-\ Print messages.
+: INCLUDED ( c-addr u -- )
+ \ Print messages.
- >newline ." Include " dup count type cr
+ >newline ." Include " 2dup type cr
- dup
- count r/o open-file
- IF ( -- $filename bad-fid )
- drop ." Could not find file " $type cr abort
- ELSE ( -- $filename good-fid )
- swap include.mark.start
+ 2dup r/o open-file
+ IF ( -- c-addr u bad-fid )
+ drop ." Could not find file " type cr abort
+ ELSE ( -- c-addr u good-fid )
+ -rot include.mark.start
depth >r
include-file \ will also close the file
depth 1+ r> -
depth >r
include-file \ will also close the file
depth 1+ r> -
+: $INCLUDE ( $filename -- ) count included ;
+
create INCLUDE-SAVE-NAME 128 allot
: INCLUDE ( <fname> -- )
BL lword
create INCLUDE-SAVE-NAME 128 allot
: INCLUDE ( <fname> -- )
BL lword