X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FhsSyn%2FHsDecls.lhs;h=08d12b7f3702cab8e5409572d24e380a775bbb64;hb=b4556cace1b420341c3e3bc6c1d7a7f693c655e4;hp=bca3a5379ce8752b2a95e32393ab09c5698f2b90;hpb=1fede4bc9501744bf2269ce2a4cb9fb735969caa;p=ghc-hetmet.git diff --git a/compiler/hsSyn/HsDecls.lhs b/compiler/hsSyn/HsDecls.lhs index bca3a53..08d12b7 100644 --- a/compiler/hsSyn/HsDecls.lhs +++ b/compiler/hsSyn/HsDecls.lhs @@ -101,7 +101,8 @@ data HsDecl id | AnnD (AnnDecl id) | RuleD (RuleDecl id) | SpliceD (SpliceDecl id) - | DocD (DocDecl id) + | DocD (DocDecl) + | QuasiQuoteD (HsQuasiQuote id) -- NB: all top-level fixity decls are contained EITHER @@ -136,7 +137,7 @@ data HsGroup id hs_annds :: [LAnnDecl id], hs_ruleds :: [LRuleDecl id], - hs_docs :: [LDocDecl id] + hs_docs :: [LDocDecl] } emptyGroup, emptyRdrGroup, emptyRnGroup :: HsGroup a @@ -204,6 +205,7 @@ instance OutputableBndr name => Outputable (HsDecl name) where ppr (AnnD ad) = ppr ad ppr (SpliceD dd) = ppr dd ppr (DocD doc) = ppr doc + ppr (QuasiQuoteD qq) = ppr qq instance OutputableBndr name => Outputable (HsGroup name) where ppr (HsGroup { hs_valds = val_decls, @@ -225,7 +227,7 @@ instance OutputableBndr name => Outputable (HsGroup name) where ppr_ds foreign_decls] where ppr_ds [] = empty - ppr_ds ds = text "" $$ vcat (map ppr ds) + ppr_ds ds = blankLine $$ vcat (map ppr ds) data SpliceDecl id = SpliceDecl (Located (HsExpr id)) -- Top level splice @@ -476,7 +478,7 @@ data TyClDecl name -- only 'TyFamily' and -- 'TySynonym'; the -- latter for defaults - tcdDocs :: [LDocDecl name] -- ^ Haddock docs + tcdDocs :: [LDocDecl] -- ^ Haddock docs } data NewOrData @@ -696,7 +698,7 @@ data ConDecl name -- ^ Constructor name. This is used for the DataCon itself, and for -- the user-callable wrapper Id. - , con_explicit :: HsExplicitForAll + , con_explicit :: HsExplicitFlag -- ^ Is there an user-written forall? (cf. 'HsTypes.HsForAllTy') , con_qvars :: [LHsTyVarBndr name] @@ -716,7 +718,7 @@ data ConDecl name , con_res :: ResType name -- ^ Result type of the constructor - , con_doc :: Maybe (LHsDoc name) + , con_doc :: Maybe LHsDocString -- ^ A possible Haddock comment. , con_old_rec :: Bool @@ -840,7 +842,7 @@ data DerivDecl name = DerivDecl (LHsType name) instance (OutputableBndr name) => Outputable (DerivDecl name) where ppr (DerivDecl ty) - = hsep [ptext (sLit "derived instance"), ppr ty] + = hsep [ptext (sLit "deriving instance"), ppr ty] \end{code} %************************************************************************ @@ -940,7 +942,7 @@ instance Outputable ForeignImport where pprCEntity (CLabel lbl) = ptext (sLit "static") <+> pp_hdr <+> char '&' <> ppr lbl - pprCEntity (CFunction (StaticTarget lbl)) = + pprCEntity (CFunction (StaticTarget lbl _)) = ptext (sLit "static") <+> pp_hdr <+> ppr lbl pprCEntity (CFunction (DynamicTarget)) = ptext (sLit "dynamic") @@ -1000,19 +1002,19 @@ instance OutputableBndr name => Outputable (RuleBndr name) where \begin{code} -type LDocDecl name = Located (DocDecl name) +type LDocDecl = Located (DocDecl) -data DocDecl name - = DocCommentNext (HsDoc name) - | DocCommentPrev (HsDoc name) - | DocCommentNamed String (HsDoc name) - | DocGroup Int (HsDoc name) +data DocDecl + = DocCommentNext HsDocString + | DocCommentPrev HsDocString + | DocCommentNamed String HsDocString + | DocGroup Int HsDocString -- Okay, I need to reconstruct the document comments, but for now: -instance Outputable (DocDecl name) where +instance Outputable DocDecl where ppr _ = text "" -docDeclDoc :: DocDecl name -> HsDoc name +docDeclDoc :: DocDecl -> HsDocString docDeclDoc (DocCommentNext d) = d docDeclDoc (DocCommentPrev d) = d docDeclDoc (DocCommentNamed _ d) = d