1
1
mirror of https://github.com/github/semantic.git synced 2025-01-02 04:10:29 +03:00

Add a Line type.

This commit is contained in:
Rob Rix 2015-12-03 11:40:54 -05:00
parent 659c109c64
commit 720c3c0dba

View File

@ -25,8 +25,6 @@ split _ _ _ = return mempty
data Row = Row (Maybe HTML) (Maybe HTML)
-- data Line = Line
diffToRows :: Diff a Info -> String -> String -> ([Row], Range, Range)
diffToRows (Free (Annotated (Info leftRange _ leftCategories, Info rightRange _ rightCategories) syntax)) before after = (annotationAndSyntaxToRows leftRange leftCategories rightRange rightCategories syntax before after, leftRange, rightRange)
@ -47,6 +45,8 @@ annotationAndSyntaxToRows left leftCategories right rightCategories (Indexed i)
leftElements = Text <$> lines (substring (Range previousLeft $ start left) before)
rightElements = Text <$> lines (substring (Range previousRight $ start right) before)
data Line = Line String
{-
in: ([ Line "a.b" ], [ Line "a.b" ]) ([ Line "(c, d, [", Line " e,", Line " f", Line "])" ], [ Line "(c, d, [", Line " ", Line " e,", Line " ", Line " f", Line "])" ])