Commit be7068a6 authored by Vladislav Zavialov's avatar Vladislav Zavialov Committed by Marge Bot

Parser API annotations: RealSrcLoc

During parsing, GHC collects lexical information about AST nodes and
stores it in a map. It is needed to faithfully restore original source
code, e.g. compare these expressions:

	a =  b
	a  = b

The position of the equality sign is not recorded in the AST, so it must
be stored elsewhere.

This system is described in Note [Api annotations].

Before this patch, the mapping was represented by:

	Map (SrcSpan, AnnKeywordId) SrcSpan

After this patch, the mapping is represented by:

	Map (RealSrcSpan, AnnKeywordId) RealSrcSpan

The motivation behind this change is to avoid using the Ord SrcSpan
instance (required by Map here), as it interferes with #17632 (see the
discussion there).

SrcSpan is isomorphic to  Either String RealSrcSpan,  but we shouldn't
use those strings as Map keys. Those strings are intended as hints to
the user, e.g. "<interactive>" or "<compiler-generated code>", so they
are not a valid way to identify nodes in the source code.
parent 0482f58a
......@@ -23,6 +23,7 @@ import GhcPrelude
-- In a separate module because it hooks into the parser.
import BkpSyn
import ApiAnnotation
import GHC hiding (Failed, Succeeded)
import Packages
import Parser
......@@ -702,7 +703,7 @@ summariseRequirement pn mod_name = do
hsmodHaddockModHeader = Nothing
}),
hpm_src_files = [],
hpm_annotations = (Map.empty, Map.empty)
hpm_annotations = ApiAnns Map.empty Nothing Map.empty []
}),
ms_hspp_file = "", -- none, it came inline
ms_hspp_opts = dflags,
......@@ -812,7 +813,7 @@ hsModuleToModSummary pn hsc_src modname
ms_parsed_mod = Just (HsParsedModule {
hpm_module = hsmod,
hpm_src_files = [], -- TODO if we preprocessed it
hpm_annotations = (Map.empty, Map.empty) -- BOGUS
hpm_annotations = ApiAnns Map.empty Nothing Map.empty [] -- BOGUS
}),
ms_hs_date = time,
ms_obj_date = Nothing, -- TODO do this, but problem: hi_timestamp is BOGUS
......
......@@ -83,7 +83,7 @@ module SrcLoc (
-- ** Combining and comparing Located values
eqLocated, cmpLocated, combineLocs, addCLoc,
leftmost_smallest, leftmost_largest, rightmost,
spans, isSubspanOf, sortLocated,
spans, isSubspanOf, isRealSubspanOf, sortLocated,
liftL
) where
......@@ -180,7 +180,7 @@ advanceSrcLoc (SrcLoc f l c) _ = SrcLoc f l (c + 1)
************************************************************************
-}
sortLocated :: [Located a] -> [Located a]
sortLocated :: Ord l => [GenLocated l a] -> [GenLocated l a]
sortLocated things = sortBy (comparing getLoc) things
instance Outputable RealSrcLoc where
......@@ -596,10 +596,17 @@ spans (RealSrcSpan span) (l,c) = realSrcSpanStart span <= loc && loc <= realSrcS
isSubspanOf :: SrcSpan -- ^ The span that may be enclosed by the other
-> SrcSpan -- ^ The span it may be enclosed by
-> Bool
isSubspanOf src parent
| srcSpanFileName_maybe parent /= srcSpanFileName_maybe src = False
| otherwise = srcSpanStart parent <= srcSpanStart src &&
srcSpanEnd parent >= srcSpanEnd src
isSubspanOf (RealSrcSpan src) (RealSrcSpan parent) = isRealSubspanOf src parent
isSubspanOf _ _ = False
-- | Determines whether a span is enclosed by another one
isRealSubspanOf :: RealSrcSpan -- ^ The span that may be enclosed by the other
-> RealSrcSpan -- ^ The span it may be enclosed by
-> Bool
isRealSubspanOf src parent
| srcSpanFile parent /= srcSpanFile src = False
| otherwise = realSrcSpanStart parent <= realSrcSpanStart src &&
realSrcSpanEnd parent >= realSrcSpanEnd src
liftL :: Monad m => (a -> m b) -> GenLocated l a -> m (GenLocated l b)
liftL f (L loc a) = do
......
......@@ -275,7 +275,7 @@ module GHC (
parser,
-- * API Annotations
ApiAnns,AnnKeywordId(..),AnnotationComment(..),
ApiAnns(..),AnnKeywordId(..),AnnotationComment(..),
getAnnotation, getAndRemoveAnnotation,
getAnnotationComments, getAndRemoveAnnotationComments,
unicodeAnn,
......
......@@ -102,6 +102,7 @@ import Panic
import ConLike
import Control.Concurrent
import ApiAnnotation
import Module
import Packages
import RdrName
......@@ -392,13 +393,16 @@ hscParse' mod_summary
-- filter them out:
srcs2 <- liftIO $ filterM doesFileExist srcs1
let res = HsParsedModule {
let api_anns = ApiAnns {
apiAnnItems = M.fromListWith (++) $ annotations pst,
apiAnnEofPos = eof_pos pst,
apiAnnComments = M.fromList (annotations_comments pst),
apiAnnRogueComments = comment_q pst
}
res = HsParsedModule {
hpm_module = rdr_module,
hpm_src_files = srcs2,
hpm_annotations
= (M.fromListWith (++) $ annotations pst,
M.fromList $ ((noSrcSpan,comment_q pst)
:(annotations_comments pst)))
hpm_annotations = api_anns
}
-- apply parse transformation of plugins
......
......@@ -3,7 +3,7 @@
module ApiAnnotation (
getAnnotation, getAndRemoveAnnotation,
getAnnotationComments,getAndRemoveAnnotationComments,
ApiAnns,
ApiAnns(..),
ApiAnnKey,
AnnKeywordId(..),
AnnotationComment(..),
......@@ -41,8 +41,13 @@ pm_annotations field of the ParsedModule type.
The full ApiAnns type is
> type ApiAnns = ( Map.Map ApiAnnKey [SrcSpan] -- non-comments
> , Map.Map SrcSpan [Located AnnotationComment]) -- comments
> data ApiAnns =
> ApiAnns
> { apiAnnItems :: Map.Map ApiAnnKey [RealSrcSpan],
> apiAnnEofPos :: Maybe RealSrcSpan,
> apiAnnComments :: Map.Map RealSrcSpan [RealLocated AnnotationComment],
> apiAnnRogueComments :: [RealLocated AnnotationComment]
> }
NON-COMMENT ELEMENTS
......@@ -52,13 +57,13 @@ can show up multiple times before the next AST element), each of which
needs to be associated with its location in the original source code.
Consequently, the structure that records non-comment elements is logically
a two level map, from the SrcSpan of the AST element containing it, to
a two level map, from the RealSrcSpan of the AST element containing it, to
a map from keywords ('AnnKeyWord') to all locations of the keyword directly
in the AST element:
> type ApiAnnKey = (SrcSpan,AnnKeywordId)
> type ApiAnnKey = (RealSrcSpan,AnnKeywordId)
>
> Map.Map ApiAnnKey [SrcSpan]
> Map.Map ApiAnnKey [RealSrcSpan]
So
......@@ -87,16 +92,16 @@ Every comment is associated with a *located* AnnotationComment.
We associate comments with the lowest (most specific) AST element
enclosing them:
> Map.Map SrcSpan [Located AnnotationComment]
> Map.Map RealSrcSpan [RealLocated AnnotationComment]
PARSER STATE
There are three fields in PState (the parser state) which play a role
with annotations.
> annotations :: [(ApiAnnKey,[SrcSpan])],
> comment_q :: [Located AnnotationComment],
> annotations_comments :: [(SrcSpan,[Located AnnotationComment])]
> annotations :: [(ApiAnnKey,[RealSrcSpan])],
> comment_q :: [RealLocated AnnotationComment],
> annotations_comments :: [(RealSrcSpan,[RealLocated AnnotationComment])]
The 'annotations' and 'annotations_comments' fields are simple: they simply
accumulate annotations that will end up in 'ApiAnns' at the end
......@@ -105,21 +110,21 @@ accumulate annotations that will end up in 'ApiAnns' at the end
The 'comment_q' field captures comments as they are seen in the token stream,
so that when they are ready to be allocated via the parser they are
available (at the time we lex a comment, we don't know what the enclosing
AST node of it is, so we can't associate it with a SrcSpan in
AST node of it is, so we can't associate it with a RealSrcSpan in
annotations_comments).
PARSER EMISSION OF ANNOTATIONS
The parser interacts with the lexer using the function
> addAnnotation :: SrcSpan -> AnnKeywordId -> SrcSpan -> P ()
> addAnnotation :: RealSrcSpan -> AnnKeywordId -> RealSrcSpan -> P ()
which takes the AST element SrcSpan, the annotation keyword and the
target SrcSpan.
which takes the AST element RealSrcSpan, the annotation keyword and the
target RealSrcSpan.
This adds the annotation to the `annotations` field of `PState` and
transfers any comments in `comment_q` WHICH ARE ENCLOSED by
the SrcSpan of this element to the `annotations_comments`
the RealSrcSpan of this element to the `annotations_comments`
field. (Comments which are outside of this annotation are deferred
until later. 'allocateComments' in 'Lexer' is responsible for
making sure we only attach comments that actually fit in the 'SrcSpan'.)
......@@ -131,49 +136,59 @@ https://gitlab.haskell.org/ghc/ghc/wikis/api-annotations
-- ---------------------------------------------------------------------
-- If you update this, update the Note [Api annotations] above
type ApiAnns = ( Map.Map ApiAnnKey [SrcSpan]
, Map.Map SrcSpan [Located AnnotationComment])
data ApiAnns =
ApiAnns
{ apiAnnItems :: Map.Map ApiAnnKey [RealSrcSpan],
apiAnnEofPos :: Maybe RealSrcSpan,
apiAnnComments :: Map.Map RealSrcSpan [RealLocated AnnotationComment],
apiAnnRogueComments :: [RealLocated AnnotationComment]
}
-- If you update this, update the Note [Api annotations] above
type ApiAnnKey = (SrcSpan,AnnKeywordId)
type ApiAnnKey = (RealSrcSpan,AnnKeywordId)
-- | Retrieve a list of annotation 'SrcSpan's based on the 'SrcSpan'
-- of the annotated AST element, and the known type of the annotation.
getAnnotation :: ApiAnns -> SrcSpan -> AnnKeywordId -> [SrcSpan]
getAnnotation (anns,_) span ann
= case Map.lookup (span,ann) anns of
getAnnotation :: ApiAnns -> RealSrcSpan -> AnnKeywordId -> [RealSrcSpan]
getAnnotation anns span ann =
case Map.lookup ann_key ann_items of
Nothing -> []
Just ss -> ss
where ann_items = apiAnnItems anns
ann_key = (span,ann)
-- | Retrieve a list of annotation 'SrcSpan's based on the 'SrcSpan'
-- of the annotated AST element, and the known type of the annotation.
-- The list is removed from the annotations.
getAndRemoveAnnotation :: ApiAnns -> SrcSpan -> AnnKeywordId
-> ([SrcSpan],ApiAnns)
getAndRemoveAnnotation (anns,cs) span ann
= case Map.lookup (span,ann) anns of
Nothing -> ([],(anns,cs))
Just ss -> (ss,(Map.delete (span,ann) anns,cs))
getAndRemoveAnnotation :: ApiAnns -> RealSrcSpan -> AnnKeywordId
-> ([RealSrcSpan],ApiAnns)
getAndRemoveAnnotation anns span ann =
case Map.lookup ann_key ann_items of
Nothing -> ([],anns)
Just ss -> (ss,anns{ apiAnnItems = Map.delete ann_key ann_items })
where ann_items = apiAnnItems anns
ann_key = (span,ann)
-- |Retrieve the comments allocated to the current 'SrcSpan'
--
-- Note: A given 'SrcSpan' may appear in multiple AST elements,
-- beware of duplicates
getAnnotationComments :: ApiAnns -> SrcSpan -> [Located AnnotationComment]
getAnnotationComments (_,anns) span =
case Map.lookup span anns of
getAnnotationComments :: ApiAnns -> RealSrcSpan -> [RealLocated AnnotationComment]
getAnnotationComments anns span =
case Map.lookup span (apiAnnComments anns) of
Just cs -> cs
Nothing -> []
-- |Retrieve the comments allocated to the current 'SrcSpan', and
-- remove them from the annotations
getAndRemoveAnnotationComments :: ApiAnns -> SrcSpan
-> ([Located AnnotationComment],ApiAnns)
getAndRemoveAnnotationComments (anns,canns) span =
case Map.lookup span canns of
Just cs -> (cs,(anns,Map.delete span canns))
Nothing -> ([],(anns,canns))
getAndRemoveAnnotationComments :: ApiAnns -> RealSrcSpan
-> ([RealLocated AnnotationComment],ApiAnns)
getAndRemoveAnnotationComments anns span =
case Map.lookup span ann_comments of
Just cs -> (cs, anns{ apiAnnComments = Map.delete span ann_comments })
Nothing -> ([], anns)
where ann_comments = apiAnnComments anns
-- --------------------------------------------------------------------
......@@ -296,7 +311,6 @@ data AnnKeywordId
| AnnLarrowtailU -- ^ '-<<', unicode variant
| AnnRarrowtail -- ^ '>>-'
| AnnRarrowtailU -- ^ '>>-', unicode variant
| AnnEofPos
deriving (Eq, Ord, Data, Show)
instance Outputable AnnKeywordId where
......
......@@ -2122,9 +2122,10 @@ data PState = PState {
-- locations of 'noise' tokens in the source, so that users of
-- the GHC API can do source to source conversions.
-- See note [Api annotations] in ApiAnnotation.hs
annotations :: [(ApiAnnKey,[SrcSpan])],
comment_q :: [Located AnnotationComment],
annotations_comments :: [(SrcSpan,[Located AnnotationComment])]
annotations :: [(ApiAnnKey,[RealSrcSpan])],
eof_pos :: Maybe RealSrcSpan,
comment_q :: [RealLocated AnnotationComment],
annotations_comments :: [(RealSrcSpan,[RealLocated AnnotationComment])]
}
-- last_loc and last_len are used when generating error messages,
-- and in pushCurrentContext only. Sigh, if only Happy passed the
......@@ -2196,6 +2197,9 @@ getRealSrcLoc = P $ \s@(PState{ loc=loc }) -> POk s loc
addSrcFile :: FastString -> P ()
addSrcFile f = P $ \s -> POk s{ srcfiles = f : srcfiles s } ()
setEofPos :: RealSrcSpan -> P ()
setEofPos span = P $ \s -> POk s{ eof_pos = Just span } ()
setLastToken :: RealSrcSpan -> Int -> P ()
setLastToken loc len = P $ \s -> POk s {
last_loc=loc,
......@@ -2591,6 +2595,7 @@ mkPStatePure options buf loc =
alr_expecting_ocurly = Nothing,
alr_justClosedExplicitLetBlock = False,
annotations = [],
eof_pos = Nothing,
comment_q = [],
annotations_comments = []
}
......@@ -2670,9 +2675,10 @@ instance MonadP P where
addError span msg >> P PFailed
getBit ext = P $ \s -> let b = ext `xtest` pExtsBitmap (options s)
in b `seq` POk s b
addAnnotation l a v = do
addAnnotation (RealSrcSpan l) a (RealSrcSpan v) = do
addAnnotationOnly l a v
allocateCommentsP l
addAnnotation _ _ _ = return ()
addAnnsAt :: MonadP m => SrcSpan -> [AddAnn] -> m ()
addAnnsAt l = mapM_ (\(AddAnn a v) -> addAnnotation l a v)
......@@ -2809,16 +2815,12 @@ lexer queueComments cont = do
(L span tok) <- lexTokenFun
--trace ("token: " ++ show tok) $ do
case tok of
ITeof -> addAnnotationOnly noSrcSpan AnnEofPos (RealSrcSpan span)
_ -> return ()
if (queueComments && isDocComment tok)
then queueComment (L (RealSrcSpan span) tok)
then queueComment (L span tok)
else return ()
if (queueComments && isComment tok)
then queueComment (L (RealSrcSpan span) tok) >> lexer queueComments cont
then queueComment (L span tok) >> lexer queueComments cont
else cont (L (RealSrcSpan span) tok)
-- Use this instead of 'lexer' in Parser.y to dump the tokens for debugging.
......@@ -3055,6 +3057,7 @@ lexToken = do
case alexScanUser exts inp sc of
AlexEOF -> do
let span = mkRealSrcSpan loc1 loc1
setEofPos span
setLastToken span 0
return (L span ITeof)
AlexError (AI loc2 buf) ->
......@@ -3203,7 +3206,7 @@ clean_pragma prag = canon_ws (map toLower (unprefix prag))
-- function, and then it can be discharged using the 'ams' function.
data AddAnn = AddAnn AnnKeywordId SrcSpan
addAnnotationOnly :: SrcSpan -> AnnKeywordId -> SrcSpan -> P ()
addAnnotationOnly :: RealSrcSpan -> AnnKeywordId -> RealSrcSpan -> P ()
addAnnotationOnly l a v = P $ \s -> POk s {
annotations = ((l,a), [v]) : annotations s
} ()
......@@ -3213,24 +3216,24 @@ addAnnotationOnly l a v = P $ \s -> POk s {
-- and end of the span
mkParensApiAnn :: SrcSpan -> [AddAnn]
mkParensApiAnn (UnhelpfulSpan _) = []
mkParensApiAnn s@(RealSrcSpan ss) = [AddAnn AnnOpenP lo,AddAnn AnnCloseP lc]
mkParensApiAnn (RealSrcSpan ss) = [AddAnn AnnOpenP lo,AddAnn AnnCloseP lc]
where
f = srcSpanFile ss
sl = srcSpanStartLine ss
sc = srcSpanStartCol ss
el = srcSpanEndLine ss
ec = srcSpanEndCol ss
lo = mkSrcSpan (srcSpanStart s) (mkSrcLoc f sl (sc+1))
lc = mkSrcSpan (mkSrcLoc f el (ec - 1)) (srcSpanEnd s)
lo = RealSrcSpan (mkRealSrcSpan (realSrcSpanStart ss) (mkRealSrcLoc f sl (sc+1)))
lc = RealSrcSpan (mkRealSrcSpan (mkRealSrcLoc f el (ec - 1)) (realSrcSpanEnd ss))
queueComment :: Located Token -> P()
queueComment :: RealLocated Token -> P()
queueComment c = P $ \s -> POk s {
comment_q = commentToAnnotation c : comment_q s
} ()
-- | Go through the @comment_q@ in @PState@ and remove all comments
-- that belong within the given span
allocateCommentsP :: SrcSpan -> P ()
allocateCommentsP :: RealSrcSpan -> P ()
allocateCommentsP ss = P $ \s ->
let (comment_q', newAnns) = allocateComments ss (comment_q s) in
POk s {
......@@ -3239,13 +3242,13 @@ allocateCommentsP ss = P $ \s ->
} ()
allocateComments
:: SrcSpan
-> [Located AnnotationComment]
-> ([Located AnnotationComment], [(SrcSpan,[Located AnnotationComment])])
:: RealSrcSpan
-> [RealLocated AnnotationComment]
-> ([RealLocated AnnotationComment], [(RealSrcSpan,[RealLocated AnnotationComment])])
allocateComments ss comment_q =
let
(before,rest) = break (\(L l _) -> isSubspanOf l ss) comment_q
(middle,after) = break (\(L l _) -> not (isSubspanOf l ss)) rest
(before,rest) = break (\(L l _) -> isRealSubspanOf l ss) comment_q
(middle,after) = break (\(L l _) -> not (isRealSubspanOf l ss)) rest
comment_q' = before ++ after
newAnns = if null middle then []
else [(ss,middle)]
......@@ -3253,7 +3256,7 @@ allocateComments ss comment_q =
(comment_q', newAnns)
commentToAnnotation :: Located Token -> Located AnnotationComment
commentToAnnotation :: RealLocated Token -> RealLocated AnnotationComment
commentToAnnotation (L l (ITdocCommentNext s)) = L l (AnnDocCommentNext s)
commentToAnnotation (L l (ITdocCommentPrev s)) = L l (AnnDocCommentPrev s)
commentToAnnotation (L l (ITdocCommentNamed s)) = L l (AnnDocCommentNamed s)
......
......@@ -2851,9 +2851,9 @@ data PV_Context =
data PV_Accum =
PV_Accum
{ pv_messages :: DynFlags -> Messages
, pv_annotations :: [(ApiAnnKey,[SrcSpan])]
, pv_comment_q :: [Located AnnotationComment]
, pv_annotations_comments :: [(SrcSpan,[Located AnnotationComment])]
, pv_annotations :: [(ApiAnnKey,[RealSrcSpan])]
, pv_comment_q :: [RealLocated AnnotationComment]
, pv_annotations_comments :: [(RealSrcSpan,[RealLocated AnnotationComment])]
}
data PV_Result a = PV_Ok PV_Accum a | PV_Failed PV_Accum
......@@ -2918,7 +2918,7 @@ instance MonadP PV where
PV $ \ctx acc ->
let b = ext `xtest` pExtsBitmap (pv_options ctx) in
PV_Ok acc $! b
addAnnotation l a v =
addAnnotation (RealSrcSpan l) a (RealSrcSpan v) =
PV $ \_ acc ->
let
(comment_q', new_ann_comments) = allocateComments l (pv_comment_q acc)
......@@ -2930,6 +2930,7 @@ instance MonadP PV where
, pv_annotations_comments = annotations_comments' }
in
PV_Ok acc' ()
addAnnotation _ _ _ = return ()
{- Note [Parser-Validator]
~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -31,6 +31,8 @@
((StarBinderAnns.hs:6:29-31,AnnOpenP), [StarBinderAnns.hs:6:29]),
((StarBinderAnns.hs:6:29-48,AnnCloseP), [StarBinderAnns.hs:6:31]),
((StarBinderAnns.hs:6:29-48,AnnEqual), [StarBinderAnns.hs:6:37]),
((StarBinderAnns.hs:6:29-48,AnnOpenP), [StarBinderAnns.hs:6:29]),
((<no location info>,AnnEofPos), [StarBinderAnns.hs:7:1])
((StarBinderAnns.hs:6:29-48,AnnOpenP), [StarBinderAnns.hs:6:29])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "StarBinderAnns.hs" 7 1
......@@ -22,7 +22,8 @@
((Test10255.hs:6:11-26,AnnCloseP), [Test10255.hs:6:26]),
((Test10255.hs:6:11-26,AnnOpenP), [Test10255.hs:6:11]),
((Test10255.hs:6:12-18,AnnRarrow), [Test10255.hs:6:20-21]),
((Test10255.hs:6:12-25,AnnRarrow), [Test10255.hs:6:20-21]),
((<no location info>,AnnEofPos), [Test10255.hs:8:1])
((Test10255.hs:6:12-25,AnnRarrow), [Test10255.hs:6:20-21])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10255.hs" 8 1
......@@ -32,7 +32,8 @@
((Test10268.hs:10:18-20,AnnSimpleQuote), [Test10268.hs:10:18]),
((Test10268.hs:11:1-17,AnnEqual), [Test10268.hs:11:7]),
((Test10268.hs:11:1-17,AnnFunId), [Test10268.hs:11:1-5]),
((Test10268.hs:11:1-17,AnnSemi), [Test10268.hs:12:1]),
((<no location info>,AnnEofPos), [Test10268.hs:12:1])
((Test10268.hs:11:1-17,AnnSemi), [Test10268.hs:12:1])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10268.hs" 12 1
......@@ -18,7 +18,8 @@
((Test10269.hs:4:1-26,AnnFunId), [Test10269.hs:4:4-6]),
((Test10269.hs:4:1-26,AnnOpenP), [Test10269.hs:4:1]),
((Test10269.hs:4:1-26,AnnSemi), [Test10269.hs:5:1]),
((Test10269.hs:4:2-8,AnnVal), [Test10269.hs:4:4-6]),
((<no location info>,AnnEofPos), [Test10269.hs:5:1])
((Test10269.hs:4:2-8,AnnVal), [Test10269.hs:4:4-6])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10269.hs" 5 1
......@@ -64,7 +64,8 @@
((Test10276.hs:15:41-70,AnnOpenP), [Test10276.hs:15:41]),
((Test10276.hs:15:42-44,AnnComma), [Test10276.hs:15:45]),
((Test10276.hs:15:59-69,AnnCloseS), [Test10276.hs:15:69]),
((Test10276.hs:15:59-69,AnnOpenS), [Test10276.hs:15:59]),
((<no location info>,AnnEofPos), [Test10276.hs:16:1])
((Test10276.hs:15:59-69,AnnOpenS), [Test10276.hs:15:59])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10276.hs" 16 1
......@@ -92,7 +92,8 @@
((Test10278.hs:17:56-57,AnnRarrow), [Test10278.hs:17:59-60]),
((Test10278.hs:17:56-80,AnnRarrow), [Test10278.hs:17:59-60]),
((Test10278.hs:17:62,AnnRarrow), [Test10278.hs:17:64-65]),
((Test10278.hs:17:62-80,AnnRarrow), [Test10278.hs:17:64-65]),
((<no location info>,AnnEofPos), [Test10278.hs:21:1])
((Test10278.hs:17:62-80,AnnRarrow), [Test10278.hs:17:64-65])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10278.hs" 21 1
......@@ -21,7 +21,8 @@
((Test10280.hs:4:36-44,AnnVal), [Test10280.hs:4:42]),
((Test10280.hs:4:37,AnnComma), [Test10280.hs:4:37]),
((Test10280.hs:4:38-39,AnnCloseP), [Test10280.hs:4:39]),
((Test10280.hs:4:38-39,AnnOpenP), [Test10280.hs:4:38]),
((<no location info>,AnnEofPos), [Test10280.hs:5:1])
((Test10280.hs:4:38-39,AnnOpenP), [Test10280.hs:4:38])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10280.hs" 5 1
......@@ -21,7 +21,8 @@
((Test10307.hs:6:3-34,AnnType), [Test10307.hs:6:3-6]),
((Test10307.hs:6:8-34,AnnEqual), [Test10307.hs:6:31]),
((Test10307.hs:6:33-34,AnnCloseP), [Test10307.hs:6:34]),
((Test10307.hs:6:33-34,AnnOpenP), [Test10307.hs:6:33]),
((<no location info>,AnnEofPos), [Test10307.hs:7:1])
((Test10307.hs:6:33-34,AnnOpenP), [Test10307.hs:6:33])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10307.hs" 7 1
......@@ -22,7 +22,8 @@
((Test10309.hs:(5,20)-(6,20),AnnOpenC), [Test10309.hs:5:20]),
((Test10309.hs:(5,20)-(6,20),AnnRarrow), [Test10309.hs:6:22-23]),
((Test10309.hs:(5,20)-(6,34),AnnRarrow), [Test10309.hs:6:22-23]),
((Test10309.hs:5:22-31,AnnDcolon), [Test10309.hs:5:28-29]),
((<no location info>,AnnEofPos), [Test10309.hs:7:1])
((Test10309.hs:5:22-31,AnnDcolon), [Test10309.hs:5:28-29])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10309.hs" 7 1
......@@ -251,7 +251,8 @@
((Test10312.hs:78:42-53,AnnFunId), [Test10312.hs:78:42-43]),
((Test10312.hs:79:57-62,AnnCloseP), [Test10312.hs:79:62]),
((Test10312.hs:79:57-62,AnnOpenP), [Test10312.hs:79:57]),
((Test10312.hs:79:58,AnnComma), [Test10312.hs:79:59]),
((<no location info>,AnnEofPos), [Test10312.hs:80:1])
((Test10312.hs:79:58,AnnComma), [Test10312.hs:79:59])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10312.hs" 80 1
......@@ -50,7 +50,8 @@
((Test10354.hs:13:1-17,AnnSemi), [Test10354.hs:14:1]),
((Test10354.hs:14:1-15,AnnEqual), [Test10354.hs:14:5]),
((Test10354.hs:14:1-15,AnnFunId), [Test10354.hs:14:1-3]),
((Test10354.hs:14:1-15,AnnSemi), [Test10354.hs:15:1]),
((<no location info>,AnnEofPos), [Test10354.hs:15:1])
((Test10354.hs:14:1-15,AnnSemi), [Test10354.hs:15:1])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10354.hs" 15 1
......@@ -57,7 +57,8 @@
((Test10357.hs:10:27-44,AnnFunId), [Test10357.hs:10:27-28]),
((Test10357.hs:11:7-29,AnnLarrow), [Test10357.hs:11:13-14]),
((Test10357.hs:11:7-29,AnnVbar), [Test10357.hs:12:5]),
((Test10357.hs:12:7-24,AnnLarrow), [Test10357.hs:12:13-14]),
((<no location info>,AnnEofPos), [Test10357.hs:14:1])
((Test10357.hs:12:7-24,AnnLarrow), [Test10357.hs:12:13-14])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10357.hs" 14 1
......@@ -33,7 +33,8 @@
((Test10358.hs:6:12-16,AnnVal), [Test10358.hs:6:15]),
((Test10358.hs:7:7-17,AnnEqual), [Test10358.hs:7:10]),
((Test10358.hs:7:7-17,AnnFunId), [Test10358.hs:7:7-8]),
((Test10358.hs:7:12-17,AnnVal), [Test10358.hs:7:14]),
((<no location info>,AnnEofPos), [Test10358.hs:9:1])
((Test10358.hs:7:12-17,AnnVal), [Test10358.hs:7:14])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10358.hs" 9 1
......@@ -24,7 +24,8 @@
((Test10396.hs:6:7-15,AnnDcolon), [Test10396.hs:6:10-11]),
((Test10396.hs:6:7-27,AnnEqual), [Test10396.hs:6:17]),
((Test10396.hs:7:10-11,AnnCloseP), [Test10396.hs:7:11]),
((Test10396.hs:7:10-11,AnnOpenP), [Test10396.hs:7:10]),
((<no location info>,AnnEofPos), [Test10396.hs:8:1])
((Test10396.hs:7:10-11,AnnOpenP), [Test10396.hs:7:10])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10396.hs" 8 1
......@@ -90,7 +90,8 @@
((Test10399.hs:22:6-17,AnnCloseP), [Test10399.hs:22:17]),
((Test10399.hs:22:6-17,AnnOpenP), [Test10399.hs:22:6]),
((Test10399.hs:22:8-15,AnnCloseQ), [Test10399.hs:22:14-15]),
((Test10399.hs:22:8-15,AnnOpen), [Test10399.hs:22:8-10]),
((<no location info>,AnnEofPos), [Test10399.hs:23:1])
((Test10399.hs:22:8-15,AnnOpen), [Test10399.hs:22:8-10])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10399.hs" 23 1
......@@ -36,7 +36,8 @@
((Test10598.hs:18:1-34,AnnDeriving), [Test10598.hs:18:1-8]),
((Test10598.hs:18:1-34,AnnInstance), [Test10598.hs:18:18-25]),
((Test10598.hs:18:1-34,AnnSemi), [Test10598.hs:19:1]),
((Test10598.hs:18:10-16,AnnNewtype), [Test10598.hs:18:10-16]),
((<no location info>,AnnEofPos), [Test10598.hs:19:1])
((Test10598.hs:18:10-16,AnnNewtype), [Test10598.hs:18:10-16])
]
---Eof Position (should be Just)-----
Just SrcSpanPoint "Test10598.hs" 19 1