about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index b3fc6791a2ae..7fb38c0fd79c 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -142,6 +142,9 @@ EvalState::EvalState()
     , sOutputs(symbols.create("outputs"))
     , sOutputName(symbols.create("outputName"))
     , sIgnoreNulls(symbols.create("__ignoreNulls"))
+    , sFile(symbols.create("file"))
+    , sLine(symbols.create("line"))
+    , sColumn(symbols.create("column"))
     , repair(false)
     , baseEnv(allocEnv(128))
     , staticBaseEnv(false, 0)
@@ -1039,6 +1042,16 @@ void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v)
 }
 
 
+void ExprPos::eval(EvalState & state, Env & env, Value & v)
+{
+    state.mkAttrs(v, 3);
+    mkString(*state.allocAttr(v, state.sFile), pos.file);
+    mkInt(*state.allocAttr(v, state.sLine), pos.line);
+    mkInt(*state.allocAttr(v, state.sColumn), pos.column);
+    v.attrs->sort();
+}
+
+
 void EvalState::strictForceValue(Value & v)
 {
     forceValue(v);