summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2022-09-28 16:05:01 +0300
committerGitHub <noreply@github.com>2022-09-28 15:05:01 +0200
commitde4b0346bdafab6c38b77d430d0e83f95da0582c (patch)
tree7ec601bf0f57ccf2f6d1ad5892f14eafb2c406df /lib
parentfdc6b0fb6e1b7272f32f177da4e44d9055c00b67 (diff)
downloadNim-de4b0346bdafab6c38b77d430d0e83f95da0582c.tar.gz
store full definition AST for consts, fix noRewrite (#20115)
* continue #9582 for consts, close #9331, fix #20114

also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc

* changelog correctly

* fix jsgen

* update tgetimpl

* fix sighashes

* fix #19766, add comment about postfix

* fix noRewrite LOL

refs #16620

* fix changelog

* fix destructors
Diffstat (limited to 'lib')
-rw-r--r--lib/core/macros.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index 24901180e..cc2d5041e 100644
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -1567,7 +1567,7 @@ proc customPragmaNode(n: NimNode): NimNode =
     let impl = n.getImpl()
     if impl.kind in RoutineNodes:
       return impl.pragma
-    elif impl.kind == nnkIdentDefs and impl[0].kind == nnkPragmaExpr:
+    elif impl.kind in {nnkIdentDefs, nnkConstDef} and impl[0].kind == nnkPragmaExpr:
       return impl[0][1]
     else:
       let timpl = typ.getImpl()