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:
@ mkdir -p bin
run: all bin/modal
@ bin/modal examples/hello.modal 2> /dev/null
@ bin/modal examples/hello.modal
test: bin/modal-debug bin/modal
@ bin/modal -v
@ 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
cp bin/modal ~/bin/
uninstall:

View File

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