From: sof Date: Fri, 4 Sep 1998 20:14:54 +0000 (+0000) Subject: [project @ 1998-09-04 20:14:50 by sof] X-Git-Tag: Approx_2487_patches~267 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=85d5d76b4e39074cc9034fa2045a4e4e68878406;p=ghc-hetmet.git [project @ 1998-09-04 20:14:50 by sof] In an interface file, don't allow data and newtype decls to have deriving clauses (not needed.) --- diff --git a/ghc/compiler/reader/Lex.lhs b/ghc/compiler/reader/Lex.lhs index 32efe30..4e1a0b6 100644 --- a/ghc/compiler/reader/Lex.lhs +++ b/ghc/compiler/reader/Lex.lhs @@ -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) diff --git a/ghc/compiler/rename/ParseIface.y b/ghc/compiler/rename/ParseIface.y index b6d5d7b..d4dd37b 100644 --- a/ghc/compiler/rename/ParseIface.y +++ b/ghc/compiler/rename/ParseIface.y @@ -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 }