From 5fe9222b36ad49d74c84edb04d6bc4a7d844be01 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 26 Oct 2004 22:54:26 +0000 Subject: * 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. --- src/nix-instantiate/main.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nix-instantiate') diff --git a/src/nix-instantiate/main.cc b/src/nix-instantiate/main.cc index e396be5ff2..907f7257a4 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; -- cgit 1.4.1