1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

Make Env self-describing

If the Env denotes a 'with', then values[0] may be an Expr* cast to a
Value*. For code that generically traverses Values/Envs, it's useful
to know this.
This commit is contained in:
Eelco Dolstra 2018-05-22 16:02:32 +02:00
parent 9fd7cf98db
commit 4bb8741b98
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
2 changed files with 12 additions and 8 deletions

View file

@ -35,8 +35,8 @@ struct Env
{
Env * up;
unsigned short size; // used by valueSize
unsigned short prevWith:15; // nr of levels up to next `with' environment
unsigned short haveWithAttrs:1;
unsigned short prevWith:14; // nr of levels up to next `with' environment
enum { Plain = 0, HasWithExpr, HasWithAttrs } type:2;
Value * values[0];
};