summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkitty <nepeta@canaglie.net>2026-03-05 02:53:54 +1100
committerkitty <nepeta@canaglie.net>2026-03-05 02:53:54 +1100
commit9b7328fe93cb0d69e51107f8d8eb7bbf33b0743f (patch)
tree35d8d5a21f62fced0c29d645e521b765169a4023
parent91c0eeda4d0a20ccfc5201c1d7ec161b91caea2e (diff)
value source-id
-rw-r--r--jefs.fs10
1 files 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