-
Notifications
You must be signed in to change notification settings - Fork 113
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
generate and use an extension dictionary #1131
Conversation
Discussed in the April 2nd teleconference. OK to merge after conflicts are resolved. |
Would cranking :attribute-missing: up to error (I believe it's set to warn right now) address the silent failure issue? |
Contextually, I can think of only three ways of doing this rewriting:
What I found most confusing about the attributes was the inconsistency of the naming scheme - some have _TYPE appended and some do not. Just changing the naming scheme to a consistent, perhaps prefix scheme (ANCHOR_clblah, LINK_clblah, etc.) would address that, but of course any change will be very intrusive to the spec markup. |
BTW, if you did contemplate using the macro approach, be aware that what Vulkan does is more complex than need be - we have a lot of different macros for different types of APIs but these days, there's enough information at runtime that we could simplify to just 'api:any-api-or-extension-name' for a link or extension name. Haven't done that for the same reason of being a huge, intrusive markup change. |
I don't think it would, unfortunately, because AFAICT the extension name without any suffix is defined as an attribute by the build system, in The build script could also generate a prefixed or suffixed attribute instead, and we could use that in our asciidoctor ifdefs, but that's just moving the problem. For now I've been using a Visual Studio Code regular expression to find un-suffixed attributes. This is a manual process, but at least it gives me confidence the current specs are OK:
Yeah, I wasn't expecting to need any suffix initially, since these are all C identifiers, but unfortunately asciidoctor attributes are not case sensitive so there is no way otherwise to differentiate between the enum |
CI is clean, conflicts are resolved. Merging as discussed in the April 2nd teleconference. |
Would it be helpful to just define the attribute's value as its name, or an xref to the extension anchor in the appendix? Trivial to do. |
fixes #1093
Generates and uses a new asciidoctor dictionary for extension names. I am currently generating three different dictionaries:
Note that we already define asciidoctor attributes with the unmodified extension names to control whether to include the extension in the spec, e.g.
{cl_khr_fp64}
, so I've currently suffixed the extension names in the dictionaries with_EXT
. This means that the attribute for the extension name is e.g.{cl_khr_fp64_EXT}
. This is similar to types, which also have a suffix, but it seems rather error prone since if you use the un-suffixed extension name there are no errors or warnings and the extension name just doesn't appera in the spec. We should think whether there is a better long-term solution.