1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 07:25:44 +03:00

Use getSubstring for arbitrary children of keyed nodes.

This commit is contained in:
Rob Rix 2015-12-14 18:47:20 -05:00
parent 8ba29d97a3
commit defc45eb4e

View File

@ -76,7 +76,7 @@ documentToTerm document contents = alloca $ \root -> do
_ | member name fixedProductions -> Fixed $ fmap snd children
_ | otherwise -> Indexed $ fmap snd children)
where assignKey ("pair", node) = ("pair", node)
assignKey (_, node@(Info range _ :< _)) = (substring range contents, node)
assignKey (_, node) = (getSubstring node, node)
getSubstring (Info range _ :< _) = substring range contents
withNamedChildren :: Ptr TSNode -> (Ptr TSNode -> IO (String, a)) -> IO [(String, a)]