From 529777fcb4f24b32eecbdcf2db124bc808101fd2 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sat, 20 Apr 2024 12:06:32 -0700 Subject: [PATCH] Can merge token during reg writing --- src/modal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modal.c b/src/modal.c index 81ed6ff..77f8666 100644 --- a/src/modal.c +++ b/src/modal.c @@ -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;