about summary refs log tree commit diff
path: root/src/nix-instantiate
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-10-26T22·54+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-10-26T22·54+0000
commit5fe9222b36ad49d74c84edb04d6bc4a7d844be01 (patch)
treee46926a3d60274e5b2dc9e6090df2804986292b0 /src/nix-instantiate
parenteb8284ddaa66448d369647f68cb9f89b93a187de (diff)
* Don't use ATmake / ATmatch anymore, nor the ATMatcher class.
  Instead we generate data bindings (build and match functions) for
  the constructors specified in `constructors.def'.  In particular
  this removes the conversions between AFuns and strings, and Nix
  expression evaluation now seems 3 to 4 times faster.

Diffstat (limited to 'src/nix-instantiate')
-rw-r--r--src/nix-instantiate/main.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nix-instantiate/main.cc b/src/nix-instantiate/main.cc
index e396be5ff2dc..907f7257a4e9 100644
--- a/src/nix-instantiate/main.cc
+++ b/src/nix-instantiate/main.cc
@@ -6,6 +6,7 @@
 #include "shared.hh"
 #include "eval.hh"
 #include "parser.hh"
+#include "constructors.hh"
 #include "help.txt.hh"
 
 
@@ -32,7 +33,7 @@ static void printDrvPaths(EvalState & state, Expr e)
 
     /* !!! duplication w.r.t. parseDerivations in nix-env */
 
-    if (atMatch(m, e) >> "Attrs" >> es) {
+    if (matchAttrs(e, es)) {
         Expr a = queryAttr(e, "type");
         if (a && evalString(state, a) == "derivation") {
             a = queryAttr(e, "drvPath");
@@ -50,7 +51,7 @@ static void printDrvPaths(EvalState & state, Expr e)
         }
     }
 
-    if (atMatch(m, e) >> "List" >> es) {
+    if (matchList(e, es)) {
         for (ATermIterator i(es); i; ++i)
             printDrvPaths(state, evalExpr(state, *i));
         return;