We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
# test.nim import macros template attr*() {.pragma.} proc foo(a {.attr.}: int) = discard macro showImpl(a: typed) = echo treeRepr getImpl(a) showImpl(foo)
nim c test.nim
Nim Compiler Version 2.3.1 [Linux: amd64] Compiled at 2025-01-21 Copyright (c) 2006-2025 by Andreas Rumpf
git hash: 793baf3 active boot switches: -d:release
ProcDef Sym "foo" Empty Empty FormalParams Empty IdentDefs Sym "a" Sym "int" Empty Empty Empty DiscardStmt Empty
ProcDef Ident "foo" Empty Empty FormalParams Empty IdentDefs PragmaExpr Ident "a" Pragma Ident "attr" Ident "int" Empty Empty Empty StmtList DiscardStmt Empty
No response
The following code behaves as expected.
dumpTree: proc foo(a {.attr.}: int) = discard
But getImpl returns AST without the pragma.
getImpl
The text was updated successfully, but these errors were encountered:
keep param pragmas in typed proc AST
ee77a8a
fixes nim-lang#24702
1f8da38
Successfully merging a pull request may close this issue.
Description
Nim Version
Nim Compiler Version 2.3.1 [Linux: amd64]
Compiled at 2025-01-21
Copyright (c) 2006-2025 by Andreas Rumpf
git hash: 793baf3
active boot switches: -d:release
Current Output
Expected Output
Known Workarounds
No response
Additional Information
The following code behaves as expected.
But
getImpl
returns AST without the pragma.The text was updated successfully, but these errors were encountered: