mirror of
https://github.com/github/semantic.git
synced 2024-12-29 18:06:14 +03:00
Assign non-pairs a key from their substrings.
This commit is contained in:
parent
09ec17cbb6
commit
c6e5f89dfe
@ -76,7 +76,7 @@ documentToTerm document contents = alloca $ \root -> do
|
|||||||
_ | member name fixedProductions -> Fixed $ fmap snd children
|
_ | member name fixedProductions -> Fixed $ fmap snd children
|
||||||
_ | otherwise -> Indexed $ fmap snd children)
|
_ | otherwise -> Indexed $ fmap snd children)
|
||||||
where assignKey ("pair", node) = ("pair", node)
|
where assignKey ("pair", node) = ("pair", node)
|
||||||
assignKey (name, node) = (name, node)
|
assignKey (_, node@(Info range _ :< _)) = (substring range contents, node)
|
||||||
|
|
||||||
withNamedChildren :: Ptr TSNode -> (Ptr TSNode -> IO (String, a)) -> IO [(String, a)]
|
withNamedChildren :: Ptr TSNode -> (Ptr TSNode -> IO (String, a)) -> IO [(String, a)]
|
||||||
withNamedChildren node transformNode = do
|
withNamedChildren node transformNode = do
|
||||||
|
Loading…
Reference in New Issue
Block a user