about summary refs log tree commit diff
path: root/src/libexpr/eval.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-05-22T14·02+0200
committerEelco Dolstra <edolstra@gmail.com>2018-05-22T14·02+0200
commit4bb8741b9839162b42d998a1511a3b9080a0cc36 (patch)
tree048afc84a094435937ed1787afa0b0f00457ea3a /src/libexpr/eval.hh
parent9fd7cf98dbec047343baefa65cd26ce4493bee53 (diff)
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.
Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r--src/libexpr/eval.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index 8594a2707d9a..3725e45dad9b 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -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];
 };