[project @ 2002-05-27 10:20:20 by simonpj]
authorsimonpj <unknown>
Mon, 27 May 2002 10:20:20 +0000 (10:20 +0000)
committersimonpj <unknown>
Mon, 27 May 2002 10:20:20 +0000 (10:20 +0000)
Build TyDecl and ConDecl with the RdrHsSyn constructors, so the SysNames are right

ghc/compiler/parser/ParserCore.y

index c18a15a..2f6080e 100644 (file)
@@ -74,9 +74,9 @@ tdefs :: { [RdrNameHsDecl] }
 
 tdef   :: { RdrNameHsDecl }
        : '%data' q_tc_name tbinds '=' '{' cons1 '}'
-                { TyClD (TyData DataType [] $2 $3 (DataCons $6) Nothing [] noSrcLoc) }
+                { TyClD (mkTyData DataType ([], $2, $3) (DataCons $6) Nothing noSrcLoc) }
        | '%newtype' q_tc_name tbinds trep 
-               { TyClD (TyData NewType []  $2 $3 ($4 $2 $3) Nothing [] noSrcLoc) }
+               { TyClD (mkTyData NewType ([], $2, $3) ($4 $2 $3) Nothing noSrcLoc) }
 
 trep    :: { (RdrName -> [HsTyVarBndr RdrName] -> DataConDetails (ConDecl RdrName)) }
         : {- empty -}   { (\ x ts -> Unknown) }
@@ -146,7 +146,7 @@ cons1       :: { [ConDecl RdrName] }
 
 con    :: { ConDecl RdrName }
        : q_d_name attbinds atys 
-               { ConDecl $1 $1 $2 [] (VanillaCon (map unbangedType $3)) noSrcLoc}
+               { mkConDecl $1 $2 [] (VanillaCon (map unbangedType $3)) noSrcLoc}
 
 atys   :: { [ RdrNameHsType] }
        : {- empty -}   { [] }