summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkitty <nepeta@canaglie.net>2026-03-05 01:15:00 +1100
committerkitty <nepeta@canaglie.net>2026-03-05 01:15:00 +1100
commit5b0a1bed59e817cad707d33018b8cb94b63088d7 (patch)
treee037227cfe14a1c663a65dd5070e33af0aa977e8
parenta80c682d18d1f9da15cc5e28249194efc8e6afea (diff)
fix ACCEPT
still not ideal because i think blank lines and EOF are handled the same. not sure how they should be separated.
-rw-r--r--jefs.fs4
1 files changed, 3 insertions, 1 deletions
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