From 54945a2950174ded83d58336061b4a9990cdbbfd Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 6 Aug 2011 13:02:55 +0000 Subject: * Refactoring: move parseExprFromFile() and parseExprFromString() into the EvalState class. --- src/libexpr/eval.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/libexpr/eval.cc') diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index acf5d7a8aed9..5701452f94f1 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -1,5 +1,4 @@ #include "eval.hh" -#include "parser.hh" #include "hash.hh" #include "util.hh" #include "store-api.hh" @@ -427,14 +426,10 @@ void EvalState::evalFile(const Path & path, Value & v) { startNest(nest, lvlTalkative, format("evaluating file `%1%'") % path); - Expr * e = parseTrees[path]; - - if (!e) { - e = parseExprFromFile(*this, path); - parseTrees[path] = e; - } + Expr * e = parseExprFromFile(path); try { + /* !!! Maybe we should cache the evaluation result. */ eval(e, v); } catch (Error & e) { addErrorPrefix(e, "while evaluating the file `%1%':\n", path); -- cgit 1.4.1