about summary refs log tree commit diff
path: root/src/libexpr/nixexpr.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-08-27T15·09-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-08-27T15·09-0400
commite94806d03098f1d6e654542500bbea1eaa0ec60b (patch)
tree4e967f3d39a984d86bb93849d76cab92512a07ce /src/libexpr/nixexpr.hh
parent9c2decaa1935ae4bf99a9b723d4eab188f8f88ef (diff)
parenta9e6752bbd888ab8fbc1cda6e4d539b2858c4cef (diff)
Merge branch 'master' into no-manifests
Diffstat (limited to 'src/libexpr/nixexpr.hh')
-rw-r--r--src/libexpr/nixexpr.hh9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index 4c1a0bb2d5fb..bc6c3287c79d 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -27,6 +27,15 @@ struct Pos
     Pos() : line(0), column(0) { };
     Pos(const string & file, unsigned int line, unsigned int column)
         : file(file), line(line), column(column) { };
+    bool operator < (const Pos & p2) const
+    {
+        int d = file.compare(p2.file);
+        if (d < 0) return true;
+        if (d > 0) return false;
+        if (line < p2.line) return true;
+        if (line > p2.line) return false;
+        return column < p2.column;
+    }
 };
 
 extern Pos noPos;