Can merge token during reg writing
This commit is contained in:
parent
9029c64c77
commit
529777fcb4
|
@ -104,7 +104,7 @@ match_rule(Rule *r, char *p)
|
|||
rmin = 0xff, rmax = 0x00;
|
||||
}
|
||||
while((c = *a)) {
|
||||
if(c == '?' && last != '\\') {
|
||||
if(c == '?' && spacer(last) && spacer(a[2])) {
|
||||
if(!set_reg(*(++a), b)) return NULL;
|
||||
a++, b = walk(b);
|
||||
continue;
|
||||
|
@ -138,7 +138,7 @@ write_rule(Rule *r, char last, char *res)
|
|||
{
|
||||
char c, *b = r->b, *origin = dst_;
|
||||
while((c = *b++))
|
||||
if(c == '?' && regs[(int)*b] && spacer(last) && spacer(b[1]))
|
||||
if(c == '?' && last != '\\' && regs[(int)*b])
|
||||
put_reg(*b++);
|
||||
else
|
||||
*dst_++ = c, last = c;
|
||||
|
|
Loading…
Reference in New Issue