Add sourcefilename

This commit is contained in:
Koichi Nakamura 2021-05-06 00:21:23 +09:00
parent a92ed1ac7f
commit 05f99af07d
2 changed files with 8 additions and 1 deletions

View file

@ -1907,6 +1907,10 @@ variable inputstreams
stdin_ push-inputstream
: sourcefilename ( -- c-addr )
inputstreams @ input>file @ file>name
;
\ Replacing parser functions using input stream.
variable source-buffer BUFSIZE allot
@ -2594,7 +2598,7 @@ need-defined (read)
insn:docol insn:exit insn:lit insn:litstring insn:branch insn:0branch
words id. name>string name>link
include included source >in
include included source >in sourcefilename
next-arg shift-args arg argv argc version runtime copyright
[if] [unless] [else] [then] defined? private{ }private export

View file

@ -809,6 +809,9 @@ skip T{ bl gs3 drop -> 0 }T \ blank line return zero-length string
\ T{ gs4 123 456
\ -> }T
testing sourcefilename
T{ sourcefilename s" test/core.fs" streq -> <true> }T
\ ------------------------------------------------------------------------
testing <# # #s #> hold sign base >number hex decimal