about summary refs log tree commit diff
path: root/src/libexpr/nixexpr.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-05-07T12·43+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-05-07T12·43+0000
commit01e58adce0767f1a484d80fcbcf67c7945cbc146 (patch)
treee4d644b176cc3d73ccdb6dc6b1eb671721fff02b /src/libexpr/nixexpr.cc
parent83d7b89660ebb942ad844b9be260492b2ea9fb24 (diff)
* Store position info for inherited attributes.
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r--src/libexpr/nixexpr.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index af0632a94d6e..898fdb609417 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -55,8 +55,8 @@ void ExprAttrs::show(std::ostream & str)
 {
     if (recursive) str << "rec ";
     str << "{ ";
-    foreach (list<VarRef>::iterator, i, inherited)
-        str << "inherit " << i->name << "; ";
+    foreach (list<Inherited>::iterator, i, inherited)
+        str << "inherit " << i->first.name << "; ";
     foreach (Attrs::iterator, i, attrs)
         str << i->first << " = " << *i->second.first << "; ";
     str << "}";
@@ -91,8 +91,8 @@ void ExprLambda::show(std::ostream & str)
 void ExprLet::show(std::ostream & str)
 {
     str << "let ";
-    foreach (list<VarRef>::iterator, i, attrs->inherited)
-        str << "inherit " << i->name << "; ";
+    foreach (list<ExprAttrs::Inherited>::iterator, i, attrs->inherited)
+        str << "inherit " << i->first.name << "; ";
     foreach (ExprAttrs::Attrs::iterator, i, attrs->attrs)
         str << i->first << " = " << *i->second.first << "; ";
     str << "in " << *body;
@@ -215,9 +215,9 @@ void ExprAttrs::bindVars(const StaticEnv & env)
         foreach (ExprAttrs::Attrs::iterator, i, attrs)
             newEnv.vars[i->first] = displ++;
 
-        foreach (list<VarRef>::iterator, i, inherited) {
-            newEnv.vars[i->name] = displ++;
-            i->bind(env);
+        foreach (list<Inherited>::iterator, i, inherited) {
+            newEnv.vars[i->first.name] = displ++;
+            i->first.bind(env);
         }
 
         foreach (ExprAttrs::Attrs::iterator, i, attrs)
@@ -228,8 +228,8 @@ void ExprAttrs::bindVars(const StaticEnv & env)
         foreach (ExprAttrs::Attrs::iterator, i, attrs)
             i->second.first->bindVars(env);
 
-        foreach (list<VarRef>::iterator, i, inherited)
-            i->bind(env);
+        foreach (list<Inherited>::iterator, i, inherited)
+            i->first.bind(env);
     }
 }
 
@@ -267,9 +267,9 @@ void ExprLet::bindVars(const StaticEnv & env)
     foreach (ExprAttrs::Attrs::iterator, i, attrs->attrs)
         newEnv.vars[i->first] = displ++;
 
-    foreach (list<VarRef>::iterator, i, attrs->inherited) {
-        newEnv.vars[i->name] = displ++;
-        i->bind(env);
+    foreach (list<ExprAttrs::Inherited>::iterator, i, attrs->inherited) {
+        newEnv.vars[i->first.name] = displ++;
+        i->first.bind(env);
     }
 
     foreach (ExprAttrs::Attrs::iterator, i, attrs->attrs)