mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-16 22:28:30 +01:00
cpp2ffi: dont keep empty comments
This commit is contained in:
@@ -114,7 +114,7 @@ local function strsplit(str, pat)
|
|||||||
return t,t2
|
return t,t2
|
||||||
end
|
end
|
||||||
local function split_comment(line)
|
local function split_comment(line)
|
||||||
local comment = line:match("(%s*//.*)") or ""
|
local comment = line:match("(%s*//.*)") --or ""
|
||||||
line = line:gsub("%s*//.*","")
|
line = line:gsub("%s*//.*","")
|
||||||
line = line:gsub("%s*$","")
|
line = line:gsub("%s*$","")
|
||||||
return line,comment
|
return line,comment
|
||||||
@@ -1036,11 +1036,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,"")
|
table.insert(commtab,nil)--"")
|
||||||
table.insert(commtab,"")
|
table.insert(commtab,nil)--"")
|
||||||
if derived then
|
if derived then
|
||||||
table.insert(outtab,"\n "..derived.." _"..derived..";")
|
table.insert(outtab,"\n "..derived.." _"..derived..";")
|
||||||
table.insert(commtab,"")
|
table.insert(commtab,nil)--"")
|
||||||
end
|
end
|
||||||
--local itlist,itemsin = parseItems(iner, false,locat)
|
--local itlist,itemsin = parseItems(iner, false,locat)
|
||||||
local itlist = itst.childs
|
local itlist = itst.childs
|
||||||
@@ -1075,7 +1075,7 @@ 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" or it.re_name == "enum_re" then
|
elseif it.re_name == "struct_re" or it.re_name == "enum_re" then
|
||||||
--nop
|
--nop
|
||||||
|
Reference in New Issue
Block a user