(c/cpp) Add return when void (#22)
This commit is contained in:
@@ -73,7 +73,7 @@ local c_function_extractor = function(node)
|
|||||||
-- function implementation
|
-- function implementation
|
||||||
return res.return_statement
|
return res.return_statement
|
||||||
elseif res.function_declarator and res.primitive_type then
|
elseif res.function_declarator and res.primitive_type then
|
||||||
if res.primitive_type[1] ~= "void" or res.pointer_declarator then
|
if res.primitive_type or res.pointer_declarator then
|
||||||
-- function prototype
|
-- function prototype
|
||||||
return res.primitive_type
|
return res.primitive_type
|
||||||
end
|
end
|
||||||
@@ -91,7 +91,13 @@ end
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
parent = {
|
parent = {
|
||||||
func = { "function_declaration", "function_definition", "declaration", "field_declaration", "template_declaration" },
|
func = {
|
||||||
|
"function_declaration",
|
||||||
|
"function_definition",
|
||||||
|
"declaration",
|
||||||
|
"field_declaration",
|
||||||
|
"template_declaration",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
|
|||||||
Reference in New Issue
Block a user