1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 08:54:14 +03:00

Skip a $.

This commit is contained in:
Rob Rix 2016-02-24 11:44:47 -07:00
parent 6c5c51cce6
commit 65e8fe2111

View File

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