Skip to content

Commit fb660a1

Browse files
Torrencemmatthew.torrencebergmark
authored
Implement toDec for AnnPragma (#21)
* Implement toDec for AnnPragma Co-authored-by: matthew.torrence <[email protected]> Co-authored-by: Adam Bergmark <[email protected]>
1 parent 378b5dd commit fb660a1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
dist-newstyle/
44
dist/
55
cabal.project.local
6+
.vscode

haskell-src-meta/src/Language/Haskell/Meta/Syntax/Translate.hs

+9
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,15 @@ instance ToDec (Exts.Decl l) where
599599
where
600600
toFunDep (Exts.FunDep _ ls rs) = TH.FunDep (fmap toName ls) (fmap toName rs)
601601

602+
toDec (Exts.AnnPragma _ ann) = TH.PragmaD (TH.AnnP (target ann) (expann ann))
603+
where
604+
target (Exts.Ann _ n _) = TH.ValueAnnotation (toName n)
605+
target (Exts.TypeAnn _ n _) = TH.TypeAnnotation (toName n)
606+
target (Exts.ModuleAnn _ _) = TH.ModuleAnnotation
607+
expann (Exts.Ann _ _ e) = toExp e
608+
expann (Exts.TypeAnn _ _ e) = toExp e
609+
expann (Exts.ModuleAnn _ e) = toExp e
610+
602611
toDec x = todo "toDec" x
603612

604613
instance ToMaybeKind (Exts.ResultSig l) where

0 commit comments

Comments
 (0)