about summary refs log tree commit diff
path: root/src/libexpr/nixexpr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r--src/libexpr/nixexpr.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index 147f50853e9d..5957618702a2 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -48,7 +48,7 @@ void ExprSelect::show(std::ostream & str)
 
 void ExprOpHasAttr::show(std::ostream & str)
 {
-    str << "(" << *e << ") ? " << name;
+    str << "(" << *e << ") ? " << showAttrPath(attrPath);
 }
 
 void ExprAttrs::show(std::ostream & str)
@@ -140,6 +140,17 @@ std::ostream & operator << (std::ostream & str, const Pos & pos)
 }
 
 
+string showAttrPath(const AttrPath & attrPath)
+{
+    string s;
+    foreach (AttrPath::const_iterator, i, attrPath) {
+        if (!s.empty()) s += '.';
+        s += *i;
+    }
+    return s;
+}
+
+
 Pos noPos;