about summary refs log tree commit diff
path: root/src/libexpr/nixexpr.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/nixexpr.hh')
-rw-r--r--src/libexpr/nixexpr.hh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index 2d328d382c8d..36cb4e53cd7c 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -23,8 +23,13 @@ struct Pos
 {
     string file;
     unsigned int line, column;
+    Pos() : line(0), column(0) { };
+    Pos(const string & file, unsigned int line, unsigned int column)
+        : file(file), line(line), column(column) { };
 };
 
+extern Pos noPos;
+
 std::ostream & operator << (std::ostream & str, const Pos & pos);
 
 
@@ -125,10 +130,11 @@ struct ExprOpHasAttr : Expr
 struct ExprAttrs : Expr
 {
     bool recursive;
-    typedef std::map<Symbol, Expr *> Attrs;
+    typedef std::pair<Expr *, Pos> Attr;
+    typedef std::map<Symbol, Attr> Attrs;
     Attrs attrs;
     list<VarRef> inherited;
-    set<Symbol> attrNames; // used during parsing
+    std::map<Symbol, Pos> attrNames; // used during parsing
     ExprAttrs() : recursive(false) { };
     COMMON_METHODS
 };