about summary refs log tree commit diff
path: root/src/libexpr/eval.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-08-06T13·02+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-08-06T13·02+0000
commit54945a2950174ded83d58336061b4a9990cdbbfd (patch)
tree8789c505f73551e9a40d745cbb2858ddc683cd9c /src/libexpr/eval.hh
parentc8606664abe952f74985503c831d31ae7a7369bc (diff)
* Refactoring: move parseExprFromFile() and parseExprFromString() into
  the EvalState class.

Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r--src/libexpr/eval.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index 7b7fea9345..e900217fa4 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -218,6 +218,13 @@ public:
     EvalState();
     ~EvalState();
 
+    /* Parse a Nix expression from the specified file.  If `path'
+       refers to a directory, then "/default.nix" is appended. */
+    Expr * parseExprFromFile(Path path);
+
+    /* Parse a Nix expression from the specified string. */
+    Expr * parseExprFromString(const string & s, const Path & basePath);
+    
     /* Evaluate an expression read from the given file to normal
        form. */
     void evalFile(const Path & path, Value & v);
@@ -296,6 +303,9 @@ private:
     friend class ExprAttrs;
     friend class ExprLet;
 
+    Expr * parse(const char * text,
+        const Path & path, const Path & basePath);
+
 public:
     
     /* Do a deep equality test between two values.  That is, list