mirror of
https://github.com/nineties/planckforth
synced 2024-12-25 21:58:22 +01:00
WIP
This commit is contained in:
parent
dea1536ff0
commit
d9a01a2818
1 changed files with 11 additions and 11 deletions
22
bootstrap.fs
22
bootstrap.fs
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue