1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +03:00

Move starts/ends into the where clause.

This commit is contained in:
Rob Rix 2015-12-21 11:01:44 -05:00
parent b8c21e96af
commit 0823ca7f69

View File

@ -198,6 +198,8 @@ annotatedToRows (Annotated (Info left leftCategories, Info right rightCategories
sources = (before, after)
childRows = appendRemainder . foldl sumRows ([], starts ranges)
appendRemainder (rows, previousIndices) = reverse . foldl (adjoin2By openElement) [] $ rows ++ contextRows (ends ranges) previousIndices sources
starts (left, right) = (start left, start right)
ends (left, right) = (end left, end right)
sumRows (rows, previousIndices) child = (allRows, ends childRanges)
where
separatorRows = contextRows (starts childRanges) previousIndices sources
@ -220,12 +222,6 @@ textElements :: Range -> String -> [HTML]
textElements range source = elementAndBreak Text =<< actualLines s
where s = substring range source
starts :: (Range , Range) -> (Int, Int)
starts (left, right) = (start left, start right)
ends :: (Range, Range) -> (Int, Int)
ends (left, right) = (end left, end right)
rowFromMaybeRows :: Maybe HTML -> Maybe HTML -> Row HTML
rowFromMaybeRows a b = Row (maybe EmptyLine (Line False . (:[])) a) (maybe EmptyLine (Line False . (:[])) b)