From 689fa773807cfff119f85d624abfc5effde80928 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 4 Apr 2024 18:09:23 -0700 Subject: [PATCH] * --- examples/test.modal | 4 ++-- src/modal.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/test.modal b/examples/test.modal index 7bf0ba0..312e9f4 100644 --- a/examples/test.modal +++ b/examples/test.modal @@ -1,4 +1,4 @@ -<> (dup ?x) (?x ?x) +<> (swap ?x ?y) (?y ?x) -(dup (123)) +(swap 123 456) diff --git a/src/modal.c b/src/modal.c index 0619992..9f6600a 100644 --- a/src/modal.c +++ b/src/modal.c @@ -24,7 +24,8 @@ walk(char *s) --depth; if(!depth) break; } - if(depth < 0) break; + if(depth == 0 && c == ' ') return s - 1; + if(depth < 1 && c == ' ') { return s - 1; } } return s; } @@ -55,6 +56,7 @@ writereg(char r) if(!depth) break; } if(depth < 0) break; + if(depth == 0 && c == ' ') break; *outp_++ = c; } return 1;