Skip to content
Snippets Groups Projects
Commit 85d5d76b authored by sof's avatar sof
Browse files

[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.)
parent 4d4fd00b
No related merge requests found
......@@ -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)
......
......@@ -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 }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment