From 5b0a1bed59e817cad707d33018b8cb94b63088d7 Mon Sep 17 00:00:00 2001 From: kitty Date: Thu, 5 Mar 2026 01:15:00 +1100 Subject: fix ACCEPT still not ideal because i think blank lines and EOF are handled the same. not sure how they should be separated. --- jefs.fs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jefs.fs b/jefs.fs index 1d6d83b..4418c17 100644 --- a/jefs.fs +++ b/jefs.fs @@ -290,6 +290,7 @@ make buffers-used #buffers cells allot make buffers->in #buffers cells allot make buffers-fd #buffers cells allot +\ todo separate handling of blank lines and EOF : cbuffer include-depth /buffer * buffers + ; : cbuffer-used include-depth cells buffers-used + ; : cbuffer->in include-depth cells buffers->in + ; @@ -306,7 +307,7 @@ stdin buffers-fd ! 0 value (accept-a) : accept ( a n -- n ) to (accept-n) to (accept-a) 0 begin dup (accept-n) < while buffer-key dup - 0>= if ( n c -- ) over (accept-a) + c! 1+ + 0>= if ( n c -- ) dup 10 = if drop dup to (accept-n) else over (accept-a) + c! 1+ then else drop to (accept-n) then repeat ; \ i think i'll just take the wonkiness of @@ -321,4 +322,5 @@ make line-buffer line-buffer-length allot : evaluate ( c-addr u -- ) tib @ >r #tib @ >r >in @ >r (evaluate) r> >in ! r> #tib ! r> tib ! ; .free +line-buffer line-buffer-length accept .s bye -- cgit v1.2.3