about summary refs log tree commit diff
path: root/src/libexpr/nixexpr.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-04T20·43+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-04T20·43+0200
commit4c5faad99408cdfc35a8b0923d1efdf288fd9990 (patch)
treea40d404568c305dbfddf77e7ed6222da982274ca /src/libexpr/nixexpr.hh
parentbd9b1d97b42f307c8b595bb2de9b15bec1405b23 (diff)
Show position info in Boolean operations
Diffstat (limited to 'src/libexpr/nixexpr.hh')
-rw-r--r--src/libexpr/nixexpr.hh20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index d781d92ba78a..f07b85c8343c 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -277,28 +277,13 @@ struct ExprBuiltin : Expr
     COMMON_METHODS
 };
 
-struct ExprApp : Expr
-{
-    Pos pos;
-    Expr * e1, * e2;
-    ExprApp(Expr * e1, Expr * e2) : e1(e1), e2(e2) { };
-    ExprApp(const Pos & pos, Expr * e1, Expr * e2) : pos(pos), e1(e1), e2(e2) { };
-    void show(std::ostream & str)
-    {
-        str << *e1 << " " << *e2;
-    }
-    void bindVars(const StaticEnv & env)
-    {
-        e1->bindVars(env); e2->bindVars(env);
-    }
-    void eval(EvalState & state, Env & env, Value & v);
-};
-
 #define MakeBinOp(name, s) \
     struct Expr##name : Expr \
     { \
+        Pos pos; \
         Expr * e1, * e2; \
         Expr##name(Expr * e1, Expr * e2) : e1(e1), e2(e2) { }; \
+        Expr##name(const Pos & pos, Expr * e1, Expr * e2) : pos(pos), e1(e1), e2(e2) { }; \
         void show(std::ostream & str) \
         { \
             str << *e1 << " " s " " << *e2; \
@@ -310,6 +295,7 @@ struct ExprApp : Expr
         void eval(EvalState & state, Env & env, Value & v); \
     };
 
+MakeBinOp(App, "")
 MakeBinOp(OpEq, "==")
 MakeBinOp(OpNEq, "!=")
 MakeBinOp(OpAnd, "&&")