Catching wildcards
This commit is contained in:
parent
f65e5634ff
commit
1a0dcb2a5e
|
@ -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++;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<> (dup ?x) (?x ?x done)
|
||||
<> hello bye
|
||||
<> (hello ?x) (bye ?x)
|
||||
<> (a (b (c))) (end)
|
||||
|
||||
hello world
|
||||
(hello world)
|
Loading…
Reference in New Issue