-
Notifications
You must be signed in to change notification settings - Fork 192
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
generator: Parse and autogenerate version-related defines #431
Conversation
value!(CType::U64, complete!(tag!("ULL"))) | | ||
value!(CType::U32, complete!(tag!("U"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was never working before: the longest prefix needs to be matched first but at the same time that sets the minimum length requirement for the rest of the alt!
, so tag!("U")
never got matched.
Documented here, perhaps this should be a comment in-line:
https://github.com/Geal/nom/blob/38bb94e7bc45c2b4ef0c473e0e5c03ab134cdff3/src/branch/macros.rs#L93-L142
0be6b4b
to
3773123
Compare
3773123
to
f721c41
Compare
97b1dca
to
56617f4
Compare
56617f4
to
b84eb45
Compare
With more and more version-related defines showing up this saves us a bunch of time.
b84eb45
to
7e10b88
Compare
Depends on #429
With this PR I want to leverage existing parsing and generation infrastructure to completely automate the generation of define macros. It doesn't change much right now but will address #428 as if by magic when generating for
.175
🥳Things we should discuss:
SHOUTY_SNAKE_CASE
- this isn't standard forconst fn
. We previously had a map to re-mapVK_MAKE_VERSION
tomake_version
but to do this consistently in this new system we'll have to collect a set ofSHOUTY_SNAKE_CASE
identifiers that were found to beconst fn
(!define.parameters.is_empty()
) intead and map those tosnake_case
;EDIT: This is now taken care of by a map, bit verbose but we do that for many other types too;
cexpr
vshexadecimal_number
. Both can probably emit aLiteral
orTokenStream
at this point.