Catching wildcards

This commit is contained in:
Devine Lu Linvega 2024-04-04 10:42:43 -07:00
parent f65e5634ff
commit 1a0dcb2a5e
2 changed files with 5 additions and 2 deletions

View File

@ -14,6 +14,9 @@ match(char *p, Rule *r)
{
char c, *a = r->a, *b = p;
while((c = *a)) {
if(c == '?') {
printf("WILDCARD: %s | %s\n", p, r->a);
}
if(c != *b) return 0;
a++, b++;
}

View File

@ -1,5 +1,5 @@
<> (dup ?x) (?x ?x done)
<> hello bye
<> (hello ?x) (bye ?x)
<> (a (b (c))) (end)
hello world
(hello world)