diff --git a/bootstrap.fs b/bootstrap.fs index a68faa3..9703971 100644 --- a/bootstrap.fs +++ b/bootstrap.fs @@ -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 diff --git a/test/core.fs b/test/core.fs index 03adadd..8bcc5d4 100644 --- a/test/core.fs +++ b/test/core.fs @@ -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 -> }T + \ ------------------------------------------------------------------------ testing <# # #s #> hold sign base >number hex decimal