forked from lix-project/lix
* Filter the substitution list when descending into a recursive
attribute set.
This commit is contained in:
parent
449411e511
commit
a2a9bacd82
1 changed files with 14 additions and 1 deletions
|
@ -97,7 +97,20 @@ ATerm substitute(Subs & subs, ATerm e)
|
|||
substitute(subs2, body));
|
||||
}
|
||||
|
||||
/* !!! Rec(...) */
|
||||
/* Idem for a mutually recursive attribute set. */
|
||||
ATermList bindings;
|
||||
if (ATmatch(e, "Rec([<list>])", &bindings)) {
|
||||
Subs subs2(subs);
|
||||
ATermList bnds = bindings;
|
||||
while (!ATisEmpty(bnds)) {
|
||||
Expr e;
|
||||
if (!ATmatch(ATgetFirst(bnds), "Bind(<str>, <term>)", &s, &e))
|
||||
abort(); /* can't happen */
|
||||
subs2.erase(s);
|
||||
bnds = ATgetNext(bnds);
|
||||
}
|
||||
return ATmake("Rec(<term>)", substitute(subs2, (ATerm) bindings));
|
||||
}
|
||||
|
||||
if (ATgetType(e) == AT_APPL) {
|
||||
AFun fun = ATgetAFun(e);
|
||||
|
|
Loading…
Reference in a new issue