Can merge token during reg writing

This commit is contained in:
Devine Lu Linvega 2024-04-20 12:06:32 -07:00
parent 9029c64c77
commit 529777fcb4
1 changed files with 2 additions and 2 deletions

View File

@ -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;