1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Unified rendering of patches.

This commit is contained in:
Rob Rix 2015-11-19 17:36:59 -08:00
parent cbd1c962ca
commit 55d9cfb129

View File

@ -21,7 +21,7 @@ unified diff before after =
f (Info range _) (Keyed k) = (unifiedRange range (sort $ snd <$> Map.toList k) after, Just range)
unifiedPatch :: Patch (Term a Info) -> String
unifiedPatch _ = ""
unifiedPatch patch = maybe "" (change "-" . unifiedTerm before) $ Patch.before patch
unifiedTerm :: String -> Term a Info -> String
unifiedTerm source term = fst $ cata f term