Catch symbol cap

This commit is contained in:
Devine Lu Linvega 2024-04-06 09:14:01 -07:00
parent bb72d27e2d
commit 544eddef36
2 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
<> ([b]) ()
<> (b) ([b])
<> ([c]) ()
<> (c) ([c])
(abc)

View File

@ -11,7 +11,7 @@ static char bank_a[0x1000], *prog_ = bank_a;
static char bank_b[0x1000], *outp_ = bank_b;
static char *regs[0x100];
#define spacer(c) (c == ' ' || c == '(' || c == ')')
#define spacer(c) (c == ' ' || c == '(' || c == ')' || c == 0)
static char *parse_rulefrag(char *line);
@ -59,7 +59,7 @@ match(char *p, Rule *r)
regs[id] = b;
a++, b = walk(b), c = *b;
}
if(!a[0] && spacer(*(b + 1))) return b;
if(!*a && spacer(*b)) return b;
if(c != *b) return NULL;
a++, b++;
}