1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

Simplify how we compute combineIntoLeaves.

This commit is contained in:
Rob Rix 2016-02-29 10:31:53 -05:00
parent 7048a61660
commit df2b684229

View File

@ -112,7 +112,7 @@ spec = parallel $ do
getTotalRange (Source vector) = Range 0 $ length vector
combineIntoLeaves (leaves, start) char = (leaves ++ [ Free $ Annotated (Both (Info (Range start $ start + 1) mempty, Info (Range start $ start + 1) mempty)) (Leaf [ char ]) ], start + 1)
combineIntoLeaves (leaves, start) char = (leaves ++ [ Free $ Annotated (Info <$> (pure (Range start $ start + 1)) <*> mempty) (Leaf [ char ]) ], start + 1)
leafWithRangesInSources sources ranges = Free $ Annotated (Info <$> ranges <*> pure mempty) (Leaf $ toList (runLeft sources) ++ toList (runRight sources))