mirror of
https://github.com/github/semantic.git
synced 2025-01-05 05:58:34 +03:00
Define toMarkup for Renderable terms via the Renderable syntax instance.
This commit is contained in:
parent
0c7a59f9c9
commit
0af18aa16d
@ -146,6 +146,8 @@ instance ToMarkup f => ToMarkup (Renderable (Info, Syntax a (f, Range))) where
|
||||
contentElements children = let (elements, previous) = foldl markupForSeparatorAndChild ([], start range) children in
|
||||
elements ++ [ string $ substring (Range previous $ end range) source ]
|
||||
|
||||
instance ToMarkup (Renderable (Term a Info)) where
|
||||
toMarkup (Renderable (source, term)) = fst $ cata (\ info@(Info range _) syntax -> (toMarkup $ Renderable (source, (info, syntax)), range)) term
|
||||
|
||||
instance ToMarkup (Renderable (SplitDiff a Info)) where
|
||||
toMarkup (Renderable (source, Pure term)) = toMarkup (Renderable (source, term))
|
||||
|
Loading…
Reference in New Issue
Block a user