Closed Erignik closed 3 years ago
Yeah, cppheaderparser is pretty bad at dealing with function pointers. Recommend you try https://github.com/robotpy/cxxheaderparser instead; once I migrate my large project to use it I will be dropping maintenance of this project.
I have seen https://github.com/robotpy/cxxheaderparser, but my project need to stay Python2.x. Maybe we can do some optimization: before call function _parse_typedef, do regular expression matching, if it's function pointer, do some data collect, else call _parse_typedef.
I'm happy to accept a pull request (+tests) fixing the issue, but I'm not willing to put in the effort myself.
I'm going to fix it.
I'am using this package to do some info collect in file. h, and find this: test.h
main,py
the output show as: {')': 'int ( * p ) ( int , int', 'U32': 'int'}
U32 is parsed well, but the function pointer var shows upon is not as I expected(the key should be p?). Is this design on purpose?