From 0b642f579db1afa03f688eba9a85800f1fc76389 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 7 Oct 2019 17:16:01 -0400 Subject: [PATCH] =?UTF-8?q?Use=20semantic-source=E2=80=99s=20definition=20?= =?UTF-8?q?of=20Span.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- semantic-core/src/Data/Loc.hs | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/semantic-core/src/Data/Loc.hs b/semantic-core/src/Data/Loc.hs index 7309da66e..2958f6a24 100644 --- a/semantic-core/src/Data/Loc.hs +++ b/semantic-core/src/Data/Loc.hs @@ -17,9 +17,9 @@ import Control.Effect.Error import Control.Effect.Fail import Control.Effect.Reader import Data.Text (Text, pack) -import Data.Text.Prettyprint.Doc (Pretty (..)) import GHC.Stack import Prelude hiding (fail) +import Source.Span data Loc = Loc { locPath :: !Text @@ -30,27 +30,9 @@ data Loc = Loc interactive :: Loc interactive = Loc "" emptySpan -data Span = Span - { spanStart :: {-# UNPACK #-} !Pos - , spanEnd :: {-# UNPACK #-} !Pos - } - deriving (Eq, Ord, Show) - -instance Pretty Span where - pretty (Span s e) = pretty s <> "-" <> pretty e - emptySpan :: Span emptySpan = Span (Pos 1 1) (Pos 1 1) -data Pos = Pos - { posLine :: {-# UNPACK #-} !Int - , posCol :: {-# UNPACK #-} !Int - } - deriving (Eq, Ord, Show) - -instance Pretty Pos where - pretty (Pos l c) = pretty l <> ":" <> pretty c - here :: HasCallStack => Maybe Loc here = stackLoc callStack