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:
parent
8ba29d97a3
commit
defc45eb4e
@ -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)]
|
||||
|
Loading…
Reference in New Issue
Block a user