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

Ingest Keyed nodes.

This commit is contained in:
Rob Rix 2015-11-27 09:19:40 -05:00
parent 1ecad15128
commit 908d6b9de0

View File

@ -81,6 +81,7 @@ documentToTerm document contents = alloca $ \root -> do
annotation <- return . Info range $ singleton name annotation <- return . Info range $ singleton name
return (name, annotation :< case children of return (name, annotation :< case children of
[] -> Leaf $ substring range contents [] -> Leaf $ substring range contents
_ | member name keyedProductions -> Keyed $ Map.fromList children
_ | member name fixedProductions -> Fixed $ fmap snd children _ | member name fixedProductions -> Fixed $ fmap snd children
_ | otherwise -> Indexed $ fmap snd children) _ | otherwise -> Indexed $ fmap snd children)