about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-02-16T09·18+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-02-16T09·18+0000
commitfbc48a469c80201f0d159a9b9f48a22ce5f36984 (patch)
tree953874db63ad16fe6a184f2ea4d8ef8425c1fb5d /src/libexpr/eval.cc
parent76c0e85929dc747288a8fe66a7bb77673cf2aa7e (diff)
* Inherited attributes in recursive attribute sets are in scope of the
  non-inherited attributes.

Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index eaa4b4ea44..335f44baac 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -100,22 +100,25 @@ static Expr substArgs(Expr body, ATermList formals, Expr arg)
 ATerm expandRec(ATerm e, ATermList rbnds, ATermList nrbnds)
 {
     ATMatcher m;
+    ATerm name;
+    Expr e2;
 
     /* Create the substitution list. */
     ATermMap subs;
     for (ATermIterator i(rbnds); i; ++i) {
-        ATerm name;
-        Expr e2;
         if (!(atMatch(m, *i) >> "Bind" >> name >> e2))
             abort(); /* can't happen */
         subs.set(name, ATmake("Select(<term>, <term>)", e, name));
     }
+    for (ATermIterator i(nrbnds); i; ++i) {
+        if (!(atMatch(m, *i) >> "Bind" >> name >> e2))
+            abort(); /* can't happen */
+        subs.set(name, e2);
+    }
 
     /* Create the non-recursive set. */
     ATermMap as;
     for (ATermIterator i(rbnds); i; ++i) {
-        ATerm name;
-        Expr e2;
         if (!(atMatch(m, *i) >> "Bind" >> name >> e2))
             abort(); /* can't happen */
         as.set(name, substitute(subs, e2));
@@ -123,8 +126,6 @@ ATerm expandRec(ATerm e, ATermList rbnds, ATermList nrbnds)
 
     /* Copy the non-recursive bindings.  !!! inefficient */
     for (ATermIterator i(nrbnds); i; ++i) {
-        ATerm name;
-        Expr e2;
         if (!(atMatch(m, *i) >> "Bind" >> name >> e2))
             abort(); /* can't happen */
         as.set(name, e2);