From 9b7328fe93cb0d69e51107f8d8eb7bbf33b0743f Mon Sep 17 00:00:00 2001 From: kitty Date: Thu, 5 Mar 2026 02:53:54 +1100 Subject: value source-id --- jefs.fs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/jefs.fs b/jefs.fs index 0aa41f1..d68c8da 100644 --- a/jefs.fs +++ b/jefs.fs @@ -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 -- cgit v1.2.3