1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 00:42:33 +03:00

Stub in a function to map pairs to better keys.

This commit is contained in:
Rob Rix 2015-12-14 18:34:53 -05:00
parent aa8a36e36c
commit 09ec17cbb6

View File

@ -72,9 +72,11 @@ documentToTerm document contents = alloca $ \root -> do
annotation <- return . Info range $ singleton name
return (name, annotation :< case children of
[] -> Leaf $ substring range contents
_ | member name keyedProductions -> Keyed $ Map.fromList children
_ | member name keyedProductions -> Keyed . Map.fromList $ assignKey <$> children
_ | member name fixedProductions -> Fixed $ fmap snd children
_ | otherwise -> Indexed $ fmap snd children)
where assignKey ("pair", node) = ("pair", node)
assignKey (name, node) = (name, node)
withNamedChildren :: Ptr TSNode -> (Ptr TSNode -> IO (String, a)) -> IO [(String, a)]
withNamedChildren node transformNode = do