(c/cpp) Add return when void (#22)
This commit is contained in:
@@ -73,7 +73,7 @@ local c_function_extractor = function(node)
|
||||
-- function implementation
|
||||
return res.return_statement
|
||||
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
|
||||
return res.primitive_type
|
||||
end
|
||||
@@ -91,7 +91,13 @@ end
|
||||
|
||||
return {
|
||||
parent = {
|
||||
func = { "function_declaration", "function_definition", "declaration", "field_declaration", "template_declaration" },
|
||||
func = {
|
||||
"function_declaration",
|
||||
"function_definition",
|
||||
"declaration",
|
||||
"field_declaration",
|
||||
"template_declaration",
|
||||
},
|
||||
},
|
||||
|
||||
data = {
|
||||
|
||||
Reference in New Issue
Block a user