Fixed issue with lambdas
This commit is contained in:
parent
4bedea3880
commit
3b415e52da
|
@ -0,0 +1,8 @@
|
||||||
|
<> (foo ?x) (?x)
|
||||||
|
<> (map ?x (list ?l)) (map/l map/x ?x ?l)
|
||||||
|
<> (map/x ?x (?h ?t)) (?x ?h (map/x ?x ?t))
|
||||||
|
<> (map/x ?x (?h)) (map/r (?x ?h))
|
||||||
|
<> (?h (map/r ?t)) (?map/r (?h ?t))
|
||||||
|
<> (map/l map/r ?l) (list ?l)
|
||||||
|
|
||||||
|
map foo (list (1 (2 (3 (4 (5))))))
|
|
@ -177,6 +177,7 @@ rewrite(void)
|
||||||
if(s[0] == '?' && s[1] == '(') {
|
if(s[0] == '?' && s[1] == '(') {
|
||||||
r = λ
|
r = λ
|
||||||
s = create_rule(&lambda, -1, s) + 1;
|
s = create_rule(&lambda, -1, s) + 1;
|
||||||
|
while((c = *s) && c <= ' ') s++;
|
||||||
if((res = match_rule(&lambda, s)) != NULL)
|
if((res = match_rule(&lambda, s)) != NULL)
|
||||||
return write_rule(&lambda, last, res);
|
return write_rule(&lambda, last, res);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue