about summary refs log tree commit diff
path: root/src/fix-ng/fix-expr.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-11-03T11·59+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-11-03T11·59+0000
commite2655aa332a33b56d9168928511a598fc9b0c1e6 (patch)
tree6801c00bc1f2f9995f1627c1a6b2df7e20ca55af /src/fix-ng/fix-expr.cc
parentad0976f8d5f2afbca4e2fe6cbb3d2c2e53760222 (diff)
* Shorter list syntax ([a b c] instead of [a, b, c]).
Diffstat (limited to 'src/fix-ng/fix-expr.cc')
-rw-r--r--src/fix-ng/fix-expr.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/fix-ng/fix-expr.cc b/src/fix-ng/fix-expr.cc
index 96cb13b725e5..6333595c631b 100644
--- a/src/fix-ng/fix-expr.cc
+++ b/src/fix-ng/fix-expr.cc
@@ -4,8 +4,6 @@
 
 ATerm bottomupRewrite(TermFun & f, ATerm e)
 {
-    e = f(e);
-
     if (ATgetType(e) == AT_APPL) {
         AFun fun = ATgetAFun(e);
         int arity = ATgetArity(fun);
@@ -14,10 +12,10 @@ ATerm bottomupRewrite(TermFun & f, ATerm e)
         for (int i = arity - 1; i >= 0; i--)
             args = ATinsert(args, bottomupRewrite(f, ATgetArgument(e, i)));
         
-        return (ATerm) ATmakeApplList(fun, args);
+        e = (ATerm) ATmakeApplList(fun, args);
     }
 
-    if (ATgetType(e) == AT_LIST) {
+    else if (ATgetType(e) == AT_LIST) {
         ATermList in = (ATermList) e;
         ATermList out = ATempty;
 
@@ -26,10 +24,10 @@ ATerm bottomupRewrite(TermFun & f, ATerm e)
             in = ATgetNext(in);
         }
 
-        return (ATerm) ATreverse(out);
+        e = (ATerm) ATreverse(out);
     }
 
-    return e;
+    return f(e);
 }