robotpy-cppheaderparser icon indicating copy to clipboard operation
robotpy-cppheaderparser copied to clipboard

Add support for decltypes

Open kdkavanagh opened this issue 3 years ago • 7 comments

Adds support for decltypes in return types and method parameter types. Previously the parser was thrown off by the inclusion of the extra parenthesis used with decltype()

kdkavanagh avatar Mar 04 '22 18:03 kdkavanagh

Thanks for the contribution! It's likely that I won't have time to review until Saturday evening, but I'll do my best.

virtuald avatar Mar 04 '22 21:03 virtuald

I definitely forgot about this! I'm traveling, but will add it to my calendar for when I get home. There's nothing obviously wrong as far as I can see, but I have a larger corpus of stuff to run it against at home.

virtuald avatar Mar 10 '22 03:03 virtuald

Hey @virtuald, any updates on this?

kdkavanagh avatar Apr 06 '22 17:04 kdkavanagh

... definitely forgot again. Adding it back to my calendar, I don't have anything urgent planned tonight so I should be able to do it then.

virtuald avatar Apr 06 '22 17:04 virtuald

This PR failed to parse one of the core RobotPy libraries that we use CppHeaderParser for. I'll dig in to see if I can isolate it.

virtuald avatar Apr 07 '22 02:04 virtuald

Understood. I may be able to back out that change specifically.

Wasn't aware of cxxheaderparser - Fully supportive of moving off this codebase :). Do you feel it has at least close to feature parity with this library? If not, any idea of what's still missing?

FWIW, one thing we do in our codegen CI is run all generated code thru clang-format before comparing with expectations to ensure that formatting itself doesnt cause issues. Not sure if relevant to your stuff, just an unsolicited best practice we've found.

kdkavanagh avatar Apr 08 '22 13:04 kdkavanagh

cxxheaderparser does many of the same things as this (and is better at handing some C++11+ features), but intentionally doesn't do some of the weird ctypes/type resolving things that CppHeaderParser does.

It should be mostly feature complete, but some ambiguous constructs aren't quite supported yet. If you take a look at the tests, you can see what things are currently supported (and what the output looks like): https://github.com/robotpy/cxxheaderparser/tree/main/tests

virtuald avatar Apr 08 '22 14:04 virtuald