1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Retrieve the named children of a node.

This commit is contained in:
Rob Rix 2015-11-25 12:06:21 -05:00
parent b39bc3e33e
commit 0f059a4299

View File

@ -84,7 +84,7 @@ parseTreeSitterFile file = do
toTerm :: Ptr TSDocument -> (Ptr TSNode, String) -> IO (Info, Syntax String (Ptr TSNode, String))
toTerm document (node, category) = do
name <- ts_node_p_name node document
count <- ts_node_p_named_child_count node
children <- namedChildren node
return (Info (Range { start = 0, end = 0 }) $ Data.Set.fromList [ category ], Leaf "") where
keyedProductions = Data.Set.fromList [ "object" ]
fixedProductions = Data.Set.fromList [ "pair", "rel_op", "math_op", "bool_op", "bitwise_op", "type_op", "math_assignment", "assignment", "subscript_access", "member_access", "new_expression", "function_call", "function", "ternary" ]