mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-10 11:58:30 +01:00
generator corrections for vector<type>name to vector<type> name and take care of Pair not present (after 1.71)
This commit is contained in:
@@ -812,6 +812,7 @@ function M.Parser()
|
||||
te = te:gsub("%*","Ptr")
|
||||
self.templates[ttype] = self.templates[ttype] or {}
|
||||
self.templates[ttype][template] = te
|
||||
it2 = it2:gsub("(<[%w_%*%s]+>)([^%s])","%1 %2") --add if not present space after <>
|
||||
it2 = it2:gsub("<([%w_%*%s]+)>","_"..te)
|
||||
end
|
||||
--clean mutable
|
||||
@@ -937,6 +938,7 @@ function M.Parser()
|
||||
elseif it.re_name == "struct_re" then
|
||||
local cleanst,structname,strtab = self:clean_struct(it.item)
|
||||
--if not void stname or templated
|
||||
--M.prtable(cleanst,structname,strtab)
|
||||
if structname and not self.typenames[structname] then
|
||||
outtab.structs[structname] = {}
|
||||
for j=3,#strtab-1 do
|
||||
|
@@ -563,9 +563,11 @@ save_data("./output/definitions.lua",serializeTableF(parser1.defsT))
|
||||
|
||||
----------save struct and enums lua table in structs_and_enums.lua for using in bindings
|
||||
local structs_and_enums_table = parser1:gen_structs_and_enums_table()
|
||||
--correct Pair union member
|
||||
--correct Pair union member if exists (until 1.71)
|
||||
if structs_and_enums_table["structs"]["Pair"] then
|
||||
structs_and_enums_table["structs"]["Pair"][2]["name"] = ""
|
||||
structs_and_enums_table["structs"]["Pair"][2]["type"] = structs_and_enums_table["structs"]["Pair"][2]["type"] .. "}"
|
||||
end
|
||||
-----------------------
|
||||
save_data("./output/structs_and_enums.lua",serializeTableF(structs_and_enums_table))
|
||||
save_data("./output/typedefs_dict.lua",serializeTableF(parser1.typedefs_dict))
|
||||
|
Reference in New Issue
Block a user