From 40a0bc0b91b8ef8d2dcf6cf39daf263cc5e65a9b Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 25 Nov 2015 12:53:48 -0500 Subject: [PATCH] Pass the contents of the file to toTerm. --- app/Main.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Main.hs b/app/Main.hs index 91514da11..4345cdd5d 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -77,13 +77,13 @@ parseTreeSitterFile file = do ts_document_parse document withAlloc (\root -> do ts_document_root_node_p document root - unfoldM (toTerm document) (root, "program")) + unfoldM (toTerm document contents) (root, "program")) ts_document_free document free source putStrLn $ "cSizeOf " ++ show (cSizeOf document) -toTerm :: Ptr TSDocument -> (Ptr TSNode, String) -> IO (Info, Syntax String (Ptr TSNode, String)) -toTerm document (node, category) = do +toTerm :: Ptr TSDocument -> String -> (Ptr TSNode, String) -> IO (Info, Syntax String (Ptr TSNode, String)) +toTerm document contents (node, category) = do name <- ts_node_p_name node document children <- namedChildren node return (Info (Range { start = 0, end = 0 }) $ Data.Set.fromList [ category ], Leaf "") where