Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
-
7f75c588
by Alan Zimmerman at 2026-08-10T14:29:11-04:00
26 changed files:
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/PostProcess.hs
- testsuite/tests/ghc-api/T25121_status.stdout
- testsuite/tests/ghc-api/exactprint/T22919.stderr
- testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T15279.stderr
- testsuite/tests/parser/should_compile/T20718.stderr
- testsuite/tests/parser/should_compile/T20846.stderr
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/check-exact/Utils.hs
Changes:
| ... | ... | @@ -72,8 +72,8 @@ Global bindings (where clauses) |
| 72 | 72 | -- the ...LR datatypes are parameterized by two id types,
|
| 73 | 73 | -- one for the left and one for the right.
|
| 74 | 74 | |
| 75 | -type instance XHsValBinds (GhcPass pL) (GhcPass pR) = EpAnn (AnnList (EpToken "where"))
|
|
| 76 | -type instance XHsIPBinds (GhcPass pL) (GhcPass pR) = EpAnn (AnnList (EpToken "where"))
|
|
| 75 | +type instance XHsValBinds (GhcPass pL) (GhcPass pR) = (EpAnn AnnList, EpToken "where")
|
|
| 76 | +type instance XHsIPBinds (GhcPass pL) (GhcPass pR) = (EpAnn AnnList, EpToken "where")
|
|
| 77 | 77 | type instance XEmptyLocalBinds (GhcPass pL) (GhcPass pR) = NoExtField
|
| 78 | 78 | type instance XXHsLocalBindsLR (GhcPass pL) (GhcPass pR) = DataConCantHappen
|
| 79 | 79 |
| ... | ... | @@ -67,11 +67,8 @@ showAstData bs ba a0 = blankLine $$ showAstData' a0 |
| 67 | 67 | `extQ` string `extQ` fastString `extQ` srcSpan `extQ` realSrcSpan
|
| 68 | 68 | `extQ` annotationModule
|
| 69 | 69 | `extQ` annotationGrhsAnn
|
| 70 | + `extQ` annotationAnnListEpAnn
|
|
| 70 | 71 | `extQ` annotationAnnList
|
| 71 | - `extQ` annotationEpAnnListWhere
|
|
| 72 | - `extQ` annotationAnnListUnit
|
|
| 73 | - `extQ` annotationAnnListCommas
|
|
| 74 | - `extQ` annotationAnnListEpaLocation
|
|
| 75 | 72 | `extQ` annotationNoEpAnns
|
| 76 | 73 | `extQ` annotationExprBracket
|
| 77 | 74 | `extQ` annotationTypedBracket
|
| ... | ... | @@ -372,27 +369,15 @@ showAstData bs ba a0 = blankLine $$ showAstData' a0 |
| 372 | 369 | annotationGrhsAnn :: EpAnn GrhsAnn -> SDoc
|
| 373 | 370 | annotationGrhsAnn = annotation' (text "EpAnn GrhsAnn")
|
| 374 | 371 | |
| 375 | - annotationAnnList :: EpAnn (AnnList ()) -> SDoc
|
|
| 376 | - annotationAnnList = annotation' (text "EpAnn (AnnList ())")
|
|
| 372 | + annotationAnnListEpAnn :: EpAnn AnnList -> SDoc
|
|
| 373 | + annotationAnnListEpAnn = annotation' (text "EpAnn AnnList")
|
|
| 377 | 374 | |
| 378 | - annotationEpAnnListWhere :: EpAnn (AnnList (EpToken "where")) -> SDoc
|
|
| 379 | - annotationEpAnnListWhere = annotation' (text "EpAnn (AnnList (EpToken \"where\"))")
|
|
| 380 | - |
|
| 381 | - annotationAnnListCommas :: EpAnn (AnnList [EpToken ","]) -> SDoc
|
|
| 382 | - annotationAnnListCommas = annotation' (text "EpAnn (AnnList [EpToken \",\"])")
|
|
| 383 | - |
|
| 384 | - annotationAnnListUnit :: AnnList () -> SDoc
|
|
| 385 | - annotationAnnListUnit anns = case ba of
|
|
| 375 | + annotationAnnList :: AnnList -> SDoc
|
|
| 376 | + annotationAnnList anns = case ba of
|
|
| 386 | 377 | BlankEpAnnotations -> parens (text "blanked:" <+> text "AnnList ()")
|
| 387 | 378 | NoBlankEpAnnotations -> parens $ text (showConstr (toConstr anns))
|
| 388 | 379 | $$ vcat (gmapQ showAstData' anns)
|
| 389 | 380 | |
| 390 | - annotationAnnListEpaLocation :: AnnList EpaLocation -> SDoc
|
|
| 391 | - annotationAnnListEpaLocation anns = case ba of
|
|
| 392 | - BlankEpAnnotations -> parens (text "blanked:" <+> text "AnnList EpaLocation")
|
|
| 393 | - NoBlankEpAnnotations -> parens $ text (showConstr (toConstr anns))
|
|
| 394 | - $$ vcat (gmapQ showAstData' anns)
|
|
| 395 | - |
|
| 396 | 381 | annotationNoEpAnns :: EpAnn NoEpAnns -> SDoc
|
| 397 | 382 | annotationNoEpAnns = annotation' (text "EpAnn NoEpAnns")
|
| 398 | 383 |
| ... | ... | @@ -289,11 +289,11 @@ type instance XLet GhcPs = (EpToken "let", EpToken "in") |
| 289 | 289 | type instance XLet GhcRn = NoExtField
|
| 290 | 290 | type instance XLet GhcTc = NoExtField
|
| 291 | 291 | |
| 292 | -type instance XDo GhcPs = AnnList EpaLocation
|
|
| 292 | +type instance XDo GhcPs = (AnnList, EpaLocation)
|
|
| 293 | 293 | type instance XDo GhcRn = NoExtField
|
| 294 | 294 | type instance XDo GhcTc = Type
|
| 295 | 295 | |
| 296 | -type instance XExplicitList GhcPs = AnnList ()
|
|
| 296 | +type instance XExplicitList GhcPs = AnnList
|
|
| 297 | 297 | type instance XExplicitList GhcRn = NoExtField
|
| 298 | 298 | type instance XExplicitList GhcTc = Type
|
| 299 | 299 | -- GhcPs: ExplicitList includes all source-level
|
| ... | ... | @@ -1437,7 +1437,7 @@ type instance XCmdArrApp GhcPs = (IsUnicodeSyntax, EpaLocation) |
| 1437 | 1437 | type instance XCmdArrApp GhcRn = NoExtField
|
| 1438 | 1438 | type instance XCmdArrApp GhcTc = Type
|
| 1439 | 1439 | |
| 1440 | -type instance XCmdArrForm GhcPs = AnnList ()
|
|
| 1440 | +type instance XCmdArrForm GhcPs = AnnList
|
|
| 1441 | 1441 | -- | fixity (filled in by the renamer), for forms that were converted from
|
| 1442 | 1442 | -- OpApp's by the renamer
|
| 1443 | 1443 | type instance XCmdArrForm GhcRn = Maybe Fixity
|
| ... | ... | @@ -1464,7 +1464,7 @@ type instance XCmdLet GhcPs = (EpToken "let", EpToken "in") |
| 1464 | 1464 | type instance XCmdLet GhcRn = NoExtField
|
| 1465 | 1465 | type instance XCmdLet GhcTc = NoExtField
|
| 1466 | 1466 | |
| 1467 | -type instance XCmdDo GhcPs = AnnList EpaLocation
|
|
| 1467 | +type instance XCmdDo GhcPs = (AnnList, EpaLocation)
|
|
| 1468 | 1468 | type instance XCmdDo GhcRn = NoExtField
|
| 1469 | 1469 | type instance XCmdDo GhcTc = Type
|
| 1470 | 1470 | |
| ... | ... | @@ -1657,7 +1657,7 @@ type instance XMG GhcRn b = (Origin, -- See Note [Generated code and pat |
| 1657 | 1657 | MatchGroupAnn)
|
| 1658 | 1658 | type instance XMG GhcTc b = MatchGroupTc
|
| 1659 | 1659 | |
| 1660 | -type MatchGroupAnn = AnnList ()
|
|
| 1660 | +type MatchGroupAnn = AnnList
|
|
| 1661 | 1661 | |
| 1662 | 1662 | data MatchGroupTc
|
| 1663 | 1663 | = MatchGroupTc
|
| ... | ... | @@ -1892,7 +1892,7 @@ type instance XTransStmt (GhcPass _) GhcPs b = AnnTransStmt |
| 1892 | 1892 | type instance XTransStmt (GhcPass _) GhcRn b = NoExtField
|
| 1893 | 1893 | type instance XTransStmt (GhcPass _) GhcTc b = Type
|
| 1894 | 1894 | |
| 1895 | -type instance XRecStmt (GhcPass _) GhcPs b = AnnList (EpToken "rec")
|
|
| 1895 | +type instance XRecStmt (GhcPass _) GhcPs b = (AnnList, EpToken "rec")
|
|
| 1896 | 1896 | type instance XRecStmt (GhcPass _) GhcRn b = NoExtField
|
| 1897 | 1897 | type instance XRecStmt (GhcPass _) GhcTc b = RecStmtTc
|
| 1898 | 1898 |
| ... | ... | @@ -104,7 +104,7 @@ type instance XBangPat GhcPs = EpToken "!" |
| 104 | 104 | type instance XBangPat GhcRn = NoExtField
|
| 105 | 105 | type instance XBangPat GhcTc = NoExtField
|
| 106 | 106 | |
| 107 | -type instance XListPat GhcPs = AnnList ()
|
|
| 107 | +type instance XListPat GhcPs = AnnList
|
|
| 108 | 108 | -- After parsing, ListPat can refer to a built-in Haskell list pattern
|
| 109 | 109 | -- or an overloaded list pattern.
|
| 110 | 110 | type instance XListPat GhcRn = NoExtField
|
| ... | ... | @@ -326,11 +326,11 @@ mkHsIntegral :: IntegralLit GhcPs -> HsOverLit GhcPs |
| 326 | 326 | mkHsFractional :: FractionalLit GhcPs -> HsOverLit GhcPs
|
| 327 | 327 | mkHsIsString :: SourceText -> HText -> HsOverLit GhcPs
|
| 328 | 328 | mkHsDo :: HsDoFlavour -> LocatedA [ExprLStmt GhcPs] -> HsExpr GhcPs
|
| 329 | -mkHsDoAnns :: HsDoFlavour -> LocatedA [ExprLStmt GhcPs] -> AnnList EpaLocation -> HsExpr GhcPs
|
|
| 329 | +mkHsDoAnns :: HsDoFlavour -> LocatedA [ExprLStmt GhcPs] -> (AnnList, EpaLocation) -> HsExpr GhcPs
|
|
| 330 | 330 | mkHsComp :: HsDoFlavour -> [ExprLStmt GhcPs] -> LHsExpr GhcPs
|
| 331 | 331 | -> HsExpr GhcPs
|
| 332 | 332 | mkHsCompAnns :: HsDoFlavour -> [ExprLStmt GhcPs] -> LHsExpr GhcPs
|
| 333 | - -> AnnList EpaLocation
|
|
| 333 | + -> (AnnList, EpaLocation)
|
|
| 334 | 334 | -> HsExpr GhcPs
|
| 335 | 335 | |
| 336 | 336 | mkNPat :: LocatedAn NoEpAnns (HsOverLit GhcPs) -> Maybe (SyntaxExpr GhcPs) -> EpToken "-"
|
| ... | ... | @@ -368,7 +368,7 @@ mkRecStmt :: forall (idL :: Pass) bodyR. |
| 368 | 368 | (Anno (StmtLR (GhcPass idL) GhcPs bodyR))
|
| 369 | 369 | (StmtLR (GhcPass idL) GhcPs bodyR)]
|
| 370 | 370 | ~ SrcSpanAnnA)
|
| 371 | - => AnnList (EpToken "rec")
|
|
| 371 | + => (AnnList, EpToken "rec")
|
|
| 372 | 372 | -> LocatedA [LStmtLR (GhcPass idL) GhcPs bodyR]
|
| 373 | 373 | -> StmtLR (GhcPass idL) GhcPs bodyR
|
| 374 | 374 | mkRecStmt anns stmts = (emptyRecStmt' anns :: StmtLR (GhcPass idL) GhcPs bodyR)
|
| ... | ... | @@ -1791,13 +1791,13 @@ cvars1 :: { [RecordPatSynField GhcPs] } |
| 1791 | 1791 | | var ',' cvars1 {% do { h <- addTrailingCommaN $1 (gl $2)
|
| 1792 | 1792 | ; return ((RecordPatSynField (mkFieldOcc h) h) : $3 )}}
|
| 1793 | 1793 | |
| 1794 | -where_decls :: { LocatedA (OrdList (LHsDecl GhcPs), EpToken "where", AnnList ()) }
|
|
| 1794 | +where_decls :: { LocatedA (OrdList (LHsDecl GhcPs), EpToken "where", AnnList) }
|
|
| 1795 | 1795 | : 'where' '{' decls '}' {% amsA' (sLL $1 $> (thdOf3 $ unLoc $3,
|
| 1796 | 1796 | epTok $1,
|
| 1797 | - AnnList (Just (fstOf3 $ unLoc $3)) (ListBraces (epTok $2) (epTok $4)) (sndOf3 $ unLoc $3) () [])) }
|
|
| 1797 | + AnnList (Just (fstOf3 $ unLoc $3)) (ListBraces (epTok $2) (epTok $4)) (sndOf3 $ unLoc $3) [])) }
|
|
| 1798 | 1798 | | 'where' vocurly decls close {% amsA' (sLL $1 $3 (thdOf3 $ unLoc $3,
|
| 1799 | 1799 | epTok $1,
|
| 1800 | - AnnList (Just (fstOf3 $ unLoc $3)) ListNone (sndOf3 $ unLoc $3) () [])) }
|
|
| 1800 | + AnnList (Just (fstOf3 $ unLoc $3)) ListNone (sndOf3 $ unLoc $3) [])) }
|
|
| 1801 | 1801 | |
| 1802 | 1802 | pattern_synonym_sig :: { LSig GhcPs }
|
| 1803 | 1803 | : 'pattern' con_list '::' sigtype
|
| ... | ... | @@ -1932,10 +1932,10 @@ decls :: { Located (EpaLocation, [EpToken ";"], OrdList (LHsDecl GhcPs)) } |
| 1932 | 1932 | | decl { sL1 $1 (glR $1, [], unitOL $1) }
|
| 1933 | 1933 | | {- empty -} { noLoc (noAnn, [],nilOL) }
|
| 1934 | 1934 | |
| 1935 | -decllist :: { Located (AnnList (),Located (OrdList (LHsDecl GhcPs))) }
|
|
| 1936 | - : '{' decls '}' { sLL $1 $> (AnnList (Just (fstOf3 $ unLoc $2)) (ListBraces (epTok $1) (epTok $3)) (sndOf3 $ unLoc $2) noAnn []
|
|
| 1935 | +decllist :: { Located (AnnList,Located (OrdList (LHsDecl GhcPs))) }
|
|
| 1936 | + : '{' decls '}' { sLL $1 $> (AnnList (Just (fstOf3 $ unLoc $2)) (ListBraces (epTok $1) (epTok $3)) (sndOf3 $ unLoc $2) []
|
|
| 1937 | 1937 | ,sL1 $2 $ thdOf3 $ unLoc $2) }
|
| 1938 | - | vocurly decls close { sL1 $2 (AnnList (Just (fstOf3 $ unLoc $2)) ListNone (sndOf3 $ unLoc $2) noAnn []
|
|
| 1938 | + | vocurly decls close { sL1 $2 (AnnList (Just (fstOf3 $ unLoc $2)) ListNone (sndOf3 $ unLoc $2) []
|
|
| 1939 | 1939 | ,sL1 $2 $ thdOf3 $ unLoc $2) }
|
| 1940 | 1940 | |
| 1941 | 1941 | -- Binding groups other than those of class and instance declarations
|
| ... | ... | @@ -1943,16 +1943,16 @@ decllist :: { Located (AnnList (),Located (OrdList (LHsDecl GhcPs))) } |
| 1943 | 1943 | binds :: { Located (HsLocalBinds GhcPs) }
|
| 1944 | 1944 | -- May have implicit parameters
|
| 1945 | 1945 | -- No type declarations
|
| 1946 | - : decllist {% do { let { (AnnList anc p s _ t, decls) = unLoc $1 }
|
|
| 1946 | + : decllist {% do { let { (AnnList anc p s t, decls) = unLoc $1 }
|
|
| 1947 | 1947 | ; val_binds <- cvBindGroup (unLoc $ decls)
|
| 1948 | 1948 | ; !cs <- getCommentsFor (gl $1)
|
| 1949 | - ; return (sL1 $1 $ HsValBinds (EpAnn (glR $1) (AnnList anc p s noAnn t) cs) val_binds)} }
|
|
| 1949 | + ; return (sL1 $1 $ HsValBinds (EpAnn (glR $1) (AnnList anc p s t) cs, NoEpTok) val_binds)} }
|
|
| 1950 | 1950 | |
| 1951 | 1951 | | '{' dbinds '}' {% acs (comb3 $1 $2 $3) (\loc cs -> (L loc
|
| 1952 | - $ HsIPBinds (EpAnn (spanAsAnchor (comb3 $1 $2 $3)) (AnnList (Just$ glR $2) (ListBraces (epTok $1) (epTok $3)) [] noAnn []) cs) (IPBinds noExtField (reverse $ unLoc $2)))) }
|
|
| 1952 | + $ HsIPBinds (EpAnn (spanAsAnchor (comb3 $1 $2 $3)) (AnnList (Just$ glR $2) (ListBraces (epTok $1) (epTok $3)) [] []) cs, NoEpTok) (IPBinds noExtField (reverse $ unLoc $2)))) }
|
|
| 1953 | 1953 | |
| 1954 | 1954 | | vocurly dbinds close {% acs (gl $2) (\loc cs -> (L loc
|
| 1955 | - $ HsIPBinds (EpAnn (glR $1) (AnnList (Just $ glR $2) ListNone [] noAnn []) cs) (IPBinds noExtField (reverse $ unLoc $2)))) }
|
|
| 1955 | + $ HsIPBinds (EpAnn (glR $1) (AnnList (Just $ glR $2) ListNone [] []) cs, NoEpTok) (IPBinds noExtField (reverse $ unLoc $2)))) }
|
|
| 1956 | 1956 | |
| 1957 | 1957 | |
| 1958 | 1958 | wherebinds :: { Maybe (Located (HsLocalBinds GhcPs, Maybe EpAnnComments )) }
|
| ... | ... | @@ -3280,7 +3280,7 @@ aexp2 :: { ECP } |
| 3280 | 3280 | -- arrow notation extension
|
| 3281 | 3281 | | '(|' aexp cmdargs '|)' {% runPV (unECP $2) >>= \ $2 ->
|
| 3282 | 3282 | fmap ecpFromCmd $
|
| 3283 | - amsA' (sLL $1 $> $ HsCmdArrForm (AnnList (glRM $1) (ListBanana (epUniTok $1) (epUniTok $4)) [] noAnn []) $2 Prefix
|
|
| 3283 | + amsA' (sLL $1 $> $ HsCmdArrForm (AnnList (glRM $1) (ListBanana (epUniTok $1) (epUniTok $4)) [] []) $2 Prefix
|
|
| 3284 | 3284 | (reverse $3)) }
|
| 3285 | 3285 | |
| 3286 | 3286 | projection :: { Located (NonEmpty (LocatedAn NoEpAnns (DotFieldOcc GhcPs))) }
|
| ... | ... | @@ -3412,9 +3412,9 @@ tup_tail :: { forall b. DisambECP b => PV [Either (EpAnn Bool) (LocatedA b)] } |
| 3412 | 3412 | -- Never empty.
|
| 3413 | 3413 | list :: { forall b. DisambECP b => SrcSpan -> (EpaLocation, EpaLocation) -> PV (LocatedA b) }
|
| 3414 | 3414 | : texp { \loc (ao,ac) -> unECP $1 >>= \ $1 ->
|
| 3415 | - mkHsExplicitListPV loc [$1] (AnnList Nothing (ListSquare (EpTok ao) (EpTok ac)) [] noAnn []) }
|
|
| 3415 | + mkHsExplicitListPV loc [$1] (AnnList Nothing (ListSquare (EpTok ao) (EpTok ac)) [] []) }
|
|
| 3416 | 3416 | | lexps { \loc (ao,ac) -> $1 >>= \ $1 ->
|
| 3417 | - mkHsExplicitListPV loc (reverse $1) (AnnList Nothing (ListSquare (EpTok ao) (EpTok ac)) [] noAnn []) }
|
|
| 3417 | + mkHsExplicitListPV loc (reverse $1) (AnnList Nothing (ListSquare (EpTok ao) (EpTok ac)) [] []) }
|
|
| 3418 | 3418 | | texp '..' { \loc (ao,ac) -> unECP $1 >>= \ $1 ->
|
| 3419 | 3419 | amsA' (L loc $ ArithSeq (AnnArithSeq (EpTok ao) Nothing (epTok $2) (EpTok ac)) Nothing (From $1))
|
| 3420 | 3420 | >>= ecpFromExp' }
|
| ... | ... | @@ -3438,7 +3438,7 @@ list :: { forall b. DisambECP b => SrcSpan -> (EpaLocation, EpaLocation) -> PV ( |
| 3438 | 3438 | { \loc (ao,ac) ->
|
| 3439 | 3439 | checkMonadComp >>= \ ctxt ->
|
| 3440 | 3440 | unECP $1 >>= \ $1 -> do { t <- addTrailingVbarA $1 (epTok $2)
|
| 3441 | - ; amsA' (L loc $ mkHsCompAnns ctxt (unLoc $3) t (AnnList Nothing (ListSquare (EpTok ao) (EpTok ac)) [] noAnn []))
|
|
| 3441 | + ; amsA' (L loc $ mkHsCompAnns ctxt (unLoc $3) t (AnnList Nothing (ListSquare (EpTok ao) (EpTok ac)) [] [], noAnn))
|
|
| 3442 | 3442 | >>= ecpFromExp' } }
|
| 3443 | 3443 | |
| 3444 | 3444 | lexps :: { forall b. DisambECP b => PV [LocatedA b] }
|
| ... | ... | @@ -3541,14 +3541,14 @@ guardquals1 :: { Located [LStmt GhcPs (LHsExpr GhcPs)] } |
| 3541 | 3541 | -----------------------------------------------------------------------------
|
| 3542 | 3542 | -- Case alternatives
|
| 3543 | 3543 | |
| 3544 | -altslist(PATS) :: { forall b. DisambECP b => PV (LocatedA ([LMatch GhcPs (LocatedA b)], AnnList ())) }
|
|
| 3544 | +altslist(PATS) :: { forall b. DisambECP b => PV (LocatedA ([LMatch GhcPs (LocatedA b)], AnnList)) }
|
|
| 3545 | 3545 | : '{' alts(PATS) '}' { $2 >>= \ $2 -> amsA'
|
| 3546 | 3546 | (sLL $1 $> (reverse (snd $ unLoc $2),
|
| 3547 | - (AnnList (Just $ glR $2) (ListBraces (epTok $1) (epTok $3)) (fst $ unLoc $2) noAnn []))) }
|
|
| 3547 | + (AnnList (Just $ glR $2) (ListBraces (epTok $1) (epTok $3)) (fst $ unLoc $2) []))) }
|
|
| 3548 | 3548 | | vocurly alts(PATS) close { $2 >>= \ $2 -> amsA'
|
| 3549 | 3549 | (L (getLoc $2) (reverse (snd $ unLoc $2),
|
| 3550 | - (AnnList (Just $ glR $2) ListNone (fst $ unLoc $2) noAnn []))) }
|
|
| 3551 | - | '{' '}' { amsA' (sLL $1 $> ([], (AnnList Nothing (ListBraces (epTok $1) (epTok $2)) [] noAnn []))) }
|
|
| 3550 | + (AnnList (Just $ glR $2) ListNone (fst $ unLoc $2) []))) }
|
|
| 3551 | + | '{' '}' { amsA' (sLL $1 $> ([], (AnnList Nothing (ListBraces (epTok $1) (epTok $2)) [] []))) }
|
|
| 3552 | 3552 | | vocurly close { return $ noLocA ([], noAnn) }
|
| 3553 | 3553 | |
| 3554 | 3554 | alts(PATS) :: { forall b. DisambECP b => PV (Located ([EpToken ";"],[LMatch GhcPs (LocatedA b)])) }
|
| ... | ... | @@ -4723,9 +4723,9 @@ commentsPA la@(L l a) = do |
| 4723 | 4723 | !cs <- getPriorCommentsFor (getLocA la)
|
| 4724 | 4724 | return (L (addCommentsToEpAnn l cs) a)
|
| 4725 | 4725 | |
| 4726 | -hsDoAnn :: EpToken "rec" -> (EpToken "{", [EpToken ";"], EpToken "}") -> LocatedAn t b -> AnnList (EpToken "rec")
|
|
| 4726 | +hsDoAnn :: EpToken "rec" -> (EpToken "{", [EpToken ";"], EpToken "}") -> LocatedAn t b -> (AnnList, EpToken "rec")
|
|
| 4727 | 4727 | hsDoAnn rec (ob, semis, cb) (L ll _)
|
| 4728 | - = AnnList (Just $ spanAsAnchor (locA ll)) (ListBraces ob cb) semis rec []
|
|
| 4728 | + = (AnnList (Just $ spanAsAnchor (locA ll)) (ListBraces ob cb) semis [], rec)
|
|
| 4729 | 4729 | |
| 4730 | 4730 | listAsAnchorM :: [LocatedAn t a] -> Maybe EpaLocation
|
| 4731 | 4731 | listAsAnchorM [] = Nothing
|
| ... | ... | @@ -515,12 +515,11 @@ instance Outputable TrailingAnn where |
| 515 | 515 | -- keywords such as 'where'.
|
| 516 | 516 | |
| 517 | 517 | -- AZ: goal: only used when there is layout, so vertical alignment matters
|
| 518 | -data AnnList a
|
|
| 518 | +data AnnList
|
|
| 519 | 519 | = AnnList {
|
| 520 | 520 | al_anchor :: !(Maybe EpaLocation), -- ^ start point of a list having layout
|
| 521 | 521 | al_brackets :: !AnnListBrackets,
|
| 522 | 522 | al_semis :: [EpToken ";"], -- decls
|
| 523 | - al_rest :: !a,
|
|
| 524 | 523 | al_trailing :: ![TrailingAnn] -- ^ items appearing after the
|
| 525 | 524 | -- list, such as '=>' for a
|
| 526 | 525 | -- context
|
| ... | ... | @@ -666,7 +665,7 @@ data AnnPragSCC |
| 666 | 665 | -- | Helper function used in the parser to add a 'TrailingAnn' items
|
| 667 | 666 | -- to an existing annotation.
|
| 668 | 667 | addTrailingAnnToL :: TrailingAnn -> EpAnnComments
|
| 669 | - -> EpAnn (AnnList a) -> EpAnn (AnnList a)
|
|
| 668 | + -> EpAnn AnnList -> EpAnn AnnList
|
|
| 670 | 669 | addTrailingAnnToL t cs n = n { anns = addTrailing (anns n)
|
| 671 | 670 | , comments = comments n <> cs }
|
| 672 | 671 | where
|
| ... | ... | @@ -1037,8 +1036,8 @@ instance NoAnn NoEpAnns where |
| 1037 | 1036 | instance NoAnn AnnBooleanFormula where
|
| 1038 | 1037 | noAnn = AnnBooleanFormula noAnn noAnn []
|
| 1039 | 1038 | |
| 1040 | -instance NoAnn a => NoAnn (AnnList a) where
|
|
| 1041 | - noAnn = AnnList Nothing ListNone noAnn noAnn []
|
|
| 1039 | +instance NoAnn AnnList where
|
|
| 1040 | + noAnn = AnnList Nothing ListNone noAnn []
|
|
| 1042 | 1041 | |
| 1043 | 1042 | instance NoAnn NameAnn where
|
| 1044 | 1043 | noAnn = NameAnnTrailing []
|
| ... | ... | @@ -1131,9 +1130,9 @@ instance Outputable NameAnn where |
| 1131 | 1130 | ppr (NameAnnTrailing t)
|
| 1132 | 1131 | = text "NameAnnTrailing" <+> ppr t
|
| 1133 | 1132 | |
| 1134 | -instance (Outputable a) => Outputable (AnnList a) where
|
|
| 1135 | - ppr (AnnList anc p s a t)
|
|
| 1136 | - = text "AnnList" <+> ppr anc <+> ppr p <+> ppr s <+> ppr a <+> ppr t
|
|
| 1133 | +instance Outputable AnnList where
|
|
| 1134 | + ppr (AnnList anc p s t)
|
|
| 1135 | + = text "AnnList" <+> ppr anc <+> ppr p <+> ppr s <+> ppr t
|
|
| 1137 | 1136 | |
| 1138 | 1137 | instance Outputable AnnListBrackets where
|
| 1139 | 1138 | ppr (ListParens o c) = text "ListParens" <+> ppr o <+> ppr c
|
| ... | ... | @@ -437,7 +437,7 @@ mkRoleAnnotDecl loc tycon roles anns |
| 437 | 437 | |
| 438 | 438 | mkMDo :: (EpToken "{", [EpToken ";"], EpToken "}") -> HsDoFlavour -> LocatedA [ExprLStmt GhcPs] -> EpaLocation -> EpaLocation -> HsExpr GhcPs
|
| 439 | 439 | mkMDo (ob, semis, cb) ctxt stmts tok loc
|
| 440 | - = mkHsDoAnns ctxt stmts (AnnList (Just loc) (ListBraces ob cb) semis tok [])
|
|
| 440 | + = mkHsDoAnns ctxt stmts (AnnList (Just loc) (ListBraces ob cb) semis [], tok)
|
|
| 441 | 441 | |
| 442 | 442 | -- | Converts a list of 'LHsTyVarBndr's annotated with their 'Specificity' to
|
| 443 | 443 | -- binders without annotations. Only accepts specified variables, and errors if
|
| ... | ... | @@ -459,19 +459,19 @@ fromSpecTyVarBndr (L loc (HsTvb xtv flag idp k)) = do |
| 459 | 459 | -- | Add the annotation for a 'where' keyword to existing @HsLocalBinds@
|
| 460 | 460 | annBinds :: EpToken "where" -> EpAnnComments -> HsLocalBinds GhcPs
|
| 461 | 461 | -> (HsLocalBinds GhcPs, Maybe EpAnnComments)
|
| 462 | -annBinds w cs (HsValBinds an bs) = (HsValBinds (add_where w an cs) bs, Nothing)
|
|
| 463 | -annBinds w cs (HsIPBinds an bs) = (HsIPBinds (add_where w an cs) bs, Nothing)
|
|
| 462 | +annBinds w cs (HsValBinds an bs) = (HsValBinds (add_where w (fst an) cs) bs, Nothing)
|
|
| 463 | +annBinds w cs (HsIPBinds an bs) = (HsIPBinds (add_where w (fst an) cs) bs, Nothing)
|
|
| 464 | 464 | annBinds _ cs (EmptyLocalBinds x) = (EmptyLocalBinds x, Just cs)
|
| 465 | 465 | |
| 466 | -add_where :: EpToken "where" -> EpAnn (AnnList (EpToken "where")) -> EpAnnComments -> EpAnn (AnnList (EpToken "where"))
|
|
| 466 | +add_where :: EpToken "where" -> EpAnn AnnList -> EpAnnComments
|
|
| 467 | + -> (EpAnn AnnList, EpToken "where")
|
|
| 467 | 468 | add_where w@(EpTok (EpaSpan (RealSrcSpan rs _))) (EpAnn a al cs) cs2
|
| 468 | 469 | | valid_anchor a
|
| 469 | - = EpAnn (widenAnchorT a w) (al { al_rest = w}) (cs Semi.<> cs2)
|
|
| 470 | + = (EpAnn (widenAnchorT a w) al (cs Semi.<> cs2), w)
|
|
| 470 | 471 | | otherwise
|
| 471 | - = EpAnn (patch_anchor rs a)
|
|
| 472 | - (al { al_anchor = (fmap (patch_anchor rs) (al_anchor al))
|
|
| 473 | - , al_rest = w})
|
|
| 474 | - (cs Semi.<> cs2)
|
|
| 472 | + = (EpAnn (patch_anchor rs a)
|
|
| 473 | + (al { al_anchor = (fmap (patch_anchor rs) (al_anchor al))})
|
|
| 474 | + (cs Semi.<> cs2), w)
|
|
| 475 | 475 | add_where _ _ _ = panic "add_where"
|
| 476 | 476 | -- EpaDelta should only be used for transformations
|
| 477 | 477 | |
| ... | ... | @@ -728,7 +728,7 @@ tyConToDataCon (L loc tc) |
| 728 | 728 | occ = rdrNameOcc tc
|
| 729 | 729 | |
| 730 | 730 | mkPatSynMatchGroup :: LocatedN RdrName
|
| 731 | - -> LocatedA (OrdList (LHsDecl GhcPs), EpToken "where", AnnList ())
|
|
| 731 | + -> LocatedA (OrdList (LHsDecl GhcPs), EpToken "where", AnnList)
|
|
| 732 | 732 | -> P (MatchGroup GhcPs (LHsExpr GhcPs))
|
| 733 | 733 | mkPatSynMatchGroup (L loc patsyn_name) (L ld (decls, _, ann)) =
|
| 734 | 734 | do { matches <- mapM fromDecl (fromOL decls)
|
| ... | ... | @@ -1777,11 +1777,11 @@ class (b ~ (Body b) GhcPs, AnnoBody b) => DisambECP b where |
| 1777 | 1777 | -> PV (LocatedA b)
|
| 1778 | 1778 | -- | Disambiguate "case ... of ..."
|
| 1779 | 1779 | mkHsCasePV :: SrcSpan -> LHsExpr GhcPs
|
| 1780 | - -> LocatedA ([LMatch GhcPs (LocatedA b)], AnnList ())
|
|
| 1780 | + -> LocatedA ([LMatch GhcPs (LocatedA b)], AnnList)
|
|
| 1781 | 1781 | -> EpAnnHsCase -> PV (LocatedA b)
|
| 1782 | 1782 | -- | Disambiguate "\... -> ..." (lambda), "\case" and "\cases"
|
| 1783 | 1783 | mkHsLamPV :: SrcSpan -> HsLamVariant
|
| 1784 | - -> LocatedA ([LMatch GhcPs (LocatedA b)], AnnList ())
|
|
| 1784 | + -> LocatedA ([LMatch GhcPs (LocatedA b)], AnnList)
|
|
| 1785 | 1785 | -> EpAnnLam
|
| 1786 | 1786 | -> PV (LocatedA b)
|
| 1787 | 1787 | -- | Function argument representation
|
| ... | ... | @@ -1827,7 +1827,7 @@ class (b ~ (Body b) GhcPs, AnnoBody b) => DisambECP b where |
| 1827 | 1827 | mkHsTySigPV
|
| 1828 | 1828 | :: SrcSpanAnnA -> LocatedA b -> LHsType GhcPs -> TokDcolon -> PV (LocatedA b)
|
| 1829 | 1829 | -- | Disambiguate "[a,b,c]" (list syntax)
|
| 1830 | - mkHsExplicitListPV :: SrcSpan -> [LocatedA b] -> AnnList () -> PV (LocatedA b)
|
|
| 1830 | + mkHsExplicitListPV :: SrcSpan -> [LocatedA b] -> AnnList -> PV (LocatedA b)
|
|
| 1831 | 1831 | -- | Disambiguate "$(...)" and "[quasi|...|]" (TH splices)
|
| 1832 | 1832 | mkHsSplicePV :: Located (HsUntypedSplice GhcPs) -> PV (LocatedA b)
|
| 1833 | 1833 | -- | Disambiguate "f { a = b, ... }" syntax (record construction and record updates)
|
| ... | ... | @@ -1961,7 +1961,7 @@ instance DisambECP (HsCmd GhcPs) where |
| 1961 | 1961 | return $ L (EpAnn (spanAsAnchor l) noAnn cs) (mkHsCmdIf c a b anns)
|
| 1962 | 1962 | mkHsDoPV l (ob,semis,cb) Nothing stmts tok_loc anc = do
|
| 1963 | 1963 | !cs <- getCommentsFor l
|
| 1964 | - return $ L (EpAnn (spanAsAnchor l) noAnn cs) (HsCmdDo (AnnList (Just anc) (ListBraces ob cb) semis tok_loc []) stmts)
|
|
| 1964 | + return $ L (EpAnn (spanAsAnchor l) noAnn cs) (HsCmdDo (AnnList (Just anc) (ListBraces ob cb) semis [], tok_loc) stmts)
|
|
| 1965 | 1965 | mkHsDoPV l _ (Just m) _ _ _ = addFatalError $ mkPlainErrorMsgEnvelope l $ PsErrQualifiedDoInCmd m
|
| 1966 | 1966 | mkHsParPV l lpar c rpar = do
|
| 1967 | 1967 | !cs <- getCommentsFor l
|
| ... | ... | @@ -2060,7 +2060,7 @@ instance DisambECP (HsExpr GhcPs) where |
| 2060 | 2060 | return $ L (EpAnn (spanAsAnchor l) noAnn cs) (mkHsIf c a b anns)
|
| 2061 | 2061 | mkHsDoPV l (ob,semis,cb) mod stmts loc_tok anc = do
|
| 2062 | 2062 | !cs <- getCommentsFor l
|
| 2063 | - return $ L (EpAnn (spanAsAnchor l) noAnn cs) (HsDo (AnnList (Just anc) (ListBraces ob cb) semis loc_tok []) (DoExpr mod) stmts)
|
|
| 2063 | + return $ L (EpAnn (spanAsAnchor l) noAnn cs) (HsDo (AnnList (Just anc) (ListBraces ob cb) semis [], loc_tok) (DoExpr mod) stmts)
|
|
| 2064 | 2064 | mkHsParPV l lpar e rpar = do
|
| 2065 | 2065 | !cs <- getCommentsFor l
|
| 2066 | 2066 | return $ L (EpAnn (spanAsAnchor l) noAnn cs) (HsPar (lpar, rpar) e)
|
| ... | ... | @@ -15,7 +15,7 @@ X(FunArr) match = NoExtField |
| 15 | 15 | X(ExprWithTySig) match = EpUniToken "::" "\8759"
|
| 16 | 16 | X(UntypedSplice) match = NoExtField
|
| 17 | 17 | X(ExplicitList) mismatch
|
| 18 | - >>> AnnList ()
|
|
| 18 | + >>> AnnList
|
|
| 19 | 19 | <<< ((EpToken "'"),(EpToken "["),(EpToken "]"))
|
| 20 | 20 | X(ExplicitTuple) mismatch
|
| 21 | 21 | >>> AnnParen
|
| ... | ... | @@ -72,7 +72,6 @@ |
| 72 | 72 | (Nothing)
|
| 73 | 73 | (ListNone)
|
| 74 | 74 | []
|
| 75 | - (())
|
|
| 76 | 75 | []))
|
| 77 | 76 | (L
|
| 78 | 77 | (EpAnn
|
| ... | ... | @@ -84,7 +84,6 @@ |
| 84 | 84 | (Nothing)
|
| 85 | 85 | (ListNone)
|
| 86 | 86 | []
|
| 87 | - (())
|
|
| 88 | 87 | []))
|
| 89 | 88 | (L
|
| 90 | 89 | (EpAnn
|
| ... | ... | @@ -96,7 +96,6 @@ |
| 96 | 96 | (Nothing)
|
| 97 | 97 | (ListNone)
|
| 98 | 98 | []
|
| 99 | - (())
|
|
| 100 | 99 | []))
|
| 101 | 100 | (L
|
| 102 | 101 | (EpAnn
|
| ... | ... | @@ -2124,7 +2124,6 @@ |
| 2124 | 2124 | (Nothing)
|
| 2125 | 2125 | (ListNone)
|
| 2126 | 2126 | []
|
| 2127 | - (())
|
|
| 2128 | 2127 | []))
|
| 2129 | 2128 | (L
|
| 2130 | 2129 | (EpAnn
|
| ... | ... | @@ -92,7 +92,6 @@ |
| 92 | 92 | (Nothing)
|
| 93 | 93 | (ListNone)
|
| 94 | 94 | []
|
| 95 | - (())
|
|
| 96 | 95 | []))
|
| 97 | 96 | (L
|
| 98 | 97 | (EpAnn
|
| ... | ... | @@ -216,7 +215,6 @@ |
| 216 | 215 | (Nothing)
|
| 217 | 216 | (ListNone)
|
| 218 | 217 | []
|
| 219 | - (())
|
|
| 220 | 218 | []))
|
| 221 | 219 | (L
|
| 222 | 220 | (EpAnn
|
| ... | ... | @@ -289,15 +287,16 @@ |
| 289 | 287 | "-- normal comment")
|
| 290 | 288 | { DumpParsedAstComments.hs:14:7-8 }))]))
|
| 291 | 289 | (HsDo
|
| 292 | - (AnnList
|
|
| 293 | - (Just
|
|
| 294 | - (EpaSpan { DumpParsedAstComments.hs:16:3 }))
|
|
| 295 | - (ListBraces
|
|
| 296 | - (NoEpTok)
|
|
| 297 | - (NoEpTok))
|
|
| 298 | - []
|
|
| 299 | - (EpaSpan { DumpParsedAstComments.hs:14:7-8 })
|
|
| 300 | - [])
|
|
| 290 | + ((,)
|
|
| 291 | + (AnnList
|
|
| 292 | + (Just
|
|
| 293 | + (EpaSpan { DumpParsedAstComments.hs:16:3 }))
|
|
| 294 | + (ListBraces
|
|
| 295 | + (NoEpTok)
|
|
| 296 | + (NoEpTok))
|
|
| 297 | + []
|
|
| 298 | + [])
|
|
| 299 | + (EpaSpan { DumpParsedAstComments.hs:14:7-8 }))
|
|
| 301 | 300 | (DoExpr
|
| 302 | 301 | (Nothing))
|
| 303 | 302 | (L
|
| ... | ... | @@ -366,7 +365,6 @@ |
| 366 | 365 | (Nothing)
|
| 367 | 366 | (ListNone)
|
| 368 | 367 | []
|
| 369 | - (())
|
|
| 370 | 368 | []))
|
| 371 | 369 | (L
|
| 372 | 370 | (EpAnn
|
| ... | ... | @@ -33,7 +33,6 @@ |
| 33 | 33 | (Nothing)
|
| 34 | 34 | (ListNone)
|
| 35 | 35 | []
|
| 36 | - (())
|
|
| 37 | 36 | []))
|
| 38 | 37 | (L
|
| 39 | 38 | (EpAnn
|
| ... | ... | @@ -260,7 +260,6 @@ |
| 260 | 260 | (Nothing)
|
| 261 | 261 | (ListNone)
|
| 262 | 262 | []
|
| 263 | - (())
|
|
| 264 | 263 | []))
|
| 265 | 264 | (L
|
| 266 | 265 | (EpAnn
|
| ... | ... | @@ -327,15 +326,16 @@ |
| 327 | 326 | (EpaComments
|
| 328 | 327 | []))
|
| 329 | 328 | (HsDo
|
| 330 | - (AnnList
|
|
| 331 | - (Just
|
|
| 332 | - (EpaSpan { DumpSemis.hs:(11,3)-(12,3) }))
|
|
| 333 | - (ListBraces
|
|
| 334 | - (NoEpTok)
|
|
| 335 | - (NoEpTok))
|
|
| 336 | - []
|
|
| 337 | - (EpaSpan { DumpSemis.hs:10:7-8 })
|
|
| 338 | - [])
|
|
| 329 | + ((,)
|
|
| 330 | + (AnnList
|
|
| 331 | + (Just
|
|
| 332 | + (EpaSpan { DumpSemis.hs:(11,3)-(12,3) }))
|
|
| 333 | + (ListBraces
|
|
| 334 | + (NoEpTok)
|
|
| 335 | + (NoEpTok))
|
|
| 336 | + []
|
|
| 337 | + [])
|
|
| 338 | + (EpaSpan { DumpSemis.hs:10:7-8 }))
|
|
| 339 | 339 | (DoExpr
|
| 340 | 340 | (Nothing))
|
| 341 | 341 | (L
|
| ... | ... | @@ -359,22 +359,23 @@ |
| 359 | 359 | (EpaComments
|
| 360 | 360 | []))
|
| 361 | 361 | (HsDo
|
| 362 | - (AnnList
|
|
| 363 | - (Just
|
|
| 364 | - (EpaSpan { DumpSemis.hs:11:6-15 }))
|
|
| 365 | - (ListBraces
|
|
| 366 | - (EpTok (EpaSpan { DumpSemis.hs:11:6 }))
|
|
| 367 | - (EpTok (EpaSpan { DumpSemis.hs:11:15 })))
|
|
| 368 | - [(EpTok
|
|
| 369 | - (EpaSpan { DumpSemis.hs:11:8 }))
|
|
| 370 | - ,(EpTok
|
|
| 371 | - (EpaSpan { DumpSemis.hs:11:9 }))
|
|
| 372 | - ,(EpTok
|
|
| 373 | - (EpaSpan { DumpSemis.hs:11:10 }))
|
|
| 374 | - ,(EpTok
|
|
| 375 | - (EpaSpan { DumpSemis.hs:11:11 }))]
|
|
| 376 | - (EpaSpan { DumpSemis.hs:11:3-4 })
|
|
| 377 | - [])
|
|
| 362 | + ((,)
|
|
| 363 | + (AnnList
|
|
| 364 | + (Just
|
|
| 365 | + (EpaSpan { DumpSemis.hs:11:6-15 }))
|
|
| 366 | + (ListBraces
|
|
| 367 | + (EpTok (EpaSpan { DumpSemis.hs:11:6 }))
|
|
| 368 | + (EpTok (EpaSpan { DumpSemis.hs:11:15 })))
|
|
| 369 | + [(EpTok
|
|
| 370 | + (EpaSpan { DumpSemis.hs:11:8 }))
|
|
| 371 | + ,(EpTok
|
|
| 372 | + (EpaSpan { DumpSemis.hs:11:9 }))
|
|
| 373 | + ,(EpTok
|
|
| 374 | + (EpaSpan { DumpSemis.hs:11:10 }))
|
|
| 375 | + ,(EpTok
|
|
| 376 | + (EpaSpan { DumpSemis.hs:11:11 }))]
|
|
| 377 | + [])
|
|
| 378 | + (EpaSpan { DumpSemis.hs:11:3-4 }))
|
|
| 378 | 379 | (DoExpr
|
| 379 | 380 | (Nothing))
|
| 380 | 381 | (L
|
| ... | ... | @@ -554,7 +555,6 @@ |
| 554 | 555 | (Nothing)
|
| 555 | 556 | (ListNone)
|
| 556 | 557 | []
|
| 557 | - (())
|
|
| 558 | 558 | []))
|
| 559 | 559 | (L
|
| 560 | 560 | (EpAnn
|
| ... | ... | @@ -621,18 +621,19 @@ |
| 621 | 621 | (EpaComments
|
| 622 | 622 | []))
|
| 623 | 623 | (HsDo
|
| 624 | - (AnnList
|
|
| 625 | - (Just
|
|
| 626 | - (EpaSpan { DumpSemis.hs:(16,3)-(19,3) }))
|
|
| 627 | - (ListBraces
|
|
| 628 | - (EpTok (EpaSpan { DumpSemis.hs:16:3 }))
|
|
| 629 | - (EpTok (EpaSpan { DumpSemis.hs:19:3 })))
|
|
| 630 | - [(EpTok
|
|
| 631 | - (EpaSpan { DumpSemis.hs:16:5 }))
|
|
| 632 | - ,(EpTok
|
|
| 633 | - (EpaSpan { DumpSemis.hs:16:8 }))]
|
|
| 634 | - (EpaSpan { DumpSemis.hs:15:7-8 })
|
|
| 635 | - [])
|
|
| 624 | + ((,)
|
|
| 625 | + (AnnList
|
|
| 626 | + (Just
|
|
| 627 | + (EpaSpan { DumpSemis.hs:(16,3)-(19,3) }))
|
|
| 628 | + (ListBraces
|
|
| 629 | + (EpTok (EpaSpan { DumpSemis.hs:16:3 }))
|
|
| 630 | + (EpTok (EpaSpan { DumpSemis.hs:19:3 })))
|
|
| 631 | + [(EpTok
|
|
| 632 | + (EpaSpan { DumpSemis.hs:16:5 }))
|
|
| 633 | + ,(EpTok
|
|
| 634 | + (EpaSpan { DumpSemis.hs:16:8 }))]
|
|
| 635 | + [])
|
|
| 636 | + (EpaSpan { DumpSemis.hs:15:7-8 }))
|
|
| 636 | 637 | (DoExpr
|
| 637 | 638 | (Nothing))
|
| 638 | 639 | (L
|
| ... | ... | @@ -806,7 +807,6 @@ |
| 806 | 807 | (Nothing)
|
| 807 | 808 | (ListNone)
|
| 808 | 809 | []
|
| 809 | - (())
|
|
| 810 | 810 | []))
|
| 811 | 811 | (L
|
| 812 | 812 | (EpAnn
|
| ... | ... | @@ -873,18 +873,19 @@ |
| 873 | 873 | (EpaComments
|
| 874 | 874 | []))
|
| 875 | 875 | (HsDo
|
| 876 | - (AnnList
|
|
| 877 | - (Just
|
|
| 878 | - (EpaSpan { DumpSemis.hs:22:10-30 }))
|
|
| 879 | - (ListBraces
|
|
| 880 | - (EpTok (EpaSpan { DumpSemis.hs:22:10 }))
|
|
| 881 | - (EpTok (EpaSpan { DumpSemis.hs:22:30 })))
|
|
| 882 | - [(EpTok
|
|
| 883 | - (EpaSpan { DumpSemis.hs:22:12 }))
|
|
| 884 | - ,(EpTok
|
|
| 885 | - (EpaSpan { DumpSemis.hs:22:13 }))]
|
|
| 886 | - (EpaSpan { DumpSemis.hs:22:7-8 })
|
|
| 887 | - [])
|
|
| 876 | + ((,)
|
|
| 877 | + (AnnList
|
|
| 878 | + (Just
|
|
| 879 | + (EpaSpan { DumpSemis.hs:22:10-30 }))
|
|
| 880 | + (ListBraces
|
|
| 881 | + (EpTok (EpaSpan { DumpSemis.hs:22:10 }))
|
|
| 882 | + (EpTok (EpaSpan { DumpSemis.hs:22:30 })))
|
|
| 883 | + [(EpTok
|
|
| 884 | + (EpaSpan { DumpSemis.hs:22:12 }))
|
|
| 885 | + ,(EpTok
|
|
| 886 | + (EpaSpan { DumpSemis.hs:22:13 }))]
|
|
| 887 | + [])
|
|
| 888 | + (EpaSpan { DumpSemis.hs:22:7-8 }))
|
|
| 888 | 889 | (DoExpr
|
| 889 | 890 | (Nothing))
|
| 890 | 891 | (L
|
| ... | ... | @@ -1015,7 +1016,6 @@ |
| 1015 | 1016 | (Nothing)
|
| 1016 | 1017 | (ListNone)
|
| 1017 | 1018 | []
|
| 1018 | - (())
|
|
| 1019 | 1019 | []))
|
| 1020 | 1020 | (L
|
| 1021 | 1021 | (EpAnn
|
| ... | ... | @@ -1121,7 +1121,6 @@ |
| 1121 | 1121 | (Nothing)
|
| 1122 | 1122 | (ListNone)
|
| 1123 | 1123 | []
|
| 1124 | - (())
|
|
| 1125 | 1124 | []))
|
| 1126 | 1125 | (L
|
| 1127 | 1126 | (EpAnn
|
| ... | ... | @@ -1229,7 +1228,6 @@ |
| 1229 | 1228 | (Nothing)
|
| 1230 | 1229 | (ListNone)
|
| 1231 | 1230 | []
|
| 1232 | - (())
|
|
| 1233 | 1231 | []))
|
| 1234 | 1232 | (L
|
| 1235 | 1233 | (EpAnn
|
| ... | ... | @@ -1721,7 +1719,6 @@ |
| 1721 | 1719 | (Nothing)
|
| 1722 | 1720 | (ListNone)
|
| 1723 | 1721 | []
|
| 1724 | - (())
|
|
| 1725 | 1722 | []))
|
| 1726 | 1723 | (L
|
| 1727 | 1724 | (EpAnn
|
| ... | ... | @@ -1848,7 +1845,6 @@ |
| 1848 | 1845 | (Nothing)
|
| 1849 | 1846 | (ListNone)
|
| 1850 | 1847 | []
|
| 1851 | - (())
|
|
| 1852 | 1848 | []))
|
| 1853 | 1849 | (L
|
| 1854 | 1850 | (EpAnn
|
| ... | ... | @@ -1921,28 +1917,29 @@ |
| 1921 | 1917 | (EpTok
|
| 1922 | 1918 | (EpaSpan { DumpSemis.hs:34:32-33 })))
|
| 1923 | 1919 | (HsValBinds
|
| 1924 | - (EpAnn
|
|
| 1925 | - (EpaSpan { DumpSemis.hs:34:13-31 })
|
|
| 1926 | - (AnnList
|
|
| 1927 | - (Just
|
|
| 1928 | - (EpaSpan { DumpSemis.hs:34:18-30 }))
|
|
| 1929 | - (ListBraces
|
|
| 1930 | - (EpTok (EpaSpan { DumpSemis.hs:34:13 }))
|
|
| 1931 | - (EpTok (EpaSpan { DumpSemis.hs:34:31 })))
|
|
| 1932 | - [(EpTok
|
|
| 1933 | - (EpaSpan { DumpSemis.hs:34:14 }))
|
|
| 1934 | - ,(EpTok
|
|
| 1935 | - (EpaSpan { DumpSemis.hs:34:15 }))
|
|
| 1936 | - ,(EpTok
|
|
| 1937 | - (EpaSpan { DumpSemis.hs:34:16 }))
|
|
| 1938 | - ,(EpTok
|
|
| 1939 | - (EpaSpan { DumpSemis.hs:34:17 }))
|
|
| 1940 | - ,(EpTok
|
|
| 1941 | - (EpaSpan { DumpSemis.hs:34:18 }))]
|
|
| 1942 | - (NoEpTok)
|
|
| 1943 | - [])
|
|
| 1944 | - (EpaComments
|
|
| 1945 | - []))
|
|
| 1920 | + ((,)
|
|
| 1921 | + (EpAnn
|
|
| 1922 | + (EpaSpan { DumpSemis.hs:34:13-31 })
|
|
| 1923 | + (AnnList
|
|
| 1924 | + (Just
|
|
| 1925 | + (EpaSpan { DumpSemis.hs:34:18-30 }))
|
|
| 1926 | + (ListBraces
|
|
| 1927 | + (EpTok (EpaSpan { DumpSemis.hs:34:13 }))
|
|
| 1928 | + (EpTok (EpaSpan { DumpSemis.hs:34:31 })))
|
|
| 1929 | + [(EpTok
|
|
| 1930 | + (EpaSpan { DumpSemis.hs:34:14 }))
|
|
| 1931 | + ,(EpTok
|
|
| 1932 | + (EpaSpan { DumpSemis.hs:34:15 }))
|
|
| 1933 | + ,(EpTok
|
|
| 1934 | + (EpaSpan { DumpSemis.hs:34:16 }))
|
|
| 1935 | + ,(EpTok
|
|
| 1936 | + (EpaSpan { DumpSemis.hs:34:17 }))
|
|
| 1937 | + ,(EpTok
|
|
| 1938 | + (EpaSpan { DumpSemis.hs:34:18 }))]
|
|
| 1939 | + [])
|
|
| 1940 | + (EpaComments
|
|
| 1941 | + []))
|
|
| 1942 | + (NoEpTok))
|
|
| 1946 | 1943 | (ValBinds
|
| 1947 | 1944 | (NoExtField)
|
| 1948 | 1945 | [(VbBind
|
| ... | ... | @@ -1975,7 +1972,6 @@ |
| 1975 | 1972 | (Nothing)
|
| 1976 | 1973 | (ListNone)
|
| 1977 | 1974 | []
|
| 1978 | - (())
|
|
| 1979 | 1975 | []))
|
| 1980 | 1976 | (L
|
| 1981 | 1977 | (EpAnn
|
| ... | ... | @@ -2089,7 +2085,6 @@ |
| 2089 | 2085 | (Nothing)
|
| 2090 | 2086 | (ListNone)
|
| 2091 | 2087 | []
|
| 2092 | - (())
|
|
| 2093 | 2088 | []))
|
| 2094 | 2089 | (L
|
| 2095 | 2090 | (EpAnn
|
| ... | ... | @@ -2215,7 +2210,6 @@ |
| 2215 | 2210 | (Nothing)
|
| 2216 | 2211 | (ListNone)
|
| 2217 | 2212 | []
|
| 2218 | - (())
|
|
| 2219 | 2213 | []))
|
| 2220 | 2214 | (L
|
| 2221 | 2215 | (EpAnn
|
| ... | ... | @@ -2335,7 +2329,6 @@ |
| 2335 | 2329 | (EpaSpan { DumpSemis.hs:38:7 }))
|
| 2336 | 2330 | ,(EpTok
|
| 2337 | 2331 | (EpaSpan { DumpSemis.hs:38:8 }))]
|
| 2338 | - (())
|
|
| 2339 | 2332 | []))
|
| 2340 | 2333 | (L
|
| 2341 | 2334 | (EpAnn
|
| ... | ... | @@ -965,7 +965,6 @@ |
| 965 | 965 | (Nothing)
|
| 966 | 966 | (ListNone)
|
| 967 | 967 | []
|
| 968 | - (())
|
|
| 969 | 968 | []))
|
| 970 | 969 | (L
|
| 971 | 970 | (EpAnn
|
| ... | ... | @@ -1665,7 +1664,6 @@ |
| 1665 | 1664 | (Nothing)
|
| 1666 | 1665 | (ListNone)
|
| 1667 | 1666 | []
|
| 1668 | - (())
|
|
| 1669 | 1667 | []))
|
| 1670 | 1668 | (L
|
| 1671 | 1669 | (EpAnn
|
| ... | ... | @@ -34,8 +34,7 @@ |
| 34 | 34 | (L
|
| 35 | 35 | (EpAnn
|
| 36 | 36 | (EpaSpan { T15279.hs:3:8-13 })
|
| 37 | - (AnnListItem
|
|
| 38 | - [])
|
|
| 37 | + []
|
|
| 39 | 38 | (EpaComments
|
| 40 | 39 | []))
|
| 41 | 40 | {ModuleName: T15279}))
|
| ... | ... | @@ -44,8 +43,7 @@ |
| 44 | 43 | [(L
|
| 45 | 44 | (EpAnn
|
| 46 | 45 | (EpaSpan { T15279.hs:5:1-19 })
|
| 47 | - (AnnListItem
|
|
| 48 | - [])
|
|
| 46 | + []
|
|
| 49 | 47 | (EpaComments
|
| 50 | 48 | []))
|
| 51 | 49 | (SigD
|
| ... | ... | @@ -72,8 +70,7 @@ |
| 72 | 70 | (L
|
| 73 | 71 | (EpAnn
|
| 74 | 72 | (EpaSpan { T15279.hs:5:8-19 })
|
| 75 | - (AnnListItem
|
|
| 76 | - [])
|
|
| 73 | + []
|
|
| 77 | 74 | (EpaComments
|
| 78 | 75 | []))
|
| 79 | 76 | (HsSig
|
| ... | ... | @@ -83,8 +80,7 @@ |
| 83 | 80 | (L
|
| 84 | 81 | (EpAnn
|
| 85 | 82 | (EpaSpan { T15279.hs:5:8-19 })
|
| 86 | - (AnnListItem
|
|
| 87 | - [])
|
|
| 83 | + []
|
|
| 88 | 84 | (EpaComments
|
| 89 | 85 | []))
|
| 90 | 86 | (HsFunTy
|
| ... | ... | @@ -100,8 +96,7 @@ |
| 100 | 96 | (L
|
| 101 | 97 | (EpAnn
|
| 102 | 98 | (EpaSpan { T15279.hs:5:8-11 })
|
| 103 | - (AnnListItem
|
|
| 104 | - [])
|
|
| 99 | + []
|
|
| 105 | 100 | (EpaComments
|
| 106 | 101 | []))
|
| 107 | 102 | (HsTyVar
|
| ... | ... | @@ -119,8 +114,7 @@ |
| 119 | 114 | (L
|
| 120 | 115 | (EpAnn
|
| 121 | 116 | (EpaSpan { T15279.hs:5:16-19 })
|
| 122 | - (AnnListItem
|
|
| 123 | - [])
|
|
| 117 | + []
|
|
| 124 | 118 | (EpaComments
|
| 125 | 119 | []))
|
| 126 | 120 | (HsTyVar
|
| ... | ... | @@ -138,8 +132,7 @@ |
| 138 | 132 | ,(L
|
| 139 | 133 | (EpAnn
|
| 140 | 134 | (EpaSpan { <combineSrcSpans: files differ> })
|
| 141 | - (AnnListItem
|
|
| 142 | - [])
|
|
| 135 | + []
|
|
| 143 | 136 | (EpaComments
|
| 144 | 137 | []))
|
| 145 | 138 | (ValD
|
| ... | ... | @@ -162,20 +155,17 @@ |
| 162 | 155 | (Nothing)
|
| 163 | 156 | (ListNone)
|
| 164 | 157 | []
|
| 165 | - (NoEpTok)
|
|
| 166 | 158 | []))
|
| 167 | 159 | (L
|
| 168 | 160 | (EpAnn
|
| 169 | 161 | (EpaSpan { <combineSrcSpans: files differ> })
|
| 170 | - (AnnListItem
|
|
| 171 | - [])
|
|
| 162 | + []
|
|
| 172 | 163 | (EpaComments
|
| 173 | 164 | []))
|
| 174 | 165 | [(L
|
| 175 | 166 | (EpAnn
|
| 176 | 167 | (EpaSpan { T15279.hs-incl:1:1-13 })
|
| 177 | - (AnnListItem
|
|
| 178 | - [])
|
|
| 168 | + []
|
|
| 179 | 169 | (EpaComments
|
| 180 | 170 | []))
|
| 181 | 171 | (Match
|
| ... | ... | @@ -197,12 +187,15 @@ |
| 197 | 187 | []
|
| 198 | 188 | []))
|
| 199 | 189 | (L
|
| 200 | - (EpaSpan { T15279.hs-incl:1:5-7 })
|
|
| 190 | + (EpAnn
|
|
| 191 | + (EpaSpan { T15279.hs-incl:1:5-7 })
|
|
| 192 | + []
|
|
| 193 | + (EpaComments
|
|
| 194 | + []))
|
|
| 201 | 195 | [(L
|
| 202 | 196 | (EpAnn
|
| 203 | 197 | (EpaSpan { T15279.hs-incl:1:5-7 })
|
| 204 | - (AnnListItem
|
|
| 205 | - [])
|
|
| 198 | + []
|
|
| 206 | 199 | (EpaComments
|
| 207 | 200 | []))
|
| 208 | 201 | (LitPat
|
| ... | ... | @@ -234,8 +227,7 @@ |
| 234 | 227 | (L
|
| 235 | 228 | (EpAnn
|
| 236 | 229 | (EpaSpan { T15279.hs-incl:1:11-13 })
|
| 237 | - (AnnListItem
|
|
| 238 | - [])
|
|
| 230 | + []
|
|
| 239 | 231 | (EpaComments
|
| 240 | 232 | []))
|
| 241 | 233 | (HsLit
|
| ... | ... | @@ -249,8 +241,7 @@ |
| 249 | 241 | ,(L
|
| 250 | 242 | (EpAnn
|
| 251 | 243 | (EpaSpan { T15279.hs-incl:2:1-13 })
|
| 252 | - (AnnListItem
|
|
| 253 | - [])
|
|
| 244 | + []
|
|
| 254 | 245 | (EpaComments
|
| 255 | 246 | []))
|
| 256 | 247 | (Match
|
| ... | ... | @@ -272,12 +263,15 @@ |
| 272 | 263 | []
|
| 273 | 264 | []))
|
| 274 | 265 | (L
|
| 275 | - (EpaSpan { T15279.hs-incl:2:5-7 })
|
|
| 266 | + (EpAnn
|
|
| 267 | + (EpaSpan { T15279.hs-incl:2:5-7 })
|
|
| 268 | + []
|
|
| 269 | + (EpaComments
|
|
| 270 | + []))
|
|
| 276 | 271 | [(L
|
| 277 | 272 | (EpAnn
|
| 278 | 273 | (EpaSpan { T15279.hs-incl:2:5-7 })
|
| 279 | - (AnnListItem
|
|
| 280 | - [])
|
|
| 274 | + []
|
|
| 281 | 275 | (EpaComments
|
| 282 | 276 | []))
|
| 283 | 277 | (LitPat
|
| ... | ... | @@ -309,8 +303,7 @@ |
| 309 | 303 | (L
|
| 310 | 304 | (EpAnn
|
| 311 | 305 | (EpaSpan { T15279.hs-incl:2:11-13 })
|
| 312 | - (AnnListItem
|
|
| 313 | - [])
|
|
| 306 | + []
|
|
| 314 | 307 | (EpaComments
|
| 315 | 308 | []))
|
| 316 | 309 | (HsLit
|
| ... | ... | @@ -324,8 +317,7 @@ |
| 324 | 317 | ,(L
|
| 325 | 318 | (EpAnn
|
| 326 | 319 | (EpaSpan { T15279.hs:7:1-11 })
|
| 327 | - (AnnListItem
|
|
| 328 | - [])
|
|
| 320 | + []
|
|
| 329 | 321 | (EpaComments
|
| 330 | 322 | []))
|
| 331 | 323 | (Match
|
| ... | ... | @@ -347,12 +339,15 @@ |
| 347 | 339 | []
|
| 348 | 340 | []))
|
| 349 | 341 | (L
|
| 350 | - (EpaSpan { T15279.hs:7:5 })
|
|
| 342 | + (EpAnn
|
|
| 343 | + (EpaSpan { T15279.hs:7:5 })
|
|
| 344 | + []
|
|
| 345 | + (EpaComments
|
|
| 346 | + []))
|
|
| 351 | 347 | [(L
|
| 352 | 348 | (EpAnn
|
| 353 | 349 | (EpaSpan { T15279.hs:7:5 })
|
| 354 | - (AnnListItem
|
|
| 355 | - [])
|
|
| 350 | + []
|
|
| 356 | 351 | (EpaComments
|
| 357 | 352 | []))
|
| 358 | 353 | (WildPat
|
| ... | ... | @@ -381,8 +376,7 @@ |
| 381 | 376 | (L
|
| 382 | 377 | (EpAnn
|
| 383 | 378 | (EpaSpan { T15279.hs:7:9-11 })
|
| 384 | - (AnnListItem
|
|
| 385 | - [])
|
|
| 379 | + []
|
|
| 386 | 380 | (EpaComments
|
| 387 | 381 | []))
|
| 388 | 382 | (HsLit
|
| ... | ... | @@ -106,7 +106,6 @@ |
| 106 | 106 | (Nothing)
|
| 107 | 107 | (ListNone)
|
| 108 | 108 | []
|
| 109 | - (())
|
|
| 110 | 109 | []))
|
| 111 | 110 | (L
|
| 112 | 111 | (EpAnn
|
| ... | ... | @@ -96,7 +96,6 @@ |
| 96 | 96 | (Nothing)
|
| 97 | 97 | (ListNone)
|
| 98 | 98 | []
|
| 99 | - (())
|
|
| 100 | 99 | []))
|
| 101 | 100 | (L
|
| 102 | 101 | (EpAnn
|
| ... | ... | @@ -72,7 +72,6 @@ |
| 72 | 72 | (Nothing)
|
| 73 | 73 | (ListNone)
|
| 74 | 74 | []
|
| 75 | - (())
|
|
| 76 | 75 | []))
|
| 77 | 76 | (L
|
| 78 | 77 | (EpAnn
|
| ... | ... | @@ -157,18 +156,19 @@ |
| 157 | 156 | {OccName: x}))))))
|
| 158 | 157 | [])
|
| 159 | 158 | (HsValBinds
|
| 160 | - (EpAnn
|
|
| 161 | - (EpaSpan { <no location info> })
|
|
| 162 | - (AnnList
|
|
| 163 | - (Just
|
|
| 164 | - (EpaSpan { Test20297.hs:7:3-7 }))
|
|
| 165 | - (ListNone)
|
|
| 166 | - []
|
|
| 167 | - (EpTok
|
|
| 168 | - (EpaSpan { Test20297.hs:7:3-7 }))
|
|
| 169 | - [])
|
|
| 170 | - (EpaComments
|
|
| 171 | - []))
|
|
| 159 | + ((,)
|
|
| 160 | + (EpAnn
|
|
| 161 | + (EpaSpan { <no location info> })
|
|
| 162 | + (AnnList
|
|
| 163 | + (Just
|
|
| 164 | + (EpaSpan { Test20297.hs:7:3-7 }))
|
|
| 165 | + (ListNone)
|
|
| 166 | + []
|
|
| 167 | + [])
|
|
| 168 | + (EpaComments
|
|
| 169 | + []))
|
|
| 170 | + (EpTok
|
|
| 171 | + (EpaSpan { Test20297.hs:7:3-7 })))
|
|
| 172 | 172 | (ValBinds
|
| 173 | 173 | (NoExtField)
|
| 174 | 174 | [])))))])))))
|
| ... | ... | @@ -204,7 +204,6 @@ |
| 204 | 204 | (Nothing)
|
| 205 | 205 | (ListNone)
|
| 206 | 206 | []
|
| 207 | - (())
|
|
| 208 | 207 | []))
|
| 209 | 208 | (L
|
| 210 | 209 | (EpAnn
|
| ... | ... | @@ -283,24 +282,25 @@ |
| 283 | 282 | {OccName: x}))))))
|
| 284 | 283 | [])
|
| 285 | 284 | (HsValBinds
|
| 286 | - (EpAnn
|
|
| 287 | - (EpaSpan { Test20297.hs:(10,3)-(11,26) })
|
|
| 288 | - (AnnList
|
|
| 289 | - (Just
|
|
| 290 | - (EpaSpan { Test20297.hs:11:9-26 }))
|
|
| 291 | - (ListNone)
|
|
| 292 | - []
|
|
| 293 | - (EpTok
|
|
| 294 | - (EpaSpan { Test20297.hs:10:3-7 }))
|
|
| 295 | - [])
|
|
| 296 | - (EpaComments
|
|
| 297 | - [(L
|
|
| 298 | - (EpaSpan
|
|
| 299 | - { Test20297.hs:10:9-19 })
|
|
| 300 | - (EpaComment
|
|
| 301 | - (EpaLineComment
|
|
| 302 | - "-- comment2")
|
|
| 303 | - { Test20297.hs:10:3-7 }))]))
|
|
| 285 | + ((,)
|
|
| 286 | + (EpAnn
|
|
| 287 | + (EpaSpan { Test20297.hs:(10,3)-(11,26) })
|
|
| 288 | + (AnnList
|
|
| 289 | + (Just
|
|
| 290 | + (EpaSpan { Test20297.hs:11:9-26 }))
|
|
| 291 | + (ListNone)
|
|
| 292 | + []
|
|
| 293 | + [])
|
|
| 294 | + (EpaComments
|
|
| 295 | + [(L
|
|
| 296 | + (EpaSpan
|
|
| 297 | + { Test20297.hs:10:9-19 })
|
|
| 298 | + (EpaComment
|
|
| 299 | + (EpaLineComment
|
|
| 300 | + "-- comment2")
|
|
| 301 | + { Test20297.hs:10:3-7 }))]))
|
|
| 302 | + (EpTok
|
|
| 303 | + (EpaSpan { Test20297.hs:10:3-7 })))
|
|
| 304 | 304 | (ValBinds
|
| 305 | 305 | (NoExtField)
|
| 306 | 306 | [(VbBind
|
| ... | ... | @@ -328,7 +328,6 @@ |
| 328 | 328 | (Nothing)
|
| 329 | 329 | (ListNone)
|
| 330 | 330 | []
|
| 331 | - (())
|
|
| 332 | 331 | []))
|
| 333 | 332 | (L
|
| 334 | 333 | (EpAnn
|
| ... | ... | @@ -395,15 +394,16 @@ |
| 395 | 394 | (EpaComments
|
| 396 | 395 | []))
|
| 397 | 396 | (HsDo
|
| 398 | - (AnnList
|
|
| 399 | - (Just
|
|
| 400 | - (EpaSpan { Test20297.hs:11:22-26 }))
|
|
| 401 | - (ListBraces
|
|
| 402 | - (NoEpTok)
|
|
| 403 | - (NoEpTok))
|
|
| 404 | - []
|
|
| 405 | - (EpaSpan { Test20297.hs:11:19-20 })
|
|
| 406 | - [])
|
|
| 397 | + ((,)
|
|
| 398 | + (AnnList
|
|
| 399 | + (Just
|
|
| 400 | + (EpaSpan { Test20297.hs:11:22-26 }))
|
|
| 401 | + (ListBraces
|
|
| 402 | + (NoEpTok)
|
|
| 403 | + (NoEpTok))
|
|
| 404 | + []
|
|
| 405 | + [])
|
|
| 406 | + (EpaSpan { Test20297.hs:11:19-20 }))
|
|
| 407 | 407 | (DoExpr
|
| 408 | 408 | (Nothing))
|
| 409 | 409 | (L
|
| ... | ... | @@ -518,7 +518,6 @@ |
| 518 | 518 | (Nothing)
|
| 519 | 519 | (ListNone)
|
| 520 | 520 | []
|
| 521 | - (())
|
|
| 522 | 521 | []))
|
| 523 | 522 | (L
|
| 524 | 523 | (EpAnn
|
| ... | ... | @@ -597,18 +596,19 @@ |
| 597 | 596 | {OccName: x}))))))
|
| 598 | 597 | [])
|
| 599 | 598 | (HsValBinds
|
| 600 | - (EpAnn
|
|
| 601 | - (EpaSpan { <no location info> })
|
|
| 602 | - (AnnList
|
|
| 603 | - (Just
|
|
| 604 | - (EpaSpan { Test20297.ppr.hs:5:3-7 }))
|
|
| 605 | - (ListNone)
|
|
| 606 | - []
|
|
| 607 | - (EpTok
|
|
| 608 | - (EpaSpan { Test20297.ppr.hs:5:3-7 }))
|
|
| 609 | - [])
|
|
| 610 | - (EpaComments
|
|
| 611 | - []))
|
|
| 599 | + ((,)
|
|
| 600 | + (EpAnn
|
|
| 601 | + (EpaSpan { <no location info> })
|
|
| 602 | + (AnnList
|
|
| 603 | + (Just
|
|
| 604 | + (EpaSpan { Test20297.ppr.hs:5:3-7 }))
|
|
| 605 | + (ListNone)
|
|
| 606 | + []
|
|
| 607 | + [])
|
|
| 608 | + (EpaComments
|
|
| 609 | + []))
|
|
| 610 | + (EpTok
|
|
| 611 | + (EpaSpan { Test20297.ppr.hs:5:3-7 })))
|
|
| 612 | 612 | (ValBinds
|
| 613 | 613 | (NoExtField)
|
| 614 | 614 | [])))))])))))
|
| ... | ... | @@ -638,7 +638,6 @@ |
| 638 | 638 | (Nothing)
|
| 639 | 639 | (ListNone)
|
| 640 | 640 | []
|
| 641 | - (())
|
|
| 642 | 641 | []))
|
| 643 | 642 | (L
|
| 644 | 643 | (EpAnn
|
| ... | ... | @@ -717,18 +716,19 @@ |
| 717 | 716 | {OccName: x}))))))
|
| 718 | 717 | [])
|
| 719 | 718 | (HsValBinds
|
| 720 | - (EpAnn
|
|
| 721 | - (EpaSpan { Test20297.ppr.hs:(8,3)-(9,24) })
|
|
| 722 | - (AnnList
|
|
| 723 | - (Just
|
|
| 724 | - (EpaSpan { Test20297.ppr.hs:9:7-24 }))
|
|
| 725 | - (ListNone)
|
|
| 726 | - []
|
|
| 727 | - (EpTok
|
|
| 728 | - (EpaSpan { Test20297.ppr.hs:8:3-7 }))
|
|
| 729 | - [])
|
|
| 730 | - (EpaComments
|
|
| 731 | - []))
|
|
| 719 | + ((,)
|
|
| 720 | + (EpAnn
|
|
| 721 | + (EpaSpan { Test20297.ppr.hs:(8,3)-(9,24) })
|
|
| 722 | + (AnnList
|
|
| 723 | + (Just
|
|
| 724 | + (EpaSpan { Test20297.ppr.hs:9:7-24 }))
|
|
| 725 | + (ListNone)
|
|
| 726 | + []
|
|
| 727 | + [])
|
|
| 728 | + (EpaComments
|
|
| 729 | + []))
|
|
| 730 | + (EpTok
|
|
| 731 | + (EpaSpan { Test20297.ppr.hs:8:3-7 })))
|
|
| 732 | 732 | (ValBinds
|
| 733 | 733 | (NoExtField)
|
| 734 | 734 | [(VbBind
|
| ... | ... | @@ -756,7 +756,6 @@ |
| 756 | 756 | (Nothing)
|
| 757 | 757 | (ListNone)
|
| 758 | 758 | []
|
| 759 | - (())
|
|
| 760 | 759 | []))
|
| 761 | 760 | (L
|
| 762 | 761 | (EpAnn
|
| ... | ... | @@ -823,15 +822,16 @@ |
| 823 | 822 | (EpaComments
|
| 824 | 823 | []))
|
| 825 | 824 | (HsDo
|
| 826 | - (AnnList
|
|
| 827 | - (Just
|
|
| 828 | - (EpaSpan { Test20297.ppr.hs:9:20-24 }))
|
|
| 829 | - (ListBraces
|
|
| 830 | - (NoEpTok)
|
|
| 831 | - (NoEpTok))
|
|
| 832 | - []
|
|
| 833 | - (EpaSpan { Test20297.ppr.hs:9:17-18 })
|
|
| 834 | - [])
|
|
| 825 | + ((,)
|
|
| 826 | + (AnnList
|
|
| 827 | + (Just
|
|
| 828 | + (EpaSpan { Test20297.ppr.hs:9:20-24 }))
|
|
| 829 | + (ListBraces
|
|
| 830 | + (NoEpTok)
|
|
| 831 | + (NoEpTok))
|
|
| 832 | + []
|
|
| 833 | + [])
|
|
| 834 | + (EpaSpan { Test20297.ppr.hs:9:17-18 }))
|
|
| 835 | 835 | (DoExpr
|
| 836 | 836 | (Nothing))
|
| 837 | 837 | (L
|
| ... | ... | @@ -522,7 +522,6 @@ |
| 522 | 522 | (Nothing)
|
| 523 | 523 | (ListNone)
|
| 524 | 524 | []
|
| 525 | - (())
|
|
| 526 | 525 | []))
|
| 527 | 526 | (L
|
| 528 | 527 | (EpAnn
|
| ... | ... | @@ -1095,7 +1094,6 @@ |
| 1095 | 1094 | (Nothing)
|
| 1096 | 1095 | (ListNone)
|
| 1097 | 1096 | []
|
| 1098 | - (())
|
|
| 1099 | 1097 | []))
|
| 1100 | 1098 | (L
|
| 1101 | 1099 | (EpAnn
|
| ... | ... | @@ -231,7 +231,7 @@ setAnchorAn :: (HasTrailing an) |
| 231 | 231 | setAnchorAn (L (EpAnn _ an _) a) anc ts cs = (L (EpAnn anc (setTrailing an ts) cs) a)
|
| 232 | 232 | -- `debug` ("setAnchorAn: anc=" ++ showAst anc)
|
| 233 | 233 | |
| 234 | -setAnchorEpaL :: EpAnn (AnnList l) -> EpaLocation -> [TrailingAnn] -> EpAnnComments -> EpAnn (AnnList l)
|
|
| 234 | +setAnchorEpaL :: EpAnn AnnList -> EpaLocation -> [TrailingAnn] -> EpAnnComments -> EpAnn AnnList
|
|
| 235 | 235 | setAnchorEpaL (EpAnn _ an _) anc ts cs = EpAnn anc (setTrailing (an {al_anchor = Nothing}) ts) cs
|
| 236 | 236 | |
| 237 | 237 | -- ---------------------------------------------------------------------
|
| ... | ... | @@ -280,7 +280,7 @@ instance HasTrailing EpAnnSumPat where |
| 280 | 280 | trailing _ = []
|
| 281 | 281 | setTrailing a _ = a
|
| 282 | 282 | |
| 283 | -instance HasTrailing (AnnList a) where
|
|
| 283 | +instance HasTrailing AnnList where
|
|
| 284 | 284 | trailing a = al_trailing a
|
| 285 | 285 | setTrailing a ts = a { al_trailing = ts }
|
| 286 | 286 | |
| ... | ... | @@ -976,24 +976,19 @@ limportDeclAnnPackage k annImp = fmap (\new -> annImp { importDeclAnnPackage = n |
| 976 | 976 | -- al_anchor :: Maybe Anchor, -- ^ start point of a list having layout
|
| 977 | 977 | -- al_brackets :: !AnnListBrackets,
|
| 978 | 978 | -- al_semis :: [EpToken ";"], -- decls
|
| 979 | --- al_rest :: !a,
|
|
| 980 | 979 | -- al_trailing :: [TrailingAnn] -- ^ items appearing after the
|
| 981 | 980 | -- -- list, such as '=>' for a
|
| 982 | 981 | -- -- context
|
| 983 | 982 | -- } deriving (Data,Eq)
|
| 984 | 983 | |
| 985 | -lal_brackets :: Lens (AnnList l) AnnListBrackets
|
|
| 984 | +lal_brackets :: Lens AnnList AnnListBrackets
|
|
| 986 | 985 | lal_brackets k parent = fmap (\new -> parent { al_brackets = new })
|
| 987 | 986 | (k (al_brackets parent))
|
| 988 | 987 | |
| 989 | -lal_semis :: Lens (AnnList l) [EpToken ";"]
|
|
| 988 | +lal_semis :: Lens AnnList [EpToken ";"]
|
|
| 990 | 989 | lal_semis k parent = fmap (\new -> parent { al_semis = new })
|
| 991 | 990 | (k (al_semis parent))
|
| 992 | 991 | |
| 993 | -lal_rest :: Lens (AnnList l) l
|
|
| 994 | -lal_rest k parent = fmap (\new -> parent { al_rest = new })
|
|
| 995 | - (k (al_rest parent))
|
|
| 996 | - |
|
| 997 | 992 | -- -------------------------------------
|
| 998 | 993 | |
| 999 | 994 | lfst :: Lens (a,b) a
|
| ... | ... | @@ -1281,23 +1276,23 @@ markKwT (AddDarrowAnn tok) = AddDarrowAnn <$> markEpUniToken tok |
| 1281 | 1276 | -- ---------------------------------------------------------------------
|
| 1282 | 1277 | |
| 1283 | 1278 | markAnnList :: (Monad m, Monoid w)
|
| 1284 | - => EpAnn (AnnList l) -> EP w m a -> EP w m (EpAnn (AnnList l), a)
|
|
| 1279 | + => EpAnn AnnList -> EP w m a -> EP w m (EpAnn AnnList, a)
|
|
| 1285 | 1280 | markAnnList ann action = do
|
| 1286 | 1281 | markAnnListA ann $ \a -> do
|
| 1287 | 1282 | r <- action
|
| 1288 | 1283 | return (a,r)
|
| 1289 | 1284 | |
| 1290 | 1285 | markAnnList' :: (Monad m, Monoid w)
|
| 1291 | - => AnnList l -> EP w m a -> EP w m (AnnList l, a)
|
|
| 1286 | + => AnnList -> EP w m a -> EP w m (AnnList, a)
|
|
| 1292 | 1287 | markAnnList' ann action = do
|
| 1293 | 1288 | markAnnListA' ann $ \a -> do
|
| 1294 | 1289 | r <- action
|
| 1295 | 1290 | return (a,r)
|
| 1296 | 1291 | |
| 1297 | 1292 | markAnnListA :: (Monad m, Monoid w)
|
| 1298 | - => EpAnn (AnnList l)
|
|
| 1299 | - -> (EpAnn (AnnList l) -> EP w m (EpAnn (AnnList l), a))
|
|
| 1300 | - -> EP w m (EpAnn (AnnList l), a)
|
|
| 1293 | + => EpAnn AnnList
|
|
| 1294 | + -> (EpAnn AnnList -> EP w m (EpAnn AnnList, a))
|
|
| 1295 | + -> EP w m (EpAnn AnnList, a)
|
|
| 1301 | 1296 | markAnnListA an action = do
|
| 1302 | 1297 | an0 <- markLensBracketsO an lal_brackets
|
| 1303 | 1298 | an1 <- markEpAnnAllLT an0 lal_semis
|
| ... | ... | @@ -1306,9 +1301,9 @@ markAnnListA an action = do |
| 1306 | 1301 | return (an3, r)
|
| 1307 | 1302 | |
| 1308 | 1303 | markAnnListA' :: (Monad m, Monoid w)
|
| 1309 | - => AnnList l
|
|
| 1310 | - -> (AnnList l -> EP w m (AnnList l, a))
|
|
| 1311 | - -> EP w m (AnnList l , a)
|
|
| 1304 | + => AnnList
|
|
| 1305 | + -> (AnnList -> EP w m (AnnList, a))
|
|
| 1306 | + -> EP w m (AnnList, a)
|
|
| 1312 | 1307 | markAnnListA' an action = do
|
| 1313 | 1308 | an0 <- markLensBracketsO' an lal_brackets
|
| 1314 | 1309 | an1 <- markEpAnnAllLT' an0 lal_semis
|
| ... | ... | @@ -2467,17 +2462,17 @@ instance ExactPrint (GRHSs GhcPs (LocatedA (HsCmd GhcPs))) where |
| 2467 | 2462 | -- ---------------------------------------------------------------------
|
| 2468 | 2463 | |
| 2469 | 2464 | instance ExactPrint (HsLocalBinds GhcPs) where
|
| 2470 | - getAnnotationEntry (HsValBinds an _) = fromAnn an
|
|
| 2465 | + getAnnotationEntry (HsValBinds (an,_) _) = fromAnn an
|
|
| 2471 | 2466 | getAnnotationEntry (HsIPBinds{}) = NoEntryVal
|
| 2472 | 2467 | getAnnotationEntry (EmptyLocalBinds{}) = NoEntryVal
|
| 2473 | 2468 | |
| 2474 | - setAnnotationAnchor (HsValBinds an a) anc ts cs = HsValBinds (setAnchorEpaL an anc ts cs) a
|
|
| 2469 | + setAnnotationAnchor (HsValBinds (an,w) a) anc ts cs = HsValBinds (setAnchorEpaL an anc ts cs, w) a
|
|
| 2475 | 2470 | setAnnotationAnchor a _ _ _ = a
|
| 2476 | 2471 | |
| 2477 | - exact (HsValBinds an valbinds) = do
|
|
| 2478 | - an0 <- markLensFun' an lal_rest markEpToken -- 'where'
|
|
| 2472 | + exact (HsValBinds (an0, w) valbinds) = do
|
|
| 2473 | + w' <- markEpToken w -- 'where'
|
|
| 2479 | 2474 | |
| 2480 | - case al_anchor $ anns an of
|
|
| 2475 | + case al_anchor $ anns an0 of
|
|
| 2481 | 2476 | Just anc -> do
|
| 2482 | 2477 | when (not $ isEmptyValBinds valbinds) $ setExtraDP (Just anc)
|
| 2483 | 2478 | _ -> return ()
|
| ... | ... | @@ -2490,14 +2485,14 @@ instance ExactPrint (HsLocalBinds GhcPs) where |
| 2490 | 2485 | Just (ss,dp) -> do
|
| 2491 | 2486 | setExtraDPReturn Nothing
|
| 2492 | 2487 | return $ an1 { anns = (anns an1) { al_anchor = Just (EpaDelta ss dp []) }}
|
| 2493 | - return (HsValBinds an2 valbinds')
|
|
| 2488 | + return (HsValBinds (an2, w') valbinds')
|
|
| 2494 | 2489 | |
| 2495 | - exact (HsIPBinds an bs) = do
|
|
| 2490 | + exact (HsIPBinds (an,w) bs) = do
|
|
| 2491 | + w' <- markEpToken w
|
|
| 2496 | 2492 | (an2,bs') <- markAnnListA an $ \an0 -> do
|
| 2497 | - an1 <- markLensFun' an0 lal_rest markEpToken
|
|
| 2498 | 2493 | bs' <- markAnnotated bs
|
| 2499 | - return (an1, bs')
|
|
| 2500 | - return (HsIPBinds an2 bs')
|
|
| 2494 | + return (an0, bs')
|
|
| 2495 | + return (HsIPBinds (an2,w') bs')
|
|
| 2501 | 2496 | exact b@(EmptyLocalBinds _) = return b
|
| 2502 | 2497 | |
| 2503 | 2498 | |
| ... | ... | @@ -2925,10 +2920,10 @@ instance ExactPrint (HsExpr GhcPs) where |
| 2925 | 2920 | e' <- markAnnotated e
|
| 2926 | 2921 | return (HsLet (tkLet',tkIn') binds' e')
|
| 2927 | 2922 | |
| 2928 | - exact (HsDo an do_or_list_comp stmts) = do
|
|
| 2923 | + exact (HsDo (an,l) do_or_list_comp stmts) = do
|
|
| 2929 | 2924 | debugM $ "HsDo"
|
| 2930 | - (an',stmts') <- exactDo an do_or_list_comp stmts
|
|
| 2931 | - return (HsDo an' do_or_list_comp stmts')
|
|
| 2925 | + (an',l',stmts') <- exactDo (an,l) do_or_list_comp stmts
|
|
| 2926 | + return (HsDo (an',l') do_or_list_comp stmts')
|
|
| 2932 | 2927 | |
| 2933 | 2928 | exact (ExplicitList an es) = do
|
| 2934 | 2929 | debugM $ "ExplicitList start"
|
| ... | ... | @@ -3100,33 +3095,35 @@ instance ExactPrint (HsExpr GhcPs) where |
| 3100 | 3095 | -- ---------------------------------------------------------------------
|
| 3101 | 3096 | |
| 3102 | 3097 | exactDo :: (Monad m, Monoid w, ExactPrint (LocatedAn an a))
|
| 3103 | - => AnnList EpaLocation -> HsDoFlavour -> LocatedAn an a
|
|
| 3104 | - -> EP w m (AnnList EpaLocation, LocatedAn an a)
|
|
| 3105 | -exactDo an (DoExpr m) stmts = exactMdo an m "do" >>=
|
|
| 3106 | - \an0 -> markMaybeDodgyStmts an0 stmts
|
|
| 3107 | -exactDo an GhciStmtCtxt stmts = markLensFun an lal_rest (\l -> printStringAtAA l "do") >>=
|
|
| 3108 | - \an0 -> markMaybeDodgyStmts an0 stmts
|
|
| 3109 | -exactDo an (MDoExpr m) stmts = exactMdo an m "mdo" >>=
|
|
| 3110 | - \an0 -> markMaybeDodgyStmts an0 stmts
|
|
| 3111 | -exactDo an ListComp stmts = markMaybeDodgyStmts an stmts
|
|
| 3112 | -exactDo an MonadComp stmts = markMaybeDodgyStmts an stmts
|
|
| 3098 | + => (AnnList, EpaLocation) -> HsDoFlavour -> LocatedAn an a
|
|
| 3099 | + -> EP w m (AnnList, EpaLocation, LocatedAn an a)
|
|
| 3100 | +exactDo (an,l) (DoExpr m) stmts = exactMdo l m "do" >>=
|
|
| 3101 | + \l0 -> markMaybeDodgyStmts (an,l0) stmts
|
|
| 3102 | +exactDo (an,l) GhciStmtCtxt stmts = printStringAtAA l "do" >>=
|
|
| 3103 | + \l0 -> markMaybeDodgyStmts (an,l0) stmts
|
|
| 3104 | +exactDo (an,l) (MDoExpr m) stmts = exactMdo l m "mdo" >>=
|
|
| 3105 | + \l0 -> markMaybeDodgyStmts (an,l0) stmts
|
|
| 3106 | +exactDo (an,l) ListComp stmts = markMaybeDodgyStmts (an,l) stmts
|
|
| 3107 | +exactDo (an,l) MonadComp stmts = markMaybeDodgyStmts (an,l) stmts
|
|
| 3113 | 3108 | |
| 3114 | 3109 | exactMdo :: (Monad m, Monoid w)
|
| 3115 | - => AnnList EpaLocation -> Maybe ModuleName -> String -> EP w m (AnnList EpaLocation)
|
|
| 3116 | -exactMdo an Nothing kw = markLensFun an lal_rest (\l -> printStringAtAA l kw)
|
|
| 3117 | -exactMdo an (Just module_name) kw = markLensFun an lal_rest (\l -> printStringAtAA l n)
|
|
| 3110 | + => EpaLocation -> Maybe ModuleName -> String -> EP w m EpaLocation
|
|
| 3111 | +-- exactMdo an Nothing kw = markLensFun an lal_rest (\l -> printStringAtAA l kw)
|
|
| 3112 | +exactMdo l Nothing kw = printStringAtAA l kw
|
|
| 3113 | +exactMdo l (Just module_name) kw = printStringAtAA l n
|
|
| 3118 | 3114 | where
|
| 3119 | 3115 | n = (moduleNameString module_name) ++ "." ++ kw
|
| 3120 | 3116 | |
| 3121 | 3117 | markMaybeDodgyStmts :: (Monad m, Monoid w, ExactPrint (LocatedAn an a))
|
| 3122 | - => AnnList l -> LocatedAn an a -> EP w m (AnnList l, LocatedAn an a)
|
|
| 3123 | -markMaybeDodgyStmts an stmts =
|
|
| 3118 | + => (AnnList, EpaLocation) -> LocatedAn an a -> EP w m (AnnList, EpaLocation, LocatedAn an a)
|
|
| 3119 | +markMaybeDodgyStmts (an,l) stmts =
|
|
| 3124 | 3120 | if notDodgy stmts
|
| 3125 | 3121 | then do
|
| 3126 | - markAnnListA' an $ \a -> do
|
|
| 3122 | + (an0,stmts') <- markAnnListA' an $ \a -> do
|
|
| 3127 | 3123 | r <- markAnnotatedWithLayout stmts
|
| 3128 | 3124 | return (a, r)
|
| 3129 | - else return (an, stmts)
|
|
| 3125 | + return (an0, l, stmts')
|
|
| 3126 | + else return (an, l, stmts)
|
|
| 3130 | 3127 | |
| 3131 | 3128 | notDodgy :: GenLocated (EpAnn ann) a -> Bool
|
| 3132 | 3129 | notDodgy (L (EpAnn anc _ _) _) = notDodgyE anc
|
| ... | ... | @@ -3406,13 +3403,13 @@ instance ExactPrint (HsCmd GhcPs) where |
| 3406 | 3403 | e' <- markAnnotated e
|
| 3407 | 3404 | return (HsCmdLet (tkLet', tkIn') binds' e')
|
| 3408 | 3405 | |
| 3409 | - exact (HsCmdDo an (L l es)) = do
|
|
| 3406 | + exact (HsCmdDo (an0,loc) (L l es)) = do
|
|
| 3410 | 3407 | debugM $ "HsCmdDo"
|
| 3411 | - an0 <- markLensFun an lal_rest (\ll -> printStringAtAA ll "do")
|
|
| 3408 | + loc' <- printStringAtAA loc "do"
|
|
| 3412 | 3409 | (an1,es') <- markAnnList' an0 $ do
|
| 3413 | 3410 | ee <- mapM markAnnotated es
|
| 3414 | 3411 | return ee
|
| 3415 | - return (HsCmdDo an1 (L l es'))
|
|
| 3412 | + return (HsCmdDo (an1,loc') (L l es'))
|
|
| 3416 | 3413 | |
| 3417 | 3414 | -- ---------------------------------------------------------------------
|
| 3418 | 3415 | |
| ... | ... | @@ -3459,11 +3456,11 @@ instance ( |
| 3459 | 3456 | (an', by', using') <- exactTransStmt an by using form
|
| 3460 | 3457 | return (TransStmt an' form stmts' b using' by' c d e)
|
| 3461 | 3458 | |
| 3462 | - exact (RecStmt an stmts a b c d e) = do
|
|
| 3459 | + exact (RecStmt (an,r) stmts a b c d e) = do
|
|
| 3463 | 3460 | debugM $ "RecStmt"
|
| 3464 | - an0 <- markLensFun an lal_rest markEpToken
|
|
| 3465 | - (an1, stmts') <- markAnnList' an0 (markAnnotated stmts)
|
|
| 3466 | - return (RecStmt an1 stmts' a b c d e)
|
|
| 3461 | + r' <- markEpToken r
|
|
| 3462 | + (an1, stmts') <- markAnnList' an (markAnnotated stmts)
|
|
| 3463 | + return (RecStmt (an1,r') stmts' a b c d e)
|
|
| 3467 | 3464 | |
| 3468 | 3465 | -- ---------------------------------------------------------------------
|
| 3469 | 3466 |
| ... | ... | @@ -518,15 +518,15 @@ changeLocalDecls libdir (L l p) = do |
| 518 | 518 | doAddLocal = everywhereM (mkM replaceLocalBinds) p
|
| 519 | 519 | replaceLocalBinds :: LMatch GhcPs (LHsExpr GhcPs)
|
| 520 | 520 | -> Transform (LMatch GhcPs (LHsExpr GhcPs))
|
| 521 | - replaceLocalBinds (L lm (Match an mln pats (GRHSs _ rhs (HsValBinds van (ValBinds _ bs))))) = do
|
|
| 521 | + replaceLocalBinds (L lm (Match an mln pats (GRHSs _ rhs (HsValBinds (van,w) (ValBinds _ bs))))) = do
|
|
| 522 | 522 | let (oldDecls) = map unWrapValBind bs
|
| 523 | 523 | -- let decls = s:d:oldDecls
|
| 524 | 524 | let oldDecls' = captureLineSpacing oldDecls
|
| 525 | 525 | let (VbSig o:oldBinds) = map wrapValBind oldDecls'
|
| 526 | 526 | o' = setEntryDP o (DifferentLine 2 0)
|
| 527 | - let (EpAnn anc (AnnList (Just _) a b c dd) cs) = van
|
|
| 528 | - let van' = (EpAnn anc (AnnList (Just (EpaDelta noSrcSpan (DifferentLine 1 4) [])) a b c dd) cs)
|
|
| 529 | - let binds' = (HsValBinds van'
|
|
| 527 | + let (EpAnn anc (AnnList (Just _) a b dd) cs) = van
|
|
| 528 | + let van' = (EpAnn anc (AnnList (Just (EpaDelta noSrcSpan (DifferentLine 1 4) [])) a b dd) cs)
|
|
| 529 | + let binds' = (HsValBinds (van',w)
|
|
| 530 | 530 | (ValBinds noExtField (VbSig sig':VbBind decl':VbSig o':oldBinds)))
|
| 531 | 531 | return (L lm (Match an mln pats (GRHSs emptyComments rhs binds')))
|
| 532 | 532 | `debug` ("oldDecls=" ++ showAst oldDecls)
|
| ... | ... | @@ -550,12 +550,11 @@ changeLocalDecls2 libdir (L l p) = do |
| 550 | 550 | replaceLocalBinds (L lm (Match ma mln pats (GRHSs _ rhs EmptyLocalBinds{}))) = do
|
| 551 | 551 | let anc = (EpaDelta noSrcSpan (DifferentLine 1 2) [])
|
| 552 | 552 | let anc2 = (EpaDelta noSrcSpan (DifferentLine 1 4) [])
|
| 553 | - let an = EpAnn anc
|
|
| 553 | + let an = (EpAnn anc
|
|
| 554 | 554 | (AnnList (Just anc2) ListNone
|
| 555 | 555 | []
|
| 556 | - (EpTok (EpaDelta noSrcSpan (SameLine 0) []))
|
|
| 557 | 556 | [])
|
| 558 | - emptyComments
|
|
| 557 | + emptyComments, EpTok (EpaDelta noSrcSpan (SameLine 0) []))
|
|
| 559 | 558 | let decls = [VbSig sig', VbBind decl']
|
| 560 | 559 | let binds = (HsValBinds an (ValBinds noExtField decls))
|
| 561 | 560 | return (L lm (Match ma mln pats (GRHSs emptyComments rhs binds)))
|
| ... | ... | @@ -499,7 +499,7 @@ balanceCommentsMatch (L l (Match am mctxt pats (GRHSs xg grhss binds))) |
| 499 | 499 | pushTrailingComments :: WithWhere -> EpAnnComments -> HsLocalBinds GhcPs -> (Bool, HsLocalBinds GhcPs)
|
| 500 | 500 | pushTrailingComments _ _cs b@EmptyLocalBinds{} = (False, b)
|
| 501 | 501 | pushTrailingComments _ _cs (HsIPBinds _ _) = error "TODO: pushTrailingComments:HsIPBinds"
|
| 502 | -pushTrailingComments w cs lb@(HsValBinds an _) = (True, HsValBinds an' vb)
|
|
| 502 | +pushTrailingComments w cs lb@(HsValBinds (an,wt) _) = (True, HsValBinds (an',wt) vb)
|
|
| 503 | 503 | where
|
| 504 | 504 | decls = hsDeclsLocalBinds lb
|
| 505 | 505 | (an', decls') = case reverse decls of
|
| ... | ... | @@ -1090,13 +1090,13 @@ replaceDeclsValbinds w (EmptyLocalBinds _) new |
| 1090 | 1090 | = let an = newWhereAnnotation w
|
| 1091 | 1091 | in (HsValBinds an (ValBinds noExtField (map wrapValBind new)))
|
| 1092 | 1092 | |
| 1093 | -oldWhereAnnotation :: EpAnn (AnnList (EpToken "where"))
|
|
| 1094 | - -> WithWhere -> RealSrcSpan -> (EpAnn (AnnList (EpToken "where")))
|
|
| 1095 | -oldWhereAnnotation (EpAnn anc an cs) ww _oldSpan = an'
|
|
| 1093 | +oldWhereAnnotation :: (EpAnn AnnList, EpToken "where")
|
|
| 1094 | + -> WithWhere -> RealSrcSpan -> (EpAnn AnnList, EpToken "where")
|
|
| 1095 | +oldWhereAnnotation (EpAnn anc an cs, _w) ww _oldSpan = an'
|
|
| 1096 | 1096 | -- TODO: when we set DP (0,0) for the HsValBinds EpEpaLocation,
|
| 1097 | 1097 | -- change the AnnList anchor to have the correct DP too
|
| 1098 | 1098 | where
|
| 1099 | - (AnnList ancl p s _r t) = an
|
|
| 1099 | + (AnnList ancl p s t) = an
|
|
| 1100 | 1100 | w = case ww of
|
| 1101 | 1101 | WithWhere -> EpTok (EpaDelta noSrcSpan (SameLine 0) [])
|
| 1102 | 1102 | WithoutWhere -> NoEpTok
|
| ... | ... | @@ -1104,12 +1104,12 @@ oldWhereAnnotation (EpAnn anc an cs) ww _oldSpan = an' |
| 1104 | 1104 | case ww of
|
| 1105 | 1105 | WithWhere -> (anc, ancl)
|
| 1106 | 1106 | WithoutWhere -> (anc, ancl)
|
| 1107 | - an' = EpAnn anc'
|
|
| 1108 | - (AnnList ancl' p s w t)
|
|
| 1109 | - cs
|
|
| 1107 | + an' = (EpAnn anc'
|
|
| 1108 | + (AnnList ancl' p s t)
|
|
| 1109 | + cs, w)
|
|
| 1110 | 1110 | |
| 1111 | -newWhereAnnotation :: WithWhere -> (EpAnn (AnnList (EpToken "where")))
|
|
| 1112 | -newWhereAnnotation ww = an
|
|
| 1111 | +newWhereAnnotation :: WithWhere -> (EpAnn AnnList, EpToken "where")
|
|
| 1112 | +newWhereAnnotation ww = (an, w)
|
|
| 1113 | 1113 | where
|
| 1114 | 1114 | anc = EpaDelta noSrcSpan (DifferentLine 1 2) []
|
| 1115 | 1115 | anc2 = EpaDelta noSrcSpan (DifferentLine 1 4) []
|
| ... | ... | @@ -1117,7 +1117,7 @@ newWhereAnnotation ww = an |
| 1117 | 1117 | WithWhere -> EpTok (EpaDelta noSrcSpan (SameLine 0) [])
|
| 1118 | 1118 | WithoutWhere -> NoEpTok
|
| 1119 | 1119 | an = EpAnn anc
|
| 1120 | - (AnnList (Just anc2) ListNone [] w [])
|
|
| 1120 | + (AnnList (Just anc2) ListNone [] [])
|
|
| 1121 | 1121 | emptyComments
|
| 1122 | 1122 | |
| 1123 | 1123 | -- ---------------------------------------------------------------------
|
| ... | ... | @@ -230,7 +230,7 @@ insertCppComments (L l p) cs0 = insertRemainingCppComments (L l p2) remaining |
| 230 | 230 | addCommentsListItem :: EpAnn [TrailingAnn] -> State [LEpaComment] (EpAnn [TrailingAnn])
|
| 231 | 231 | addCommentsListItem = addComments
|
| 232 | 232 | |
| 233 | - addCommentsList :: EpAnn (AnnList ()) -> State [LEpaComment] (EpAnn (AnnList ()))
|
|
| 233 | + addCommentsList :: EpAnn AnnList -> State [LEpaComment] (EpAnn AnnList)
|
|
| 234 | 234 | addCommentsList = addComments
|
| 235 | 235 | |
| 236 | 236 | addCommentsGrhs :: EpAnn GrhsAnn -> State [LEpaComment] (EpAnn GrhsAnn)
|