summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/GHC/Hs.hs2
-rw-r--r--compiler/GHC/Parser.y19
2 files changed, 9 insertions, 12 deletions
diff --git a/compiler/GHC/Hs.hs b/compiler/GHC/Hs.hs
index eb66dc0f28..9ec3215dbd 100644
--- a/compiler/GHC/Hs.hs
+++ b/compiler/GHC/Hs.hs
@@ -101,7 +101,7 @@ deriving instance Data (HsModule GhcPs)
data AnnsModule
= AnnsModule {
am_main :: [AddEpAnn],
- am_decls :: AnnList,
+ am_decls :: [TrailingAnn],
am_eof :: Maybe (RealSrcSpan, RealSrcSpan) -- End of file and end of prior token
} deriving (Data, Eq)
diff --git a/compiler/GHC/Parser.y b/compiler/GHC/Parser.y
index bbbc12df56..d95d9d1512 100644
--- a/compiler/GHC/Parser.y
+++ b/compiler/GHC/Parser.y
@@ -925,20 +925,17 @@ maybemodwarning :: { Maybe (LocatedP (WarningTxt GhcPs)) }
(AnnPragma (mo $1) (mc $4) (fst $ unLoc $3))}
| {- empty -} { Nothing }
-body :: { (AnnList
+body :: { ([TrailingAnn]
,([LImportDecl GhcPs], [LHsDecl GhcPs])
,LayoutInfo GhcPs) }
- : '{' top '}' { (AnnList Nothing (Just $ moc $1) (Just $ mcc $3) [] (fst $2)
- , snd $2, explicitBraces $1 $3) }
- | vocurly top close { (AnnList Nothing Nothing Nothing [] (fst $2)
- , snd $2, VirtualBraces (getVOCURLY $1)) }
+ : '{' top '}' { (fst $2, snd $2, explicitBraces $1 $3) }
+ | vocurly top close { (fst $2, snd $2, VirtualBraces (getVOCURLY $1)) }
-body2 :: { (AnnList
+body2 :: { ([TrailingAnn]
,([LImportDecl GhcPs], [LHsDecl GhcPs])
,LayoutInfo GhcPs) }
- : '{' top '}' { (AnnList Nothing (Just $ moc $1) (Just $ mcc $3) [] (fst $2)
- , snd $2, explicitBraces $1 $3) }
- | missing_module_keyword top close { (AnnList Nothing Nothing Nothing [] [], snd $2, VirtualBraces leftmostColumn) }
+ : '{' top '}' { (fst $2, snd $2, explicitBraces $1 $3) }
+ | missing_module_keyword top close { ([], snd $2, VirtualBraces leftmostColumn) }
top :: { ([TrailingAnn]
@@ -957,14 +954,14 @@ header :: { Located (HsModule GhcPs) }
: 'module' modid maybemodwarning maybeexports 'where' header_body
{% fileSrcSpan >>= \ loc ->
acs (\cs -> (L loc (HsModule (XModulePs
- (EpAnn (spanAsAnchor loc) (AnnsModule [mj AnnModule $1,mj AnnWhere $5] (AnnList Nothing Nothing Nothing [] []) Nothing) cs)
+ (EpAnn (spanAsAnchor loc) (AnnsModule [mj AnnModule $1,mj AnnWhere $5] [] Nothing) cs)
NoLayoutInfo $3 Nothing)
(Just $2) $4 $6 []
))) }
| 'signature' modid maybemodwarning maybeexports 'where' header_body
{% fileSrcSpan >>= \ loc ->
acs (\cs -> (L loc (HsModule (XModulePs
- (EpAnn (spanAsAnchor loc) (AnnsModule [mj AnnModule $1,mj AnnWhere $5] (AnnList Nothing Nothing Nothing [] []) Nothing) cs)
+ (EpAnn (spanAsAnchor loc) (AnnsModule [mj AnnModule $1,mj AnnWhere $5] [] Nothing) cs)
NoLayoutInfo $3 Nothing)
(Just $2) $4 $6 []
))) }