mirror of
https://github.com/github/semantic.git
synced 2024-11-24 08:54:07 +03:00
Map patches into pairs of optional elements.
This commit is contained in:
parent
9048d3101f
commit
f2ca75a276
@ -17,8 +17,8 @@ split _ _ _ = return mempty
|
||||
splitDiff :: Diff a Info -> String -> String -> [(String, String)]
|
||||
splitDiff _ _ _ = []
|
||||
|
||||
splitPatch :: Patch (Term a Info) -> String -> String -> [(String, String)]
|
||||
splitPatch _ _ _ = []
|
||||
splitPatch :: String -> String -> Patch (Term a Info) -> (Maybe (Element a), Maybe (Element a))
|
||||
splitPatch before after patch = (fmap (splitTerm before) $ Patch.before patch, fmap (splitTerm after) $ Patch.after patch)
|
||||
|
||||
splitTerm :: String -> Term a Info -> Element a
|
||||
splitTerm source term = toElement term where
|
||||
|
Loading…
Reference in New Issue
Block a user