Skip to content

Add support to variable with [] inside type#85

Merged
virtuald merged 5 commits into
robotpy:mainfrom
bansan85:square_bracket_in_type
May 22, 2024
Merged

Add support to variable with [] inside type#85
virtuald merged 5 commits into
robotpy:mainfrom
bansan85:square_bracket_in_type

Conversation

@bansan85

Copy link
Copy Markdown
Contributor

Like std::unique_ptr<int[]> variable;

@virtuald

Copy link
Copy Markdown
Member

Needs tests.

Also, have you tried https://github.com/robotpy/cxxheaderparser? It supports constructs like that already.

@bansan85

Copy link
Copy Markdown
Contributor Author

Sure. I will update the PR.

I use this deprecated library because the project https://github.com/thibaultmarin/hpp2plantuml uses it.

I will (try to) send another PR to add support about int i {0};. The field is currently skipped.

@bansan85

Copy link
Copy Markdown
Contributor Author

I also fixed two tests.

I just have a doubt. The output format is std::unique_ptr<int [ ] >. Is it fine ?

@bansan85

Copy link
Copy Markdown
Contributor Author

I used the same MR to add support for initialization with {}. Hope it's fine. Review by commit will be easier than review the whole MR at once.

Comment thread test/test_CppHeaderParser.py
@virtuald

Copy link
Copy Markdown
Member

Also, please merge in main, which fixes github actions.

@bansan85

bansan85 commented May 17, 2024

Copy link
Copy Markdown
Contributor Author

Also, please merge in main, which fixes github actions.

Done

@virtuald

Copy link
Copy Markdown
Member

Looks like you broke a test.

@bansan85

Copy link
Copy Markdown
Contributor Author

Fixed. A wrong index in a test.

@virtuald virtuald merged commit 8a2caee into robotpy:main May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants