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

Reformat across lines.

This commit is contained in:
Rob Rix 2016-04-12 11:13:29 -04:00
parent 6075a62626
commit da4fc09e82

View File

@ -53,7 +53,9 @@ parserForFilepath = parserForType . T.pack . takeExtension
breakDownLeavesByWord :: Source Char -> Term T.Text Info -> Term T.Text Info
breakDownLeavesByWord source = cata replaceIn
where
replaceIn (Info range categories _) (Leaf _) | ranges <- rangesAndWordsInSource range, length ranges > 1 = Info range categories (1 + fromIntegral (length ranges)) :< Indexed (makeLeaf categories <$> ranges)
replaceIn (Info range categories _) (Leaf _) | ranges <- rangesAndWordsInSource range
, length ranges > 1
= Info range categories (1 + fromIntegral (length ranges)) :< Indexed (makeLeaf categories <$> ranges)
replaceIn info syntax = info :< syntax
rangesAndWordsInSource range = rangesAndWordsFrom (start range) (toString $ slice range source)
makeLeaf categories (range, substring) = Info range categories 1 :< Leaf (T.pack substring)