about summary refs log tree commit diff
path: root/src/libexpr/nixexpr.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-04-14T15·14+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-04-14T15·14+0000
commit81de12bc8fa09a89dae958a3ffc93e7a4c245db1 (patch)
tree7e2a8545dc16229181caa87266bede87b98ebf63 /src/libexpr/nixexpr.hh
parent110d1557782fac4f8cafa27e5cbbcdebefb7a4c7 (diff)
* Refactoring: move variable uses to a separate class.
Diffstat (limited to 'src/libexpr/nixexpr.hh')
-rw-r--r--src/libexpr/nixexpr.hh13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index f9ed34f58a3c..ffea7049fdba 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -78,7 +78,7 @@ struct ExprPath : Expr
     COMMON_METHODS
 };
 
-struct ExprVar : Expr
+struct VarRef
 {
     Symbol name;
 
@@ -94,8 +94,15 @@ struct ExprVar : Expr
        levels up from the current one.*/
     unsigned int level;
     unsigned int displ;
-    
-    ExprVar(const Symbol & name) : name(name) { };
+
+    VarRef(const Symbol & name) : name(name) { };
+    void bind(const StaticEnv & env);
+};
+
+struct ExprVar : Expr
+{
+    VarRef info;
+    ExprVar(const Symbol & name) : info(name) { };
     COMMON_METHODS
 };