Inlined addrule
This commit is contained in:
parent
8a94adc1c3
commit
e6e2188797
|
@ -1,3 +1,4 @@
|
|||
<> ((eval ?x)) (?x)
|
||||
|
||||
(eval (<> (join (?x) (?y)) (?x ?y))) (join (foo) (bar))
|
||||
(eval (<> (join (?x) (?y)) (?x ?y)))
|
||||
(join (foo) (bar))
|
||||
|
|
15
src/modal.c
15
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);
|
||||
|
|
Loading…
Reference in New Issue