mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-10 20:08:31 +01:00
cpp2ffi: add COMPILER argument to location iterator
This commit is contained in:
@@ -1290,7 +1290,7 @@ M.serializeTableF = function(t)
|
||||
return M.serializeTable("defs",t).."\nreturn defs"
|
||||
end
|
||||
--iterates lines from a gcc/clang -E in a specific location
|
||||
local function location(file,locpathT,defines)
|
||||
local function location(file,locpathT,defines,COMPILER)
|
||||
local define_re = "^#define%s+([^%s]+)%s+([^%s]+)$"
|
||||
local number_re = "^-?[0-9]+u*$"
|
||||
local hex_re = "0x[0-9a-fA-F]+u*$"
|
||||
@@ -1300,6 +1300,7 @@ local function location(file,locpathT,defines)
|
||||
else --gcc, clang
|
||||
location_re = '^# (%d+) "([^"]*)"'
|
||||
end
|
||||
|
||||
local path_reT = {}
|
||||
for i,locpath in ipairs(locpathT) do
|
||||
table.insert(path_reT,'^.*[\\/]('..locpath..')%.h$')
|
||||
@@ -1325,6 +1326,7 @@ local function location(file,locpathT,defines)
|
||||
if #line==0 then --nothing on emptyline
|
||||
elseif not line:match("%S") then --nothing if only spaces
|
||||
elseif line:sub(1,1) == "#" then
|
||||
--elseif line:match"^%s*#" then
|
||||
-- Is this a location pragma?
|
||||
local loc_num_t,location_match = line:match(location_re)
|
||||
if location_match then
|
||||
|
Reference in New Issue
Block a user