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 ifdef block: enable section depending on the struct's fields #64

Closed
wants to merge 2 commits into from

Conversation

Kijewski
Copy link
Collaborator

Todos:

  • fix whitespace trimming errors
  • add UI tests
  • add documentation in the book

Resolves #62.

@Kijewski
Copy link
Collaborator Author

@GuillaumeGomez, do you have an idea how Generator::handle_ws, Generator::prepare_ws, etc. work and what I am doing wrong?

let syn::Data::Struct(struct_) = &self.ast.data else {
return Err(ctx.generate_error("you can use `ifdef` only with `structs`", cond));
};
let syn::Fields::Named(fields) = &struct_.fields else {
Copy link
Contributor

Choose a reason for hiding this comment

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

It could work with variables defined in the templates. We have this information normally.

@Kijewski
Copy link
Collaborator Author

Closed in favor of #78.

@Kijewski Kijewski closed this Jul 24, 2024
@Kijewski Kijewski deleted the pr-ifdef branch July 24, 2024 00:11
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.

Add support for is defined
2 participants