Skip to content

Commit 0bd9851

Browse files
committed
Add getEndColumnUnsafe for a given Located element
1 parent d66228d commit 0bd9851

File tree

1 file changed

+5
-1
lines changed
  • lib/Language/Haskell/Stylish

1 file changed

+5
-1
lines changed

lib/Language/Haskell/Stylish/GHC.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module Language.Haskell.Stylish.GHC
88
-- * Unsafe getters
99
, unsafeGetRealSrcSpan
1010
, getEndLineUnsafe
11+
, getEndColumnUnsafe
1112
, getStartLineUnsafe
1213
-- * Standard settings
1314
, baseDynFlags
@@ -33,7 +34,7 @@ import qualified Outputable as GHC
3334
import PlatformConstants (PlatformConstants (..))
3435
import SrcLoc (GenLocated (..), Located, RealLocated,
3536
RealSrcSpan, SrcSpan (..), srcSpanEndLine,
36-
srcSpanStartLine)
37+
srcSpanStartLine, srcSpanEndCol)
3738
import ToolSettings (ToolSettings (..))
3839

3940
unsafeGetRealSrcSpan :: Located a -> RealSrcSpan
@@ -47,6 +48,9 @@ getStartLineUnsafe = srcSpanStartLine . unsafeGetRealSrcSpan
4748
getEndLineUnsafe :: Located a -> Int
4849
getEndLineUnsafe = srcSpanEndLine . unsafeGetRealSrcSpan
4950

51+
getEndColumnUnsafe :: Located a -> Int
52+
getEndColumnUnsafe = srcSpanEndCol . unsafeGetRealSrcSpan
53+
5054
dropAfterLocated :: Maybe (Located a) -> [RealLocated b] -> [RealLocated b]
5155
dropAfterLocated loc xs = case loc of
5256
Just (L (RealSrcSpan rloc) _) ->

0 commit comments

Comments
 (0)