diff --git a/examples/test.modal b/examples/test.modal index aefdb2d..98d9edb 100644 --- a/examples/test.modal +++ b/examples/test.modal @@ -1,3 +1,4 @@ <> ((eval ?x)) (?x) -(eval (<> (join (?x) (?y)) (?x ?y))) (join (foo) (bar)) \ No newline at end of file +(eval (<> (join (?x) (?y)) (?x ?y))) +(join (foo) (bar)) diff --git a/src/modal.c b/src/modal.c index 9840135..73b8396 100644 --- a/src/modal.c +++ b/src/modal.c @@ -137,16 +137,6 @@ parse_rulefrag(char *line) return res; } -static char * -addrule(char *s) -{ - Rule *r = &rules[rules_len++]; - s += 3; - r->a = parse_rulefrag(s), s = walk(s) + 1; - r->b = parse_rulefrag(s), s = walk(s); - return s; -} - static int rewrite(char *incoming) { @@ -154,7 +144,10 @@ rewrite(char *incoming) while((c = *p)) { int i; if(p[0] == '<' && p[1] == '>') { - p = addrule(p); + Rule *r = &rules[rules_len++]; + p += 3; + r->a = parse_rulefrag(p), p = walk(p) + 1; + r->b = parse_rulefrag(p), p = walk(p); while((*outp_++ = *p++)) ; save(-1);