1{-# LANGUAGE DeriveDataTypeable #-}
2module SourceSyntax.Location where
4import qualified Text.Parsec.Pos as Parsec
7data SrcPos = Pos { line :: Int, column :: Int }
8 deriving (Eq, Ord, Data, Typeable)
10data SrcSpan = Span SrcPos SrcPos | NoSpan
11 deriving (Eq, Ord, Data, Typeable)
13data Located e = L SrcSpan e
14 deriving (Eq, Ord, Data, Typeable)
17instance Show SrcPos where
18 show (Pos r c) = "Line " ++ show r ++ ", Column " ++ show c
20instance Show SrcSpan where
23 Span start end -> show start
26instance Show e => Show (Located e) where
31at start end = L (Span (Pos (Parsec.sourceLine start) (Parsec.sourceColumn start))
32 (Pos (Parsec.sourceLine end ) (Parsec.sourceColumn end )))
34merge (L s1 _) (L s2 _) = L span
35 where span = case (s1,s2) of
36 (Span start _, Span _ end) -> Span start end
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list