diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-09-02T16·34+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-09-02T16·34+0200 |
commit | 57d18df7d0005cf822368d9f1d0c33396c6b9f9f (patch) | |
tree | 41ad0f3493b8c4baeb35f5b5028fb6cf9a17dc9f /src/libexpr/eval.hh | |
parent | 92077b4547b473bb4ea7b38077299e8fba75ca62 (diff) |
Add some support code for nix-repl
Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r-- | src/libexpr/eval.hh | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index f7b21f7a38c5..98ac0bdb45a4 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -130,12 +130,15 @@ public: Expr * parseExprFromFile(Path path); /* Parse a Nix expression from the specified string. */ + Expr * parseExprFromString(const string & s, const Path & basePath, StaticEnv & staticEnv); 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); + void resetFileCache(); + /* Look up a file in the search path. */ Path findFile(const string & path); @@ -184,21 +187,19 @@ public: path. Nothing is copied to the store. */ Path coerceToPath(Value & v, PathSet & context); -private: +public: /* The base environment, containing the builtin functions and values. */ Env & baseEnv; - unsigned int baseEnvDispl; - -public: - /* The same, but used during parsing to resolve variables. */ StaticEnv staticBaseEnv; // !!! should be private private: + unsigned int baseEnvDispl; + void createBaseEnv(); void addConstant(const string & name, Value & v); @@ -212,8 +213,8 @@ private: friend class ExprAttrs; friend class ExprLet; - Expr * parse(const char * text, - const Path & path, const Path & basePath); + Expr * parse(const char * text, const Path & path, + const Path & basePath, StaticEnv & staticEnv); public: |