summaryrefslogtreecommitdiff
path: root/ghc/compiler/parser/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/compiler/parser/syntax.c')
-rw-r--r--ghc/compiler/parser/syntax.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/ghc/compiler/parser/syntax.c b/ghc/compiler/parser/syntax.c
index 509145360a..a48b1198cb 100644
--- a/ghc/compiler/parser/syntax.c
+++ b/ghc/compiler/parser/syntax.c
@@ -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 );
+}