cpp2ffi: dont keep empty comments

This commit is contained in:
Victor Bombi
2020-09-24 11:56:56 +02:00
parent 277e37f4ef
commit b14352b9ef

View File

@@ -114,7 +114,7 @@ local function strsplit(str, pat)
return t,t2
end
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*$","")
return line,comment
@@ -1036,11 +1036,11 @@ function M.Parser()
--table.insert(outtab,stru:match("(.-)%b{}"))
table.insert(outtab,"\nstruct "..stname.."\n")
table.insert(outtab,"{")
table.insert(commtab,"")
table.insert(commtab,"")
table.insert(commtab,nil)--"")
table.insert(commtab,nil)--"")
if derived then
table.insert(outtab,"\n "..derived.." _"..derived..";")
table.insert(commtab,"")
table.insert(commtab,nil)--"")
end
--local itlist,itemsin = parseItems(iner, false,locat)
local itlist = itst.childs
@@ -1075,7 +1075,7 @@ function M.Parser()
it2 = it2:gsub("%s*=.+;",";")
end
table.insert(outtab,it2)
table.insert(commtab,it.comments or "")
table.insert(commtab,it.comments )--or "")
end
elseif it.re_name == "struct_re" or it.re_name == "enum_re" then
--nop