X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FhsSyn%2FHsTypes.lhs;fp=compiler%2FhsSyn%2FHsTypes.lhs;h=4417751335176fd11641037efefbbd18771849c1;hp=4e6e5ab908b92ba1e110eb5f4d13b98088b850d6;hb=6f8ff0bbad3b9fa389c960ad1b5a267a1ae502f1;hpb=4b357e2a7e7eff16cb51b01830636d451664b202 diff --git a/compiler/hsSyn/HsTypes.lhs b/compiler/hsSyn/HsTypes.lhs index 4e6e5ab..4417751 100644 --- a/compiler/hsSyn/HsTypes.lhs +++ b/compiler/hsSyn/HsTypes.lhs @@ -12,6 +12,7 @@ module HsTypes ( HsExplicitForAll(..), HsContext, LHsContext, HsPred(..), LHsPred, + HsQuasiQuote(..), LBangType, BangType, HsBang(..), getBangType, getBangStrictness, @@ -61,6 +62,28 @@ placeHolderType = panic "Evaluated the place holder for a PostTcType" %************************************************************************ %* * + Quasi quotes; used in types and elsewhere +%* * +%************************************************************************ + +\begin{code} +data HsQuasiQuote id = HsQuasiQuote + id -- The quasi-quoter + SrcSpan -- The span of the enclosed string + FastString -- The enclosed string + +instance OutputableBndr id => Outputable (HsQuasiQuote id) where + ppr = ppr_qq + +ppr_qq :: OutputableBndr id => HsQuasiQuote id -> SDoc +ppr_qq (HsQuasiQuote quoter _ quote) = + char '[' <> ppr quoter <> ptext (sLit "|") <> + ppr quote <> ptext (sLit "|]") +\end{code} + + +%************************************************************************ +%* * \subsection{Bang annotations} %* * %************************************************************************ @@ -157,6 +180,7 @@ data HsType name Kind -- A type with a kind signature | HsSpliceTy (HsSplice name) + | HsQuasiQuoteTy (HsQuasiQuote name) | HsDocTy (LHsType name) LHsDocString -- A documented type @@ -374,6 +398,7 @@ ppr_mono_ty ctxt_prec (HsForAllTy exp tvs ctxt ty) sep [pprHsForAll exp tvs ctxt, ppr_mono_lty pREC_TOP ty] ppr_mono_ty _ (HsBangTy b ty) = ppr b <> ppr ty +ppr_mono_ty _ (HsQuasiQuoteTy qq) = ppr qq ppr_mono_ty _ (HsRecTy flds) = pprConDeclFields flds ppr_mono_ty _ (HsTyVar name) = ppr name ppr_mono_ty prec (HsFunTy ty1 ty2) = ppr_fun_ty prec ty1 ty2