This commit is contained in:
Koichi Nakamura 2021-01-10 12:27:00 +09:00
parent dea1536ff0
commit d9a01a2818

View file

@ -1770,8 +1770,17 @@ variable inputstreams
stdin_ push-inputstream
\ Rewrite existing functions that reads inputs using inputstream.
\ Replacing parser functions using input stream.
\ Throw UNEXPECTED-EOF-ERROR at EOF
:noname ( -- c )
key dup EOF = if drop UNEXPECTED-EOF-ERROR throw then
; &key! !
\ New version of single line comment
: \ begin key! '\n' = until ; immediate
\ New version of 'key'.
:noname ( -- c )
inputstreams @ input>file @ key-file dup '\n' = if
\ increment line count
@ -1779,13 +1788,6 @@ stdin_ push-inputstream
then
; &key !
\ Throw UNEXPECTED-EOF-ERROR
:noname ( -- c )
key dup EOF = if drop UNEXPECTED-EOF-ERROR throw then
; &key! !
: \ begin key! '\n' = until ; immediate
\ Read a word from input stream, return address of the string
\ and error-code.
:noname ( -- c-addr e )
@ -1831,13 +1833,11 @@ stdin_ push-inputstream
]
;
( === 4th Stage Interpreter === )
-56 s" Bye" def-error QUIT
: interpret
word \ read name from input
: interpret-inner
begin
word \ read name from input