mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-10 11:58:30 +01:00
cpp2ffi: manage comments in several enums values in one line
This commit is contained in:
@@ -1239,11 +1239,21 @@ function M.Parser()
|
|||||||
outtab.enums[enumname] = {}
|
outtab.enums[enumname] = {}
|
||||||
table.insert(enumsordered,enumname)
|
table.insert(enumsordered,enumname)
|
||||||
local inner = strip_end(it.item:match("%b{}"):sub(2,-2))
|
local inner = strip_end(it.item:match("%b{}"):sub(2,-2))
|
||||||
--local enumarr = str_split(inner,",")
|
|
||||||
|
--clean comments adding them to last item
|
||||||
local enumarrtmp = str_split(inner,"\n")
|
local enumarrtmp = str_split(inner,"\n")
|
||||||
local enumarr = {}
|
local enumarr = {}
|
||||||
for k,lin in ipairs(enumarrtmp) do if split_comment(lin)~="" then table.insert(enumarr,lin) end end
|
for k,lin in ipairs(enumarrtmp) do
|
||||||
|
local lin1,comm = split_comment(lin)
|
||||||
|
if lin1~="" then
|
||||||
|
local lin1arr = str_split(lin1,",")
|
||||||
|
for k2,lin1s in ipairs(lin1arr) do
|
||||||
|
if lin1s~="" then table.insert(enumarr,lin1s) end
|
||||||
|
end
|
||||||
|
enumarr[#enumarr] = enumarr[#enumarr] .. (comm or "")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
for j,line in ipairs(enumarr) do
|
for j,line in ipairs(enumarr) do
|
||||||
local comment
|
local comment
|
||||||
line, comment = split_comment(line)
|
line, comment = split_comment(line)
|
||||||
|
Reference in New Issue
Block a user