[project @ 1997-05-26 04:24:36 by sof]
authorsof <unknown>
Mon, 26 May 1997 04:24:36 +0000 (04:24 +0000)
committersof <unknown>
Mon, 26 May 1997 04:24:36 +0000 (04:24 +0000)
labelled field fixes

ghc/compiler/parser/syntax.c

index 4194377..73b39f0 100644 (file)
@@ -318,6 +318,7 @@ lhs_is_patt(tree e)
       case llist:
       case tuple:
       case negate:
+      case record:
        expORpat(LEGIT_PATT, e);
        return TRUE;
 
@@ -327,13 +328,17 @@ lhs_is_patt(tree e)
       case ap:
        {
          tree f = function(e);
-         tree a = garg(e);       /* do not "unparen", otherwise the error
-                                      fromInteger ((x,y) {-no comma-} z)
-                                    will be missed.
-                                 */
 
-         /* definitions must have pattern arguments */
+/*  These lines appear to duplicate what's in function(e).
+    Nuked SLPJ May 97
+       
+         tree a = garg(e);       -- do not "unparen", otherwise the error
+                                 --     fromInteger ((x,y) {-no comma-} z)
+                                 --   will be missed.
+
+         -- definitions must have pattern arguments
          expORpat(LEGIT_PATT, a);
+*/
 
          if(ttree(f) == ident)
            return(isconstr(qid_to_string(gident(f))));
@@ -342,7 +347,7 @@ lhs_is_patt(tree e)
            return(lhs_is_patt(f));
 
          else
-           hsperror("Not a legal pattern binding in LHS");
+           hsperror("Syntax error: not a legal pattern binding in LHS");
        }
 
       case infixap:
@@ -363,7 +368,7 @@ lhs_is_patt(tree e)
 
       /* Anything else must be an illegal LHS */
       default:
-       hsperror("Not a valid LHS");
+       hsperror("Syntax error: not a valid LHS");
       }
 
   abort(); /* should never get here */
@@ -372,7 +377,8 @@ lhs_is_patt(tree e)
 
 
 /*
-  Return the function at the root of a series of applications.
+  Return the function at the root of a series of applications,
+  checking on the way that the arguments are patterns.
 */
 
 tree