diff --git a/src/modal.c b/src/modal.c index c18da75..bdb77be 100644 --- a/src/modal.c +++ b/src/modal.c @@ -223,16 +223,16 @@ apply_rule(Rule *r, char *s) static char * parse_frag(char **side, char *s) { - int wrapped; char c, *cap; while((c = *s) && c == ' ') s++; - if(c == ')' || (c == '<' && s[1] == '>')) { + if(c == ')' || (c == '<' || c == '>')) *side = ∅ - return s; + else { + int wrapped; + *side = dict_, cap = walk(s), wrapped = c == '('; + if(wrapped) s++, cap--; + dict_ = copy(s, dict_, cap - s), s = cap + wrapped, *dict_++ = 0; } - *side = dict_, cap = walk(s), wrapped = c == '('; - if(wrapped) s++, cap--; - dict_ = copy(s, dict_, cap - s), s = cap + wrapped, *dict_++ = 0; return s; }