1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-09-29 15:11:06 +10:00

Flush input buffer on QUIT

Prebiously, when encountering an error during a : ; definition from
input buffer, because the input buffer wasn't flushed, we would continue
interpreting and quit the whole program when encountering ;.
This commit is contained in:
Virgil Dupras 2020-05-24 09:23:19 -04:00
parent 02e6979a46
commit 5bbc256faf
3 changed files with 7 additions and 17 deletions

13
blk/353
View File

@ -1,13 +1,14 @@
: RAM+ [ RAMSTART LITN ] + ; : RAM+ [ RAMSTART LITN ] + ; : BIN+ [ BIN( @ LITN ] + ;
: BIN+ [ BIN( @ LITN ] + ;
: HERE 0x04 RAM+ ; : HERE 0x04 RAM+ ;
: CURRENT* 0x51 RAM+ ; : CURRENT* 0x51 RAM+ ; : CURRENT CURRENT* @ ;
: CURRENT CURRENT* @ ;
: H@ HERE @ ; : H@ HERE @ ;
: FIND ( w -- a f ) CURRENT @ SWAP _find ; : FIND ( w -- a f ) CURRENT @ SWAP _find ;
: IN> 0x30 RAM+ ; ( current position in INBUF )
: IN( 0x32 RAM+ @ ; ( points to INBUF )
: IN) 0x40 ( buffer size ) IN( + ; ( INBUF's end )
: (infl) 0 IN( DUP IN> ! ! ; ( flush input buffer )
: QUIT : QUIT
(resRS) (resRS) 0 0x08 RAM+ ! ( C<* override ) (infl)
0 0x08 RAM+ ! ( 08 == C<* override )
LIT< (main) FIND DROP EXECUTE LIT< (main) FIND DROP EXECUTE
; ;
1 25 LOADR+ ( xcomp core low ) 1 25 LOADR+ ( xcomp core low )

11
blk/386
View File

@ -1,11 +0,0 @@
( current position in INBUF )
: IN> 0x30 RAM+ ;
( points to INBUF )
: IN( 0x32 RAM+ @ ;
( points to INBUF's end )
: IN) 0x40 ( buffer size ) IN( + ;
( flush input buffer )
( set IN> to IN( and set IN> @ to null )
: (infl) 0 IN( DUP IN> ! ! ;

Binary file not shown.