2020-10-28 18:06:58 -04:00
|
|
|
( Read one line in input buffer and make IN> point to it )
|
|
|
|
: (rdln)
|
|
|
|
( EOT or less triggers line flush )
|
|
|
|
(infl) BEGIN (rdlnc) 5 < UNTIL
|
|
|
|
LF IN( IN> ! ;
|
|
|
|
( And finally, implement C<* )
|
|
|
|
: RDLN<
|
|
|
|
IN> @ C@
|
|
|
|
DUP IF ( not EOL? good, inc and return )
|
|
|
|
1 IN> +!
|
|
|
|
ELSE ( EOL ? readline. we still return null though )
|
|
|
|
(rdln)
|
|
|
|
THEN
|
|
|
|
( update C<? flag )
|
|
|
|
IN> @ C@ 0 > 0x06 RAM+ ! ( 06 == C<? )
|
|
|
|
;
|