mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
No SplitDiff!
This commit is contained in:
parent
2d1a8cc7e7
commit
6b40e59c1d
@ -109,7 +109,6 @@ library
|
||||
, Data.Scientific.Exts
|
||||
, Data.Source
|
||||
, Data.Span
|
||||
, Data.SplitDiff
|
||||
-- À la carte syntax types
|
||||
, Data.Syntax
|
||||
, Data.Syntax.Comment
|
||||
|
@ -1,24 +0,0 @@
|
||||
module Data.SplitDiff
|
||||
( SplitPatch (..)
|
||||
, getRange
|
||||
) where
|
||||
|
||||
import Control.Monad.Free
|
||||
import Data.Location
|
||||
import Data.Term
|
||||
|
||||
-- | A patch to only one side of a diff.
|
||||
data SplitPatch a
|
||||
= SplitInsert { splitTerm :: a }
|
||||
| SplitDelete { splitTerm :: a }
|
||||
| SplitReplace { splitTerm :: a }
|
||||
deriving (Foldable, Eq, Functor, Show, Traversable)
|
||||
|
||||
-- | Get the range of a SplitDiff.
|
||||
getRange :: SplitDiff f Location -> Range
|
||||
getRange diff = locationByteRange $ case diff of
|
||||
Free annotated -> termFAnnotation annotated
|
||||
Pure patch -> termAnnotation (splitTerm patch)
|
||||
|
||||
-- | A diff with only one side’s annotations.
|
||||
type SplitDiff syntax ann = Free (TermF syntax ann) (SplitPatch (Term syntax ann))
|
Loading…
Reference in New Issue
Block a user