mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-11 12:18:30 +01:00
cpp2ffi: function_re: avoid confusion with asignment, templated args: allow several, add not processed info
This commit is contained in:
@@ -256,7 +256,7 @@ M.copyfile = copyfile
|
|||||||
local function getRE()
|
local function getRE()
|
||||||
local res = {
|
local res = {
|
||||||
function_re = "^([^;{}]+%b()[\n%s]*;)%s*",
|
function_re = "^([^;{}]+%b()[\n%s]*;)%s*",
|
||||||
function_re = "^([^;{}]+%b()[\n%s%w]*;)", --const at the end
|
function_re = "^([^;{}=]+%b()[\n%s%w]*;)", --const at the end
|
||||||
struct_re = "^([^;{}]-struct[^;{}]-%b{}[%s%w_%(%)]*;)",
|
struct_re = "^([^;{}]-struct[^;{}]-%b{}[%s%w_%(%)]*;)",
|
||||||
enum_re = "^([^;{}]-enum[^;{}]-%b{}[%s%w_%(%)]*;)",
|
enum_re = "^([^;{}]-enum[^;{}]-%b{}[%s%w_%(%)]*;)",
|
||||||
union_re = "^([^;{}]-union[^;{}]-%b{}[%s%w_%(%)]*;)",
|
union_re = "^([^;{}]-union[^;{}]-%b{}[%s%w_%(%)]*;)",
|
||||||
@@ -463,7 +463,8 @@ local function parseFunction(self,stname,lineorig,namespace,locat)
|
|||||||
--for _,ttype in ipairs(self.templatedTypes) do
|
--for _,ttype in ipairs(self.templatedTypes) do
|
||||||
--local template = argscsinpars:match(ttype.."%s*<(.+)>")
|
--local template = argscsinpars:match(ttype.."%s*<(.+)>")
|
||||||
--TODO several diferent templates
|
--TODO several diferent templates
|
||||||
local ttype,template = argscsinpars:match("([^%s,%(%)]+)%s*<(.+)>")
|
local ttype,template = argscsinpars:match("([^%s,%(%)]+)%s*<(.-)>")
|
||||||
|
--print("ttype,template",ttype,template)
|
||||||
local te=""
|
local te=""
|
||||||
if template then
|
if template then
|
||||||
if self.typenames[stname] ~= template then --rule out template typename
|
if self.typenames[stname] ~= template then --rule out template typename
|
||||||
@@ -995,6 +996,9 @@ function M.Parser()
|
|||||||
end
|
end
|
||||||
elseif it.re_name == "struct_re" then
|
elseif it.re_name == "struct_re" then
|
||||||
table.insert(self.inerstructs,it)
|
table.insert(self.inerstructs,it)
|
||||||
|
else
|
||||||
|
print(it.re_name,"not processed")
|
||||||
|
M.prtable(it)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--final
|
--final
|
||||||
|
Reference in New Issue
Block a user