1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Parsing returns a Term.

This commit is contained in:
Rob Rix 2015-11-26 16:25:55 -05:00
parent ae7235eb69
commit 3b24a3cd34

View File

@ -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