new parser: clean_structR1 clean vardef_re initializations

This commit is contained in:
Victor Bombi
2020-09-04 10:27:20 +02:00
parent bf98608d4f
commit c6c733bac4

View File

@@ -819,7 +819,6 @@ function M.Parser()
par.defsT = {} par.defsT = {}
par.funcdefs = {} par.funcdefs = {}
par.embeded_structs = {} par.embeded_structs = {}
par.inerstructs = {}
par.templates = {} par.templates = {}
par.typenames = {} par.typenames = {}
par.typedefs_dict = {} par.typedefs_dict = {}
@@ -998,6 +997,10 @@ function M.Parser()
it2 = it2:gsub("mutable","") it2 = it2:gsub("mutable","")
--clean namespaces --clean namespaces
it2 = it2:gsub("%w+::","") it2 = it2:gsub("%w+::","")
--clean initializations
if it.re_name == "vardef_re" then
it2 = it2:gsub("%s*=.+;",";")
end
--skip static variables --skip static variables
if not (it.re_name == "vardef_re" and it2:match"static") then if not (it.re_name == "vardef_re" and it2:match"static") then
table.insert(outtab,it2) table.insert(outtab,it2)
@@ -1025,7 +1028,6 @@ function M.Parser()
local outtab = {} local outtab = {}
local outtabpre = {} local outtabpre = {}
local typedefs_table = {} local typedefs_table = {}
--self.inerstructs = {}
self.embeded_enums = {} self.embeded_enums = {}
local processer = function(it) local processer = function(it)
@@ -1172,9 +1174,6 @@ function M.Parser()
function par:gen_structs_and_enums_table() function par:gen_structs_and_enums_table()
local outtab = {enums={},structs={},locations={}} local outtab = {enums={},structs={},locations={}}
self.typedefs_table = {} self.typedefs_table = {}
--self.vardefs = {}
--self.inerstructs = {}
local enumsordered = {} local enumsordered = {}
local processer = function(it) local processer = function(it)