mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-10 20:08:31 +01:00
cpp2ffi: cleanStruct and parseStructLine comments correction
This commit is contained in:
@@ -1335,11 +1335,11 @@ function M.Parser()
|
|||||||
--table.insert(outtab,stru:match("(.-)%b{}"))
|
--table.insert(outtab,stru:match("(.-)%b{}"))
|
||||||
table.insert(outtab,"\nstruct "..stname.."\n")
|
table.insert(outtab,"\nstruct "..stname.."\n")
|
||||||
table.insert(outtab,"{")
|
table.insert(outtab,"{")
|
||||||
table.insert(commtab,nil)--"")
|
table.insert(commtab,"")
|
||||||
table.insert(commtab,nil)--"")
|
table.insert(commtab,"")
|
||||||
if derived then
|
if derived then
|
||||||
table.insert(outtab,"\n "..derived.." _"..derived..";")
|
table.insert(outtab,"\n "..derived.." _"..derived..";")
|
||||||
table.insert(commtab,nil)--"")
|
table.insert(commtab,"")
|
||||||
end
|
end
|
||||||
--local itlist,itemsin = parseItems(iner, false,locat)
|
--local itlist,itemsin = parseItems(iner, false,locat)
|
||||||
local itlist = itst.childs
|
local itlist = itst.childs
|
||||||
@@ -1375,14 +1375,14 @@ function M.Parser()
|
|||||||
it2 = it2:gsub("%s*=.+;",";")
|
it2 = it2:gsub("%s*=.+;",";")
|
||||||
end
|
end
|
||||||
table.insert(outtab,it2)
|
table.insert(outtab,it2)
|
||||||
table.insert(commtab,it.comments )--or "")
|
table.insert(commtab,it.comments or "")
|
||||||
end
|
end
|
||||||
elseif it.re_name == "struct_re" then
|
elseif it.re_name == "struct_re" then
|
||||||
--check if has declaration
|
--check if has declaration
|
||||||
local decl = it.item:match"%b{}%s*([^%s}{]+)%s*;"
|
local decl = it.item:match"%b{}%s*([^%s}{]+)%s*;"
|
||||||
if decl then
|
if decl then
|
||||||
table.insert(outtab,"\n "..it.name.." "..decl..";")
|
table.insert(outtab,"\n "..it.name.." "..decl..";")
|
||||||
table.insert(commtab,it.comments )--or "")
|
table.insert(commtab,it.comments or "")
|
||||||
end
|
end
|
||||||
local cleanst,structname,strtab,comstab,predec = self:clean_structR1(it,doheader)
|
local cleanst,structname,strtab,comstab,predec = self:clean_structR1(it,doheader)
|
||||||
if doheader then
|
if doheader then
|
||||||
@@ -1580,6 +1580,7 @@ function M.Parser()
|
|||||||
end
|
end
|
||||||
-----------
|
-----------
|
||||||
function par:parse_struct_line(line,outtab,comment)
|
function par:parse_struct_line(line,outtab,comment)
|
||||||
|
comment = comment ~= "" and comment or nil
|
||||||
local functype_re = "^%s*[%w%s%*]+%(%*[%w_]+%)%([^%(%)]*%)"
|
local functype_re = "^%s*[%w%s%*]+%(%*[%w_]+%)%([^%(%)]*%)"
|
||||||
local functype_reex = "^(%s*[%w%s%*]+%(%*)([%w_]+)(%)%([^%(%)]*%))"
|
local functype_reex = "^(%s*[%w%s%*]+%(%*)([%w_]+)(%)%([^%(%)]*%))"
|
||||||
line = clean_spaces(line)
|
line = clean_spaces(line)
|
||||||
|
Reference in New Issue
Block a user