diff --git a/makefile b/makefile index d3a098f..eaf3ae3 100644 --- a/makefile +++ b/makefile @@ -11,7 +11,7 @@ run: all bin/modal @ bin/modal examples/hello.modal 2> /dev/null test: bin/modal-debug bin/modal @ bin/modal -v - @ bin/modal-debug examples/tests.modal 2> /dev/null + @ bin/modal-debug examples/tests.modal install: bin/modal cp bin/modal ~/bin/ uninstall: diff --git a/src/modal.c b/src/modal.c index 8b72423..11965aa 100644 --- a/src/modal.c +++ b/src/modal.c @@ -140,9 +140,13 @@ parse_frag(char *s) while((c = *s) && c <= ' ') s++; if(*s != ')' && *s != '<' && s[1] != '>') { ss = walk(s); - if(*s == '(') s++, ss--; - while(s < ss) *dict_++ = *s++; - s++; + if(*s == '('){ + s++; + while(s < ss-1) *dict_++ = *s++; + s++; + } + else + while(s < ss) *dict_++ = *s++; } *dict_++ = 0; return s;