1
0
forked from VimPlug/jedi

end_pos issues, fixes #150

This commit is contained in:
David Halter
2013-05-07 23:55:58 +04:30
parent 0621a276b9
commit f4e8972157
3 changed files with 16 additions and 9 deletions

View File

@@ -64,6 +64,7 @@ class PushBackIterator(object):
def __init__(self, iterator):
self.pushes = []
self.iterator = iterator
self.current = None
def push_back(self, value):
self.pushes.append(value)
@@ -77,9 +78,10 @@ class PushBackIterator(object):
def __next__(self):
if self.pushes:
return self.pushes.pop()
self.current = self.pushes.pop()
else:
return next(self.iterator)
self.current = next(self.iterator)
return self.current
class NoErrorTokenizer(object):