1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 16:51:15 +02:00

move valmap to hh; add to env

This commit is contained in:
Ben Burdette 2021-08-06 11:09:27 -06:00
parent edb5a28024
commit 89264d20e6
3 changed files with 142 additions and 30 deletions

View file

@ -33,12 +33,14 @@ struct PrimOp
const char * doc = nullptr;
};
typedef std::map<std::string, Value *> valmap;
struct Env
{
Env * up;
unsigned short prevWith:14; // nr of levels up to next `with' environment
enum { Plain = 0, HasWithExpr, HasWithAttrs } type:2;
std::unique_ptr<valmap> valuemap; // TODO: rename
Value * values[0];
};
@ -204,6 +206,7 @@ public:
string forceString(Value & v, const Pos & pos = noPos);
string forceString(Value & v, PathSet & context, const Pos & pos = noPos);
string forceStringNoCtx(Value & v, const Pos & pos = noPos);
// string forceStringNoCtx(std::optional<Bindings*> b, Value & v, const Pos & pos = noPos);
/* Return true iff the value `v' denotes a derivation (i.e. a
set with attribute `type = "derivation"'). */