Repository : ssh://g...@git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/627d1e008cbe4d9318b2466394420a968d1659da/ghc
>--------------------------------------------------------------- commit 627d1e008cbe4d9318b2466394420a968d1659da Author: Austin Seipp <aus...@well-typed.com> Date: Tue Oct 1 21:07:44 2013 -0500 Add TH support for annotations (#8340) Authored-by: Gergely Risko <gerg...@risko.hu> Signed-off-by: Austin Seipp <aus...@well-typed.com> >--------------------------------------------------------------- 627d1e008cbe4d9318b2466394420a968d1659da compiler/hsSyn/Convert.lhs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/compiler/hsSyn/Convert.lhs b/compiler/hsSyn/Convert.lhs index 616e05c..59cbc7b 100644 --- a/compiler/hsSyn/Convert.lhs +++ b/compiler/hsSyn/Convert.lhs @@ -480,6 +480,19 @@ cvtPragmaD (RuleP nm bndrs lhs rhs phases) rhs' placeHolderNames } +cvtPragmaD (AnnP target exp) + = do { exp' <- cvtl exp + ; target' <- case target of + ModuleAnnotation -> return ModuleAnnProvenance + TypeAnnotation n -> do + n' <- tconName n + return (TypeAnnProvenance n') + ValueAnnotation n -> do + n' <- if isVarName n then vName n else cName n + return (ValueAnnProvenance n') + ; returnL $ Hs.AnnD $ HsAnnotation target' exp' + } + dfltActivation :: TH.Inline -> Activation dfltActivation TH.NoInline = NeverActive dfltActivation _ = AlwaysActive _______________________________________________ ghc-commits mailing list ghc-commits@haskell.org http://www.haskell.org/mailman/listinfo/ghc-commits