Moved lambda from rules[0] to its own memory
This commit is contained in:
parent
701d2c43a5
commit
f7e0e74888
12
src/modal.c
12
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;
|
||||
|
|
Loading…
Reference in New Issue