* 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.
This commit is contained in:
Eelco Dolstra 2004-10-26 22:54:26 +00:00
parent eb8284ddaa
commit 5fe9222b36
11 changed files with 410 additions and 304 deletions

View file

@ -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;