feat(c) Add @typedef for doxygen (#80)
This commit is contained in:
@@ -122,6 +122,7 @@ local c_config = {
|
||||
"template_declaration",
|
||||
},
|
||||
file = { "translation_unit" },
|
||||
type = { "type_definition" },
|
||||
},
|
||||
|
||||
data = {
|
||||
@@ -141,6 +142,20 @@ local c_config = {
|
||||
},
|
||||
},
|
||||
},
|
||||
type = {
|
||||
["type_definition"] = {
|
||||
["1"] = {
|
||||
extract = function(node)
|
||||
local tree = {
|
||||
{ retrieve = "first", node_type = "type_identifier", extract = true, as = i.Type },
|
||||
}
|
||||
local nodes = nodes_utils:matching_nodes_from(node, tree)
|
||||
local res = extractors:extract_from_matched(nodes)
|
||||
return res
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
locator = function(node_info, nodes_to_match)
|
||||
|
||||
@@ -6,12 +6,13 @@ return {
|
||||
{ nil, " */", { no_results = true, type = { "func", "file", "class" } } },
|
||||
{ nil, "", { no_results = true, type = { "file" } } },
|
||||
|
||||
{ nil, "/**", { type = { "func", "class" } } },
|
||||
{ nil, "/**", { type = { "func", "class", "type" } } },
|
||||
{ i.ClassName, " * @class %s", { type = { "class" } } },
|
||||
{ nil, " * @brief $1", { type = { "func", "class" } } },
|
||||
{ nil, " *", { type = { "func", "class" } } },
|
||||
{ i.Type, " * @typedef $1", { type = { "type" } } },
|
||||
{ nil, " * @brief $1", { type = { "func", "class", "type" } } },
|
||||
{ nil, " *", { type = { "func", "class", "type" } } },
|
||||
{ i.Tparam, " * @tparam %s $1" },
|
||||
{ i.Parameter, " * @param %s $1" },
|
||||
{ i.Return, " * @return $1" },
|
||||
{ nil, " */", { type = { "func", "class" } } },
|
||||
{ nil, " */", { type = { "func", "class", "type" } } },
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user