mirror of
https://github.com/github/semantic.git
synced 2024-11-24 08:54:07 +03:00
Use withNode
for the root.
This commit is contained in:
parent
048b1cb98f
commit
a147cffe11
@ -70,8 +70,7 @@ parseTreeSitterFile file = do
|
||||
source <- newCString contents
|
||||
ts_document_set_input_string document source
|
||||
ts_document_parse document
|
||||
root <- (mallocForeignPtr :: IO (ForeignPtr TSNode))
|
||||
term <- withForeignPtr root (\root -> do
|
||||
withNode (\root -> do
|
||||
ts_document_root_node_p document root
|
||||
Control.Comonad.Cofree.unfoldM toTerm (root, "program"))
|
||||
ts_document_free document
|
||||
|
Loading…
Reference in New Issue
Block a user