diff --git a/src/modal.c b/src/modal.c index 1355f39..a9596e7 100644 --- a/src/modal.c +++ b/src/modal.c @@ -133,20 +133,22 @@ commit_rule(Rule *r, char *s, int create) static char * parse_rule_frag(char *s) { - char *ss = walk(s), *d = dict_; + char *ss = walk(s); if(*s == '(') s++, ss--; while((s < ss)) *dict_++ = *s++; *dict_++ = 0; - return d; + return s; } static char * parse_rule(Rule *r, char *s){ char c; while((c = *s) && c <= ' ') s++; - r->a = parse_rule_frag(s), s = walk(s); + r->a = dict_; + s = parse_rule_frag(s), s++; while((c = *s) && c <= ' ') s++; - r->b = parse_rule_frag(s), s = walk(s); + r->b = dict_; + s = parse_rule_frag(s), s++; return s; }