[project @ 1998-09-04 20:14:50 by sof]
authorsof <unknown>
Fri, 4 Sep 1998 20:14:54 +0000 (20:14 +0000)
committersof <unknown>
Fri, 4 Sep 1998 20:14:54 +0000 (20:14 +0000)
In an interface file, don't allow data and newtype decls to have deriving clauses (not needed.)

ghc/compiler/reader/Lex.lhs
ghc/compiler/rename/ParseIface.y

index 32efe30..4e1a0b6 100644 (file)
@@ -176,7 +176,6 @@ data IfaceToken
   | ITdata
   | ITtype
   | ITnewtype
-  | ITderiving
   | ITclass
   | ITwhere
   | ITinstance
@@ -760,7 +759,6 @@ haskellKeywordsFM = listToUFM $
        ,("of",                 ITof)
        ,("in",                 ITin)
        ,("let",                        ITlet)
-       ,("deriving",           ITderiving)
 
        ,("->",                 ITrarrow)
        ,("\\",                 ITlam)
index b6d5d7b..d4dd37b 100644 (file)
@@ -44,7 +44,6 @@ import Outputable
        DATA                { ITdata }
        TYPE                { ITtype }
        NEWTYPE             { ITnewtype }
-       DERIVING            { ITderiving }
        CLASS               { ITclass }
        WHERE               { ITwhere }
        INSTANCE            { ITinstance }
@@ -233,10 +232,10 @@ version           :  INTEGER                              { fromInteger $1 }
 topdecl                :: { RdrNameHsDecl }
 topdecl                :  src_loc TYPE  tc_name tv_bndrs EQUAL type SEMI
                        { TyD (TySynonym $3 $4 $6 $1) }
-               |  src_loc DATA decl_context tc_name tv_bndrs constrs deriving SEMI
-                       { TyD (TyData DataType $3 $4 $5 $6 $7 noDataPragmas $1) }
-               |  src_loc NEWTYPE decl_context tc_name tv_bndrs newtype_constr deriving SEMI
-                       { TyD (TyData NewType $3 $4 $5 $6 $7 noDataPragmas $1) }
+               |  src_loc DATA decl_context tc_name tv_bndrs constrs SEMI
+                       { TyD (TyData DataType $3 $4 $5 $6 Nothing noDataPragmas $1) }
+               |  src_loc NEWTYPE decl_context tc_name tv_bndrs newtype_constr SEMI
+                       { TyD (TyData NewType $3 $4 $5 $6 Nothing noDataPragmas $1) }
                |  src_loc CLASS decl_context tc_name tv_bndrs csigs SEMI
                        { ClD (mkClassDecl $3 $4 $5 $6 EmptyMonoBinds noClassPragmas $1) }
                |  src_loc var_name TYPE_PART
@@ -295,10 +294,6 @@ newtype_constr     :: { [RdrNameConDecl] {- Empty if handwritten abstract -} }
 newtype_constr :                                       { [] }
                | src_loc EQUAL data_name atype         { [ConDecl $3 [] (NewCon $4) $1] }
 
-deriving       :: { Maybe [RdrName] }
-               :                                       { Nothing }
-               | DERIVING OPAREN tc_names1 CPAREN      { Just $3 }
-
 batypes                :: { [RdrNameBangType] }
 batypes                :                                       { [] }
                |  batype batypes                       { $1 : $2 }