mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-10 11:58:30 +01:00
cpp2ffi: correct embeded_structs for untagged structs (ImNodes needs that)
This commit is contained in:
@@ -1669,9 +1669,10 @@ function M.Parser()
|
||||
end
|
||||
end
|
||||
if it.parent then --and (it.parent.re_name == "struct_re" or it.parent.re_name == "typedef_st_re" then
|
||||
local embededst = (it.re_name == "struct_re" and it.item:match("struct%s+(%S+)"))
|
||||
local embededst = (it.re_name == "struct_re" and it.item:match("struct%s+([^%s{]+)"))
|
||||
or (it.re_name == "typedef_st_re" and it.item:match("%b{}%s*(%S+)%s*;"))
|
||||
--TODO nesting namespace and class
|
||||
if embededst then --discards false which can happen with untagged structs
|
||||
local parname = get_parents_name(it)
|
||||
if it.parent.re_name == "struct_re" then
|
||||
--needed by cimnodes with struct tag name equals member name
|
||||
@@ -1680,6 +1681,7 @@ function M.Parser()
|
||||
self.embeded_structs[embededst] = parname..embededst
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif it.re_name == "namespace_re" or it.re_name == "union_re" or it.re_name == "functype_re" then
|
||||
--nop
|
||||
elseif it.re_name == "functionD_re" or it.re_name == "function_re" then
|
||||
|
Reference in New Issue
Block a user