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.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 0296afe60155..b4156ffec101 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -272,7 +272,14 @@ void EvalState::cloneAttrs(Value & src, Value & dst)
 void EvalState::evalFile(const Path & path, Value & v)
 {
     startNest(nest, lvlTalkative, format("evaluating file `%1%'") % path);
-    Expr e = parseExprFromFile(*this, path);
+
+    Expr e = parseTrees.get(toATerm(path));
+
+    if (!e) {
+        e = parseExprFromFile(*this, path);
+        parseTrees.set(toATerm(path), e);
+    }
+    
     try {
         eval(e, v);
     } catch (Error & e) {