backtick and export marker handling in eqIdent (#12574)

This commit is contained in:
Arne Döring 2019-11-07 14:40:44 +01:00 • committed by Andreas Rumpf
commit 94675c2378
4 changed files with 47 additions and 12 deletions

View file

@ -77,6 +77,22 @@ static:
assert fooSym.eqIdent("fOO")
assertNot fooSym.eqIdent("bar")
# eqIdent on exported and backtick quoted identifiers
let procName = ident("proc")
let quoted = nnkAccQuoted.newTree(procName)
let exported = nnkPostfix.newTree(ident"*", procName)
let exportedQuoted = nnkPostfix.newTree(ident"*", quoted)
let nodes = @[procName, quoted, exported, exportedQuoted]
for i in 0 ..< nodes.len:
for j in 0 ..< nodes.len:
doAssert eqIdent(nodes[i], nodes[j])
for node in nodes:
doAssert eqIdent(node, "proc")
var empty: NimNode
var myLit = newLit("str")