From b14352b9ef35fee84f094bd956a87c8c5386585c Mon Sep 17 00:00:00 2001 From: Victor Bombi Date: Thu, 24 Sep 2020 11:56:56 +0200 Subject: [PATCH] cpp2ffi: dont keep empty comments --- generator/cpp2ffi.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/generator/cpp2ffi.lua b/generator/cpp2ffi.lua index 7efcc65..f97d30a 100644 --- a/generator/cpp2ffi.lua +++ b/generator/cpp2ffi.lua @@ -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