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

!ignore appearing in generated code #12

Closed
asmaloney opened this issue Mar 7, 2023 · 1 comment
Closed

!ignore appearing in generated code #12

asmaloney opened this issue Mar 7, 2023 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@asmaloney
Copy link
Contributor

I haven't dug into this too deeply, but when I generate on macOS I get the following:

ERRO[0001] Failed to format source file  error="exit status 2" goimports output="vk/command.go:6252:107: missing ',' in parameter list\n" path=vk/command.go

It looks like !ignore is supposed to strip some things, but maybe can't do it on a return type?

func GetPipelinePropertiesEXT(device Device, pipelineInfo *PipelineInfoEXT) (r Result, pipelineProperties !ignore) {

(Aside: does "!ignore" mean "don't ignore this" or "ignore this"? I've read the doc on it, but it's unclear if "!" is "not" or just a lexeme to differentiate it from a regular string.)

@bbredesen
Copy link
Owner

This is a duplicate of #4. The problem arose with the 1.3 spec and it's related to VkBaseOutStructure causing an infinite loop in Resolve(). Before 1.3, BaseIn and BaseOut were not actually used anywhere in the API, so the fix was to ignore them entirely, but the command generator is not currently checking for that symbol.

!ignore does mean "the generator should ignore this" and it is treated as a special symbol a few places in the code...as you noted, the "!" just differentiates it, though I totally see how it could be confusingly read as "not".

It is not well documented (and not 100% consistent), but the convention I used in exceptions.json was:

  • "regularWord" related to a struct member or other data used in the generator, usually with the same name
  • "!something" was ignored or handled differently by the generator
  • "go:something" related to Go language- or compiler-specific things...annotations, primitive types, etc.

There's nothing special about the ! symbol itself of course, it could just as well be a leading "$", angle braces around the word, or anything else. I'm closing this issue as a duplicate of #4 but if you think the "!" should be changed and want to discuss further, then feel free to open another issue on that topic.

@bbredesen bbredesen added the duplicate This issue or pull request already exists label Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants