diff options
| -rw-r--r-- | jefs.fs | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -296,10 +296,9 @@ decimal \ USER INPUT {{{ \ use cmove (not cmove>) for moving stray bytes left when refilling -variable source-id -2 constant init-source -1 constant string-source -init-source source-id ! +init-source value source-id \ including the console input, we can recurse input buffers \ up to four levels. (max-include-depth <=) @@ -340,10 +339,15 @@ 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 source-id +: refill ( -- ? ) source-id 0< if false [ ret, ] then + 0 >in ! line-buffer tib ! line-buffer line-buffer-length accept + 0= if ?dup if false [ ret, ] then then #tib ! true ; \ }}} : (evaluate) ( c-addr u -- ) 0 >in ! ( u ) #tib ! ( c-addr ) tib ! - source-id @ >r string-source source-id ! interpret r> source-id ! ; + source-id >r string-source to source-id interpret r> to source-id ; : evaluate ( c-addr u -- ) tib @ >r #tib @ >r >in @ >r (evaluate) r> >in ! r> #tib ! r> tib ! ; .free |
