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

process non-language pragma nodes in templates #24183

Open
wants to merge 6 commits into
base: devel
Choose a base branch
from

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Sep 26, 2024

fixes #24186

When encountering pragma nodes in templates, if it's a language pragma, we don't process the name, and only any values if they exist. If it's not a language pragma, we process the full node. Previously only the values of colon expressions were processed.

To make this simpler, whichPragma is patched to consider bracketed hint/warning etc pragmas like {.hint[HintName]: off.} as being a pragma of kind wHint rather than an invalid pragma which would have to be checked separately. From looking at the uses of whichPragma this doesn't seem like it would cause problems.

Generics have the same problem (causing #18649), but to make it work we need to make sure the templates/macros don't get evaluated or get evaluated correctly (i.e. passing the proc node as the final argument), either with #23094 or by completely disabling template/macro evaluation when processing the pragma node, which would also cover {.pragma.} templates.

@metagn metagn changed the title test full semming pragma nodes in templates process non-language pragma nodes in templates Sep 26, 2024
@metagn metagn marked this pull request as ready for review September 26, 2024 20:37
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.

Pragma nodes in templates are completely unprocessed
1 participant