diff --git a/src/modal.c b/src/modal.c index 32836bd..83499a2 100644 --- a/src/modal.c +++ b/src/modal.c @@ -6,7 +6,7 @@ typedef struct { } Rule; static int flip, quiet, rmin = 0xff, rmax = 0x00, cycles = 0x10000; -static Rule rules[0x1000], *rules_ = rules + 1; +static Rule rules[0x1000], *rules_ = rules, lambda; static char dict[0x8000], *dict_ = dict; static char bank_a[0x4000], *src_ = bank_a; static char bank_b[0x4000], *dst_ = bank_b; @@ -179,14 +179,14 @@ rewrite(void) } if(c == '?' && s[1] == '(') { /* lambda */ cap = walk(s + 1); - r = &rules[0], r->id = -1; - r->a = dict_, s = parse_frag(s + 2); - r->b = dict_, parse_frag(s), s = cap; + lambda.id = -1; + lambda.a = dict_, s = parse_frag(s + 2); + lambda.b = dict_, parse_frag(s), s = cap; while(*s == ' ') s++; - return run_rule(r, s); + return run_rule(&lambda, s); } - for(r = rules + 1; r < rules_; r++) + for(r = rules; r < rules_; r++) if(run_rule(r, s)) return 1; } *dst_++ = last = c;