mirror of
https://github.com/cimgui/cimgui.git
synced 2025-12-01 06:01:38 +00:00
respect original spaces
This commit is contained in:
@@ -3,6 +3,6 @@ rem set your PATH if necessary for gcc and lua with:
|
|||||||
set PATH=%PATH%;C:\mingw32\bin;C:\luaGL;
|
set PATH=%PATH%;C:\mingw32\bin;C:\luaGL;
|
||||||
|
|
||||||
gcc -E ../imgui/imgui.h | luajit.exe ./gen_imgui_structs.lua > imgui_structs.h
|
gcc -E ../imgui/imgui.h | luajit.exe ./gen_imgui_structs.lua > imgui_structs.h
|
||||||
|
rem gcc -E ../imgui/imgui.h > imgui_structs.raw
|
||||||
cmd /k
|
cmd /k
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ for line in io.lines() do
|
|||||||
repeat -- simulate continue with break
|
repeat -- simulate continue with break
|
||||||
|
|
||||||
--print(line)
|
--print(line)
|
||||||
line = strip(line)
|
--line = strip(line)
|
||||||
if #line == 0 then break end
|
if #line == 0 then break end
|
||||||
-- Is this a preprocessor statement?
|
-- Is this a preprocessor statement?
|
||||||
if line:sub(1,1) == "#" then
|
if line:sub(1,1) == "#" then
|
||||||
@@ -71,8 +71,8 @@ end
|
|||||||
|
|
||||||
local namespace_re = "namespace"
|
local namespace_re = "namespace"
|
||||||
local in_namespace = false
|
local in_namespace = false
|
||||||
local struct_re = "^struct%s+([^%s;]+)$"
|
local struct_re = "^%s*struct%s+([^%s;]+)$"
|
||||||
local struct_closed_re = "^struct%s+([^%s]+);$"
|
local struct_closed_re = "^%s*struct%s+([^%s]+);$"
|
||||||
local struct_closing_re = "};"
|
local struct_closing_re = "};"
|
||||||
local struct_op_close_re = "%b{}"
|
local struct_op_close_re = "%b{}"
|
||||||
local structnames = {}
|
local structnames = {}
|
||||||
@@ -113,7 +113,6 @@ typedef struct ImVector ImVector;]]
|
|||||||
|
|
||||||
if in_namespace then
|
if in_namespace then
|
||||||
if line:match(function_closing_re) then
|
if line:match(function_closing_re) then
|
||||||
--io.write( line,"\n")
|
|
||||||
in_namespace = false
|
in_namespace = false
|
||||||
end
|
end
|
||||||
break -- dont write anything inside
|
break -- dont write anything inside
|
||||||
@@ -124,7 +123,7 @@ typedef struct ImVector ImVector;]]
|
|||||||
if line:match("typedef") then --dont allow inner typedefs
|
if line:match("typedef") then --dont allow inner typedefs
|
||||||
break
|
break
|
||||||
elseif not line:match("^{$") and not line:match(struct_closing_re) then --avoid tab { and };
|
elseif not line:match("^{$") and not line:match(struct_closing_re) then --avoid tab { and };
|
||||||
line = " "..line
|
--line = " "..line
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
io.write( line,"\n")
|
io.write( line,"\n")
|
||||||
@@ -139,7 +138,7 @@ typedef struct ImVector ImVector;]]
|
|||||||
innerstructs[structnames[#structnames]] = innerstructs[structnames[#structnames]] or {}
|
innerstructs[structnames[#structnames]] = innerstructs[structnames[#structnames]] or {}
|
||||||
local st = innerstructs[structnames[#structnames]]
|
local st = innerstructs[structnames[#structnames]]
|
||||||
if not line:match("struct") and not line:match("^{$") and not line:match(struct_closing_re) then --avoid tab in struct { and };
|
if not line:match("struct") and not line:match("^{$") and not line:match(struct_closing_re) then --avoid tab in struct { and };
|
||||||
line = " "..line
|
--line = " "..line
|
||||||
end
|
end
|
||||||
st[#st + 1] = line
|
st[#st + 1] = line
|
||||||
if line:match(struct_closing_re) and not line:match(struct_op_close_re) then
|
if line:match(struct_closing_re) and not line:match(struct_op_close_re) then
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/////////////// BEGIN AUTOGENERATED SEGMENT
|
/////////////// BEGIN AUTOGENERATED SEGMENT
|
||||||
#ifndef IMGUI_STRUCTS_INCLUDED
|
#ifndef IMGUI_STRUCTS_INCLUDED
|
||||||
#define IMGUI_STRUCTS_INCLUDED
|
#define IMGUI_STRUCTS_INCLUDED
|
||||||
|
|
||||||
struct ImDrawChannel;
|
struct ImDrawChannel;
|
||||||
typedef struct ImDrawChannel ImDrawChannel;
|
typedef struct ImDrawChannel ImDrawChannel;
|
||||||
struct ImDrawCmd;
|
struct ImDrawCmd;
|
||||||
|
|||||||
Reference in New Issue
Block a user