[project @ 1997-05-19 00:12:10 by sof]
[ghc-hetmet.git] / ghc / compiler / parser / syntax.c
index 5091453..4194377 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:
@@ -123,6 +127,7 @@ expORpat(int wanted, tree e)
 
          case clitlit:
            error_if_patt_wanted(wanted, "``literal-literal'' in pattern");
+           break;
 
          default: /* the others only occur in pragmas */
            hsperror("not a valid literal pattern or expression");
@@ -556,7 +561,7 @@ splittyconapp(app, tyc, tys)
       break;
 
     default:
-      hsperror("panic: splittyconap: bad tycon application (no tycon)");
+      hsperror("bad left argument to constructor op");
     }
 }
 
@@ -701,3 +706,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 );
+}