Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for array and pointer typedefs #70

Merged
merged 4 commits into from
Mar 22, 2024
Merged

Conversation

Schamper
Copy link
Member

While the current syntax parser is quite restricting and due a rewrite, this will add support for a long time outstanding annoyance where the following syntax would not behave as expected:

typedef char uuid_t[16];

Previously, this would simply add a type alias for "char" as the literal string "uuid_t[16]". With this PR, this finally behaves as expected and allows you to typedef UUID character arrays!

Copy link

codecov bot commented Feb 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (92875c1) 89.04% compared to head (a79d63e) 89.09%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #70      +/-   ##
==========================================
+ Coverage   89.04%   89.09%   +0.04%     
==========================================
  Files          20       20              
  Lines        1862     1870       +8     
==========================================
+ Hits         1658     1666       +8     
  Misses        204      204              
Flag Coverage Δ
unittests 89.09% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@yunzheng yunzheng left a comment

Choose a reason for hiding this comment

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

Not sure if we also want to support multiple typedefs on a single line, for example:

typedef char uuid_t[16], UUID[16];

If not, then it LGTM!

Edit: nevermind about the multiple typedefs on single line, i see that it's not part of this change :)

@codecov-commenter
Copy link

codecov-commenter commented Mar 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.09%. Comparing base (ff65d41) to head (f02f608).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #70      +/-   ##
==========================================
+ Coverage   89.04%   89.09%   +0.04%     
==========================================
  Files          20       20              
  Lines        1862     1870       +8     
==========================================
+ Hits         1658     1666       +8     
  Misses        204      204              
Flag Coverage Δ
unittests 89.09% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Schamper Schamper merged commit 772d473 into main Mar 22, 2024
16 checks passed
@Schamper Schamper deleted the support-array-ptr-typedef branch March 22, 2024 11:52
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.

3 participants