File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ macro dump*(x: typed): untyped =
200
200
return r
201
201
202
202
# TODO : consider exporting this in macros.nim
203
- proc replaceNodes (ast: NimNode): NimNode =
203
+ proc freshIdentNodes (ast: NimNode): NimNode =
204
204
# Replace NimIdent and NimSym by a fresh ident node
205
205
# see also https://github.com/nim-lang/Nim/pull/8531#issuecomment-410436458
206
206
proc inspect(node: NimNode): NimNode =
@@ -210,10 +210,9 @@ proc replaceNodes(ast: NimNode): NimNode =
210
210
of nnkEmpty, nnkLiterals:
211
211
result = node
212
212
else :
213
- var rTree = node.kind.newTree()
213
+ result = node.kind.newTree()
214
214
for child in node:
215
- rTree.add inspect(child)
216
- result = rTree
215
+ result .add inspect(child)
217
216
result = inspect(ast)
218
217
219
218
macro distinctBase* (T: typedesc ): untyped =
@@ -236,4 +235,4 @@ macro distinctBase*(T: typedesc): untyped =
236
235
typeSym = typeSym[0 ]
237
236
while typeSym.typeKind == ntyDistinct:
238
237
typeSym = getTypeImpl(typeSym)[0 ]
239
- typeSym.replaceNodes
238
+ typeSym.freshIdentNodes
You can’t perform that action at this time.
0 commit comments