(c) Fix return_statement in tree

As the return statement in inside the body (aka compound_statement in TS), it was not being recognized.
I added it and return_statement is now being retrieved.
This commit is contained in:
Daniel Mathiot
2021-08-27 12:09:35 +02:00
parent 29679840d6
commit 4cebcbcfdf

View File

@@ -52,7 +52,7 @@ local c_function_extractor = function(node)
{
retrieve = "all",
node_type = "identifier",
extract = true
extract = true,
},
{
@@ -62,7 +62,7 @@ local c_function_extractor = function(node)
{
retrieve = "all",
node_type = "identifier",
extract = true
extract = true,
},
{
@@ -72,7 +72,7 @@ local c_function_extractor = function(node)
{
retrieve = "all",
node_type = "identifier",
extract = true
extract = true,
},
},
},
@@ -84,7 +84,13 @@ local c_function_extractor = function(node)
},
},
},
{
retrieve = "first",
node_type = "compound_statement",
subtree = {
{ retrieve = "first", node_type = "return_statement", extract = true },
},
},
}
local nodes = neogen.utilities.nodes:matching_nodes_from(node, tree)