Files
Nim/tests/template
metagn 911cef1621 process non-language pragma nodes in templates (#24183)
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](a27542195c/compiler/semgnrc.nim (L619))
(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.
2024-10-07 11:39:26 +02:00
..
2018-04-18 21:19:23 +02:00
2016-08-04 01:37:41 +02:00
2021-04-01 08:47:59 +02:00
2021-05-31 13:27:44 +02:00
2023-04-26 08:02:44 +02:00
2018-12-11 21:23:22 +01:00
2017-03-06 18:38:15 +01:00
2020-08-27 15:50:59 +02:00
2019-08-23 16:15:02 +02:00
2017-07-25 09:28:23 +02:00
2020-10-30 09:59:56 +01:00
2019-05-29 22:21:51 +02:00
2018-12-11 21:23:22 +01:00
2017-07-25 09:28:23 +02:00