some improvements for nimfix

This commit is contained in:
Araq 2014-09-09 21:31:34 +02:00
commit 490371977e
8 changed files with 38 additions and 13 deletions

View file

@ -376,3 +376,13 @@ proc nextOverloadIter*(o: var TOverloadIter, c: PContext, n: PNode): PSym =
n.sons[0].sym.name, o.inSymChoice).skipAlias(n)
if result != nil and result.kind == skStub: loadStub(result)
proc pickSym*(c: PContext, n: PNode; kind: TSymKind;
flags: TSymFlags = {}): PSym =
var o: TOverloadIter
var a = initOverloadIter(o, c, n)
while a != nil:
if a.kind == kind and flags <= a.flags:
incl(a.flags, sfUsed)
return a
a = nextOverloadIter(o, c, n)