casssoft / imgui_lua_bindings

Function bindings for ImGui in lua
153 stars 27 forks source link

error when parsing Imgui 1.67 #8

Closed Nedok closed 4 years ago

Nedok commented 5 years ago

I was using windows 10, ImGui v1.67, perl5 (revision 5 version 26 subversion 3) and using the example command: perl generate_imgui_bindings.pl <../imgui/imgui.h >imgui_iterator.inl

Gives the following message:

WARNING PARSE BLOCKS IS RETURNING INVALID DATA
Supported: 212 Unsupported: 131
Uncaught exception from user code:
        Malformed enum at TabBarFlags at generate_imgui_bindings.pl line 433, <STDIN> line 2132.
        main::generateEnums("ImGui", "    ImGuiTabItemFlags_None                          = 0,\x{a}\x{a}   "...) called at generate_imgui_bindings.pl line 454
casssoft commented 5 years ago

hmm this is probably because ImGui updated their code and my parser needs to react.

In the mean time, If you remove the offending function from imgui.h before putting into the perl code then it will work.

I don't have much time to work on this so feel free to contribute but when I update my lua imgui code I will try to address this issue.

flamendless commented 5 years ago

I hope you update the generator. https://github.com/slages/love-imgui also use your generator, it would be helpful to have latest imgui version working with löve

spaderthomas commented 4 years ago

hey! I found the problems that cause this:

1) Some struct in ImGui now ends with "}; ", which doesn't match the regex for closing blocks. 2) InputFloat and Begin are also defined as obsolete functions. That means they're in the source code twice, which confuses the parser.

I've fixed number one, and I'm working on number two.

spaderthomas commented 4 years ago

Ok, that wasn't too bad to do. @patrickriordan I put up a pull request. Could you take a quick look at it?

casssoft commented 4 years ago

Thanks @spaderthomas for #9 ! This should be fixed now!