Housekeeping

This commit is contained in:
Devine Lu Linvega 2024-04-11 10:52:13 -07:00
parent a890215143
commit 4bedea3880
2 changed files with 8 additions and 7 deletions

View File

@ -8,11 +8,11 @@ all: dest
dest: 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
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))"
@ time bin/modal examples/test.modal "(arg1) (arg2 (arg3))" @ time bin/modal examples/test.modal 2> /dev/null
install: bin/modal install: bin/modal
cp bin/modal ~/bin/ cp bin/modal ~/bin/
uninstall: uninstall:

View File

@ -35,13 +35,14 @@ plode(char *s)
{ {
int i, depth = 0; int i, depth = 0;
char c, *ss; char c, *ss;
if(s[0] == '(') { /* implode */ /* implode */
if(s[0] == '(') {
ss = walk(s); ss = walk(s);
while(s < ss) { while(s < ss && (c = *(s++)))
c = *(s++);
if(!spacer(c)) *outp_++ = c; if(!spacer(c)) *outp_++ = c;
} }
} else { /* explode */ /* explode */
else {
while((c = *s++) && !spacer(c)) while((c = *s++) && !spacer(c))
*outp_++ = c, *outp_++ = ' ', *outp_++ = '(', depth++; *outp_++ = c, *outp_++ = ' ', *outp_++ = '(', depth++;
for(i = 0; i < depth; i++) for(i = 0; i < depth; i++)