diff options
author | romes <rodrigo.m.mesquita@gmail.com> | 2022-06-13 23:22:06 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-07-06 13:50:27 -0400 |
commit | acc1816b9153f134a3308d13b90d67bfcb123d87 (patch) | |
tree | 21a683d1081e9c6755ff5fac426be872505d8e8c /compiler/GHC/Iface | |
parent | e4eea07b808bea530cf4b4fd2468035dd2cad67b (diff) | |
download | haskell-acc1816b9153f134a3308d13b90d67bfcb123d87.tar.gz |
TTG for ForeignImport/Export
Add a TTG parameter to both `ForeignImport` and `ForeignExport` and,
according to #21592, move the GHC-specific bits in them and in the other
AST data types related to foreign imports and exports to the TTG
extension point.
Diffstat (limited to 'compiler/GHC/Iface')
-rw-r--r-- | compiler/GHC/Iface/Ext/Ast.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/GHC/Iface/Ext/Ast.hs b/compiler/GHC/Iface/Ext/Ast.hs index 553f872c29..43cd29bc1c 100644 --- a/compiler/GHC/Iface/Ext/Ast.hs +++ b/compiler/GHC/Iface/Ext/Ast.hs @@ -1999,22 +1999,22 @@ instance ToHie (LocatedA (ForeignDecl GhcRn)) where , toHie fe ] -instance ToHie ForeignImport where - toHie (CImport (L a _) (L b _) _ _ (L c _)) = concatM $ +instance ToHie (ForeignImport GhcRn) where + toHie (CImport (L c _) (L a _) (L b _) _ _) = concatM $ [ locOnly a , locOnly b , locOnly c ] -instance ToHie ForeignExport where - toHie (CExport (L a _) (L b _)) = concatM $ +instance ToHie (ForeignExport GhcRn) where + toHie (CExport (L b _) (L a _)) = concatM $ [ locOnly a , locOnly b ] instance ToHie (LocatedA (WarnDecls GhcRn)) where toHie (L span decl) = concatM $ makeNodeA decl span : case decl of - Warnings _ _ warnings -> + Warnings _ warnings -> [ toHie warnings ] @@ -2026,7 +2026,7 @@ instance ToHie (LocatedA (WarnDecl GhcRn)) where instance ToHie (LocatedA (AnnDecl GhcRn)) where toHie (L span decl) = concatM $ makeNodeA decl span : case decl of - HsAnnotation _ _ prov expr -> + HsAnnotation _ prov expr -> [ toHie prov , toHie expr ] @@ -2038,7 +2038,7 @@ instance ToHie (AnnProvenance GhcRn) where instance ToHie (LocatedA (RuleDecls GhcRn)) where toHie (L span decl) = concatM $ makeNodeA decl span : case decl of - HsRules _ _ rules -> + HsRules _ rules -> [ toHie rules ] |