about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-04-14T12·49+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-04-14T12·49+0000
commit816dd3f0612111718c338842283c1ee6577b9f0a (patch)
tree1623434b515acb2803985c9cd6808b397dacda38 /src/libexpr
parent011b5da0f46e9796fc68bc5daf5fe4dd4b57f933 (diff)
* Remove more obsolete code.
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/nixexpr.cc29
-rw-r--r--src/libexpr/nixexpr.hh11
2 files changed, 0 insertions, 40 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index 0abc2a457304..4040cacc813e 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -138,35 +138,6 @@ std::ostream & operator << (std::ostream & str, const Pos & pos)
     
 
 #if 0
-ATerm bottomupRewrite(TermFun & f, ATerm e)
-{
-    checkInterrupt();
-
-    if (ATgetType(e) == AT_APPL) {
-        AFun fun = ATgetAFun(e);
-        int arity = ATgetArity(fun);
-        ATerm args[arity];
-
-        for (int i = 0; i < arity; ++i)
-            args[i] = bottomupRewrite(f, ATgetArgument(e, i));
-        
-        e = (ATerm) ATmakeApplArray(fun, args);
-    }
-
-    else if (ATgetType(e) == AT_LIST) {
-        ATermList in = (ATermList) e;
-        ATermList out = ATempty;
-
-        for (ATermIterator i(in); i; ++i)
-            out = ATinsert(out, bottomupRewrite(f, *i));
-
-        e = (ATerm) ATreverse(out);
-    }
-
-    return f(e);
-}
-
-
 static void varsBoundByPattern(ATermMap & map, Pattern pat)
 {
     ATerm name;
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index ccddb16298a4..0e595a1b168d 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -207,17 +207,6 @@ struct ExprConcatStrings : Expr
 
 
 #if 0
-/* Generic bottomup traversal over ATerms.  The traversal first
-   recursively descends into subterms, and then applies the given term
-   function to the resulting term. */
-struct TermFun
-{
-    virtual ~TermFun() { }
-    virtual ATerm operator () (ATerm e) = 0;
-};
-ATerm bottomupRewrite(TermFun & f, ATerm e);
-
-
 /* Check whether all variables are defined in the given expression.
    Throw an exception if this isn't the case. */
 void checkVarDefs(const ATermMap & def, Expr e);