about summary refs log tree commit diff
path: root/src/libexpr/nixexpr.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-04T19·14+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-04T19·14+0200
commita5fe73094016973a50741db0c5d51ca96c14147b (patch)
tree28393198f2cd307db18ec160d7139b2e77077ddd /src/libexpr/nixexpr.hh
parent27b44b8cf7072b09a1929ee44ba784b1c8d5211a (diff)
forceString: Show position info
Diffstat (limited to 'src/libexpr/nixexpr.hh')
-rw-r--r--src/libexpr/nixexpr.hh4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index 527589147e9c..9234e2970ffa 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -28,6 +28,10 @@ struct Pos
     Pos() : line(0), column(0) { };
     Pos(const Symbol & file, unsigned int line, unsigned int column)
         : file(file), line(line), column(column) { };
+    operator bool() const
+    {
+        return line != 0;
+    }
     bool operator < (const Pos & p2) const
     {
         if (!line) return p2.line;