From c6e5f89dfe5b4ec96c3feecbfa8e7b2951aa2923 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 14 Dec 2015 18:36:46 -0500 Subject: [PATCH] Assign non-pairs a key from their substrings. --- app/TreeSitter.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/TreeSitter.hs b/app/TreeSitter.hs index fb96941c2..3df11e778 100644 --- a/app/TreeSitter.hs +++ b/app/TreeSitter.hs @@ -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 (name, node) = (name, node) + assignKey (_, node@(Info range _ :< _)) = (substring range contents, node) withNamedChildren :: Ptr TSNode -> (Ptr TSNode -> IO (String, a)) -> IO [(String, a)] withNamedChildren node transformNode = do