Fixed matching error
This commit is contained in:
parent
1b8745c853
commit
84531bcfc3
|
@ -1,4 +1,5 @@
|
||||||
<> (?x (?y ?z) extract) (?y ?z extract)
|
<> (?x dup) (?x ?x)
|
||||||
<> (?x ?y extract) (?y extract)
|
<> (?x ?y swap) (?y ?x)
|
||||||
|
<> ( ?x pop) ()
|
||||||
|
|
||||||
(cow (owl (bat (cat (dog)))) extract)
|
(1 2 3) (4 5 6) swap pop dup
|
||||||
|
|
|
@ -67,10 +67,10 @@ match(char *p, Rule *r)
|
||||||
call(b);
|
call(b);
|
||||||
else
|
else
|
||||||
regs[id] = b;
|
regs[id] = b;
|
||||||
a++, b = walk(b), c = *b;
|
a++, b = walk(b);
|
||||||
}
|
}
|
||||||
if(!*a && spacer(*b)) return b;
|
if(!*a && spacer(*b)) return b;
|
||||||
if(c != *b) return NULL;
|
if(*a != *b) return NULL;
|
||||||
a++, b++;
|
a++, b++;
|
||||||
}
|
}
|
||||||
return spacer(*b) ? b : NULL;
|
return spacer(*b) ? b : NULL;
|
||||||
|
|
Loading…
Reference in New Issue