Files
kolibrios/programs/develop/SPForth/src/compiler/spf_read_source.f
Kirill Lipatov (Leency) 09488af869 KolSPForth12 uploaded to SVN
git-svn-id: svn://kolibrios.org@4867 a494cfbc-eb01-0410-851d-a64ba20cac60
2014-04-21 19:22:58 +00:00

34 lines
749 B
Forth
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
( —⥭¨¥ áâப¨ ¨á室­®£® ⥪áâ  ¨§ ¢å®¤­®£® ¯®â®ª : ª®­á®«¨ ¨«¨ ä ©« .
Copyright [C] 1992-1999 A.Cherezov ac@forth.org
<EFBFBD>¥¢¨§¨ï: ‘¥­âï¡àì 1999
)
VECT <PRE>
: CONSOLE-HANDLES \ $$$$
;
: QUERY ( --- )
\ Read a line from the terminal into the terminal input buffer.
TIB 80 ACCEPT #TIB ! 0 >IN ! ;
: FREFILL ( h -- flag )
TIB C/L ROT READ-LINE THROW \ TAKEN-TIB
SWAP #TIB ! 0 >IN ! CURSTR 1+!
0 SOURCE + C!
;
: REFILL ( --- f)
\ Refill the current input source when it is exhausted. f is
\ true if it was successfully refilled.
SOURCE-ID -1 = IF
0 \ Not refillable for EVALUATE
ELSE SOURCE-ID
IF SOURCE-ID FREFILL
ELSE QUERY -1 \ Always successful from terminal.
THEN
THEN
;