[project @ 1997-03-14 07:52:06 by simonpj]
[ghc-hetmet.git] / ghc / compiler / parser / syntax.c
index 5091453..a48b119 100644 (file)
@@ -13,6 +13,7 @@
 #include "constants.h"
 #include "utils.h"
 #include "tree.h"
+#include "list.h"
 
 #include "hsparser.tab.h"
 
@@ -108,6 +109,9 @@ expORpat(int wanted, tree e)
        expORpat(wanted, glazyp(e));
        break;
 
+      case plusp:
+       break;
+
       case lit:
        switch (tliteral(glit(e))) {
          case integer:
@@ -556,7 +560,7 @@ splittyconapp(app, tyc, tys)
       break;
 
     default:
-      hsperror("panic: splittyconap: bad tycon application (no tycon)");
+      hsperror("bad left argument to constructor op");
     }
 }
 
@@ -701,3 +705,20 @@ checkprec(exp,qfn,right)
 
 #endif /* 0 */
 
+
+
+/* Reverse a list, in place */
+
+list reverse_list( l )
+  list l;
+{
+  list temp, acc = Lnil;
+
+  while (tlist( l ) != lnil) {
+       temp = ltl( l );
+       ltl( l ) = acc;
+       acc = l;
+       l = temp;
+  }
+  return( acc );
+}