From 3b24a3cd345c2a23f1b2c1a6f63523aa958d72a5 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 26 Nov 2015 16:25:55 -0500 Subject: [PATCH] Parsing returns a Term. --- app/Main.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Main.hs b/app/Main.hs index 0dd67f373..b013af0d7 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -54,7 +54,7 @@ main = do return (a', b') return () -parseTreeSitterFile :: FilePath -> IO () +parseTreeSitterFile :: FilePath -> IO (Term String Info) parseTreeSitterFile file = do document <- ts_document_make language <- ts_language_c @@ -64,8 +64,8 @@ parseTreeSitterFile file = do ts_document_set_input_string document source ts_document_parse document term <- documentToTerm document contents - ts_document_free document) - putStrLn $ "hooray" + ts_document_free document + return term) documentToTerm :: Ptr TSDocument -> String -> IO (Term String Info) documentToTerm document contents = alloca $ \root -> do