-- ** Constructing Located
noLoc,
+ mkGeneralLocated,
-- ** Deconstructing Located
getLoc, unLoc,
isGoodSrcSpan _ = False
isOneLineSpan :: SrcSpan -> Bool
--- ^ True if the span is known to straddle more than one line.
+-- ^ True if the span is known to straddle only one line.
-- For "bad" 'SrcSpan', it returns False
isOneLineSpan s
| isGoodSrcSpan s = srcSpanStartLine s == srcSpanEndLine s
noLoc :: e -> Located e
noLoc e = L noSrcSpan e
+mkGeneralLocated :: String -> e -> Located e
+mkGeneralLocated s e = L (mkGeneralSrcSpan (fsLit s)) e
+
combineLocs :: Located a -> Located b -> SrcSpan
combineLocs a b = combineSrcSpans (getLoc a) (getLoc b)