diff options
Diffstat (limited to 'jefs.fs')
| -rw-r--r-- | jefs.fs | 20 |
1 files changed, 0 insertions, 20 deletions
@@ -281,7 +281,6 @@ init-source source-id ! \ including the console input, we can recurse input buffers \ up to four levels. (max-include-depth <=) -\ todo maybe these should be renamed 0 value include-depth 3 constant max-include-depth max-include-depth 1+ constant #buffers @@ -298,9 +297,7 @@ make buffers-fd #buffers cells allot stdin buffers-fd ! : buffer-refill ( u|0 ) cbuffer /buffer cbuffer-fd @ read-file 0<> if 0 then 0 cbuffer->in ! dup cbuffer-used ! ; \ returns zero on error or nothing read. -\ this is Borken : buffer-empty? cbuffer->in @ cbuffer-used @ >= ; -\ bug: always seems to refill : buffer-key buffer-empty? if buffer-refill 0= if -1 [ ret, ] then then cbuffer cbuffer->in @ + c@ cbuffer->in @ 1+ cbuffer->in ! ; @@ -310,18 +307,6 @@ stdin buffers-fd ! \ i dont think that's that big a deal 2048 constant line-buffer-length make line-buffer line-buffer-length allot - -\ todo move remaining stuff back before read-file, -\ update tib stuff for new data -\ what if word spans accross refills? maybe parse -\ should be rewritten here to take this into account -\ : move-back ( -- remaining ) tib @ >in @ + tib @ #tib @ >in @ - dup >r cmove -\ r> #tib ! 0 >in ! #tib @ ; \ maybe make this less shitty at sum pt -\ : (refill) ( fd -- flag ) >r file-buffer file-buffer-length r> read-file -\ 0= if ?dup 0> if ( TODO > ) drop ( < TODO ) true -\ else false then else false then ; -\ : refill ( -- flag ) source-id @ dup 0>= if (refill) else drop false then ; -\ : refill ." UNIMPLEMENTED" cr ; \ }}} : (evaluate) ( c-addr u -- ) 0 >in ! ( u ) #tib ! ( c-addr ) tib ! @@ -335,9 +320,4 @@ make line-buffer line-buffer-length allot \ }}} .free -\ input-buffer buffer-length stdin read-file drop input-buffer swap evaluate -buffer-key -buffer-key -char = emit cr -.s bye |
