Started new stdin UX

This commit is contained in:
Devine Lu Linvega 2024-04-09 10:29:33 -07:00
parent eee55d5c6d
commit 452b5026be
3 changed files with 6 additions and 3 deletions

View File

@ -11,6 +11,6 @@
<> (?x dup) (?x ?x) <> (?x dup) (?x ?x)
<> (?x ?y swap) (?y ?x) <> (?x ?y swap) (?y ?x)
<> (?x pop) () <> (?x pop) ()
<> (print ?:) (?:) <> (print ?:) ()
(implode reverse (explode hello)) (explode hello) empty-register (eq abc abc) (eq abc def) (1 2 3) (4 5 6) swap pop dup (hey 1234 pop) (print Done.) (implode reverse (explode hello)) (explode hello) empty-register (eq abc abc) (eq abc def) (1 2 3) (4 5 6) swap pop dup (hey 1234 pop) (print Done.)

View File

@ -9,7 +9,6 @@ dest:
@ mkdir -p bin @ mkdir -p bin
run: all bin/modal run: all bin/modal
@ bin/modal examples/hello.modal 2> /dev/null @ bin/modal examples/hello.modal 2> /dev/null
@ bin/modal examples/test.modal
test: bin/modal-debug bin/modal test: bin/modal-debug bin/modal
@ bin/modal -v @ bin/modal -v
@ bin/modal-debug examples/test.modal "(arg1) (arg2 (arg3))" @ bin/modal-debug examples/test.modal "(arg1) (arg2 (arg3))"

View File

@ -73,7 +73,11 @@ put_reg(char r)
char *s = regs[(int)r]; char *s = regs[(int)r];
if(r == '*') if(r == '*')
s = plode(s); s = plode(s);
else if(s) { else if(r == '~') {
char buf;
while(fread(&buf, 1, 1, stdin) && buf >= ' ')
*outp_++ = buf;
} else if(s) {
char *ss = walk(s); char *ss = walk(s);
if(r == ':') { if(r == ':') {
if(*s == '(') s++, --ss; if(*s == '(') s++, --ss;