diff options
author | Ben Burdette <bburdette@gmail.com> | 2021-09-14 10:49:22 -0600 |
---|---|---|
committer | Ben Burdette <bburdette@gmail.com> | 2021-09-14 10:49:22 -0600 |
commit | 21071bfdeb0a5bc2b75018c91a4c2f138f233e33 (patch) | |
tree | 8fbdb2f7de3682ef977c737fd59970d2ed5dabb8 /src/libexpr/eval.hh | |
parent | 176911102ce2c0be06bbfed9099f364d71c3c679 (diff) |
shared_ptr for StaticEnv
Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r-- | src/libexpr/eval.hh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index c96e2c726..8edc17789 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -23,6 +23,7 @@ enum RepairFlag : bool; typedef void (* PrimOpFun) (EvalState & state, const Pos & pos, Value * * args, Value & v); +extern std::function<void(const Error & error, const Env & env)> debuggerHook; struct PrimOp { @@ -154,10 +155,10 @@ public: /* Parse a Nix expression from the specified file. */ Expr * parseExprFromFile(const Path & path); - Expr * parseExprFromFile(const Path & path, StaticEnv & staticEnv); + Expr * parseExprFromFile(const Path & path, std::shared_ptr<StaticEnv> & staticEnv); /* Parse a Nix expression from the specified string. */ - Expr * parseExprFromString(std::string_view s, const Path & basePath, StaticEnv & staticEnv); + Expr * parseExprFromString(std::string_view s, const Path & basePath, std::shared_ptr<StaticEnv> & staticEnv); Expr * parseExprFromString(std::string_view s, const Path & basePath); Expr * parseStdin(); @@ -238,7 +239,7 @@ public: Env & baseEnv; /* The same, but used during parsing to resolve variables. */ - StaticEnv staticBaseEnv; // !!! should be private + std::shared_ptr<StaticEnv> staticBaseEnv; // !!! should be private private: @@ -277,7 +278,7 @@ private: friend struct ExprLet; Expr * parse(const char * text, FileOrigin origin, const Path & path, - const Path & basePath, StaticEnv & staticEnv); + const Path & basePath, std::shared_ptr<StaticEnv> & staticEnv); public: |