Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for decltypes#75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
kdkavanagh wants to merge1 commit intorobotpy:main
base:main
Choose a base branch
Loading
fromkdkavanagh:kdkavanagh/decltype-bugfix

Conversation

@kdkavanagh
Copy link

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 withdecltype()

@virtuald
Copy link
Member

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
Copy link
Member

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.

@kdkavanagh
Copy link
Author

Hey@virtuald, any updates on this?

@virtuald
Copy link
Member

... 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
Copy link
Member

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.

Copy link
Member

@virtualdvirtuald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ok, this is pretty dumb, but bear with me.

Your PR not only added support for decltypes, but also changed out the way that functions/etc are formatted. Unfortunately, our build toolrobotpy-build currently (stupidly) depends on the specific formatting of types to match parameters and such...for example:

- wpi::Logger&, std::function<void ( wpi::span<const uint8_t> data )>, double, std::string_view+ wpi::Logger&, std::function<void(wpi::span<const uint8_t> data)>, double, std::string_view:

Since our build tool is the only reason I maintain this library, I can't accept your PR with the output formatting changes at this time.

The Right Fix for this is to make robotpy-build ignore the spacing when matching types. However, I don't really want to mess with that in the middle of robotics season (which ends at the end of April) in case we need to push updates. And anyways, long term, I want to abandon cppheaderparser in favor of cxxheaderparser (have you tried it yet? it handles decltypes) and refactor robotpy-build... but that's still a bit farther off than I would like.

@kdkavanagh
Copy link
Author

Understood. Imay 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.

@virtuald
Copy link
Member

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

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@virtualdvirtualdvirtuald requested changes

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@kdkavanagh@virtuald

[8]ページ先頭

©2009-2025 Movatter.jp