From 4630f434eabd522b63495f59739e1fa949404138 Mon Sep 17 00:00:00 2001 From: Victor Bombi Date: Mon, 31 Aug 2020 09:15:37 +0200 Subject: [PATCH] cpp2ffi: function_re: avoid confusion with asignment, templated args: allow several, add not processed info --- generator/cpp2ffi.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/generator/cpp2ffi.lua b/generator/cpp2ffi.lua index 9345efa..f5b046d 100644 --- a/generator/cpp2ffi.lua +++ b/generator/cpp2ffi.lua @@ -256,7 +256,7 @@ M.copyfile = copyfile local function getRE() local res = { 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_%(%)]*;)", enum_re = "^([^;{}]-enum[^;{}]-%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 --local template = argscsinpars:match(ttype.."%s*<(.+)>") --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="" if template then if self.typenames[stname] ~= template then --rule out template typename @@ -995,6 +996,9 @@ function M.Parser() end elseif it.re_name == "struct_re" then table.insert(self.inerstructs,it) + else + print(it.re_name,"not processed") + M.prtable(it) end end --final