This commit is contained in:
Araq 2019-09-26 21:19:15 +02:00
commit 983cc8882b

View file

@ -11,8 +11,8 @@ const
proc getName(n: NimNode): string = proc getName(n: NimNode): string =
case n.kind case n.kind
of nnkIdent: of nnkIdent, nnkSym:
result = $n.ident result = $n
of nnkAccQuoted: of nnkAccQuoted:
result = "" result = ""
for i in 0..<n.len: for i in 0..<n.len:
@ -27,6 +27,8 @@ proc getName(n: NimNode): string =
expectKind(n, nnkIdent) expectKind(n, nnkIdent)
of nnkDotExpr: of nnkDotExpr:
result = getName(n[0]) & "." & getName(n[1]) result = getName(n[0]) & "." & getName(n[1])
of nnkOpenSymChoice, nnkClosedSymChoice:
result = getName(n[0])
else: else:
#echo repr n #echo repr n
expectKind(n, nnkIdent) expectKind(n, nnkIdent)