Better rules lookup
This commit is contained in:
parent
f8657a5f67
commit
d03f359f4c
|
@ -196,18 +196,17 @@ find_rule(char *s, char *cap)
|
||||||
if(*s == '(') s++, cap--;
|
if(*s == '(') s++, cap--;
|
||||||
while(r < rules_) {
|
while(r < rules_) {
|
||||||
char *ss = s, *a = r->a;
|
char *ss = s, *a = r->a;
|
||||||
if(a)
|
|
||||||
while(*ss++ == *a++)
|
while(*ss++ == *a++)
|
||||||
if(!*a) return r;
|
if(!*a && ss == cap) return r;
|
||||||
r++;
|
r++;
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
echo_rule(Rule *r, char *field)
|
echo_rule(Rule *r, char *s)
|
||||||
{
|
{
|
||||||
char c, *s = field;
|
char c;
|
||||||
putc('(', stdout);
|
putc('(', stdout);
|
||||||
while((c = *s++)) {
|
while((c = *s++)) {
|
||||||
unsigned int rid;
|
unsigned int rid;
|
||||||
|
|
Loading…
Reference in New Issue