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;
|
char c, *a = r->a, *b = p;
|
||||||
while((c = *a)) {
|
while((c = *a)) {
|
||||||
|
if(c == '?') {
|
||||||
|
printf("WILDCARD: %s | %s\n", p, r->a);
|
||||||
|
}
|
||||||
if(c != *b) return 0;
|
if(c != *b) return 0;
|
||||||
a++, b++;
|
a++, b++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<> (dup ?x) (?x ?x done)
|
<> (dup ?x) (?x ?x done)
|
||||||
<> hello bye
|
<> (hello ?x) (bye ?x)
|
||||||
<> (a (b (c))) (end)
|
<> (a (b (c))) (end)
|
||||||
|
|
||||||
hello world
|
(hello world)
|
Loading…
Reference in New Issue