Compare commits

...

2 Commits

Author SHA1 Message Date
sonoro1234
99f8065703 avoid static const vardef assign not number (implot) 2026-02-17 11:31:11 +01:00
sonoro1234
b801b08eee cpp2ffi: add deepcopy 2026-02-17 10:44:49 +01:00

View File

@@ -76,6 +76,25 @@ function M.prtable(...)
print("\n")
end
end
local function deepcopy(object)
local lookup_table = {}
local function _copy(object)
--assert(object~=REST)
if type(object) ~= "table" then
return object
elseif lookup_table[object] then
return lookup_table[object]
end
local new_table = {}
lookup_table[object] = new_table
for index, value in pairs(object) do
new_table[_copy(index)] = _copy(value)
end
return setmetatable(new_table, getmetatable(object))
end
return _copy(object)
end
M.deepcopy = deepcopy
local function str_split(str, pat)
local t = {}
local fpat = "(.-)" .. pat
@@ -2046,7 +2065,10 @@ function M.Parser()
print("--skip enum forward declaration:",it2)
it2 = ""
end
if it2:match"=%s*ImVec" then
--only vardef assign with number
local assig = it2:match("static const [^=]*=([^;]*);")
--print("it2",it2,"assig",assig,tonumber(assig))
if assig and not tonumber(assig) then
print("--skip = vardef declaration:",it2)
it2 = ""
end
@@ -3025,7 +3047,7 @@ local function func_implementation(FP)
assert(def)
local custom
if FP.custom_implementation then
custom = FP.custom_implementation(outtab, def)
custom = FP.custom_implementation(outtab, def, FP)
end
local manual = FP.get_manuals(def)
if not custom and not manual and not def.templated and not FP.get_skipped(def) then