first implementation of suggest

This commit is contained in:
Araq 2011-02-16 02:24:12 +01:00
commit f7b2d71790
12 changed files with 54 additions and 25 deletions

View file

@ -677,8 +677,19 @@ proc OpenScope(tab: var TSymTab) =
Inc(tab.tos)
proc RawCloseScope(tab: var TSymTab) =
Dec(tab.tos) #tab.stack[tab.tos] := nil;
Dec(tab.tos)
iterator items*(tab: TStrTable): PSym =
var it: TTabIter
var s = InitTabIter(it, tab)
while s != nil:
yield s
s = NextIter(it, tab)
iterator items*(tab: TSymTab): PSym =
for i in countdown(tab.tos-1, 0):
for it in items(tab.stack[i]): yield it
proc hasEmptySlot(data: TIdPairSeq): bool =
for h in countup(0, high(data)):
if data[h].key == nil: