2,875
edits
No edit summary |
No edit summary |
||
Line 33: | Line 33: | ||
function Enumerator:getEnumerator() | function Enumerator:getEnumerator() | ||
error('Not implemented in base class.') | error('Not implemented in base class.') | ||
end | end | ||
Line 44: | Line 39: | ||
-- Get or create clean enumerator | -- Get or create clean enumerator | ||
local enum = self:getEnumerator() | local enum = self:getEnumerator() | ||
enum | enum.current = nil | ||
enum.index = startIndex | enum.index = startIndex | ||
local function iterator(t, k) | local function iterator(t, k) | ||
Line 53: | Line 48: | ||
end | end | ||
return iterator, enum, | return iterator, enum, enum.index | ||
end | end | ||
Line 70: | Line 65: | ||
function TableEnumerator:moveNext() | function TableEnumerator:moveNext() | ||
mw.log('moving next') | |||
if self.state == 0 then | if self.state == 0 then | ||
self.state = 1 | self.state = 1 |
edits