ast: add getPIdent (#17684)

* ast: add getPIdent

* fixup
This commit is contained in:
Timothee Cour 2021-04-09 01:00:13 -05:00 • committed by GitHub
commit cce1b24b1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 16 deletions

View file

@ -36,11 +36,8 @@ proc newDepN(id: int, pnode: PNode): DepN =
proc accQuoted(cache: IdentCache; n: PNode): PIdent =
var id = ""
for i in 0..<n.len:
let x = n[i]
case x.kind
of nkIdent: id.add(x.ident.s)
of nkSym: id.add(x.sym.name.s)
else: discard
let ident = n[i].getPIdent
if ident != nil: id.add(ident.s)
result = getIdent(cache, id)
proc addDecl(cache: IdentCache; n: PNode; declares: var IntSet) =