mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
[lit] Avoid use of iterator .next() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187858 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0d038e3e88
commit
2e10ff28f2
@ -174,16 +174,15 @@ class ShParser:
|
||||
self.tokens = ShLexer(data, win32Escapes = win32Escapes).lex()
|
||||
|
||||
def lex(self):
|
||||
try:
|
||||
return self.tokens.next()
|
||||
except StopIteration:
|
||||
return None
|
||||
for item in self.tokens:
|
||||
return item
|
||||
return None
|
||||
|
||||
def look(self):
|
||||
next = self.lex()
|
||||
if next is not None:
|
||||
self.tokens = itertools.chain([next], self.tokens)
|
||||
return next
|
||||
token = self.lex()
|
||||
if token is not None:
|
||||
self.tokens = itertools.chain([token], self.tokens)
|
||||
return token
|
||||
|
||||
def parse_command(self):
|
||||
tok = self.lex()
|
||||
|
@ -94,10 +94,9 @@ class TestProvider:
|
||||
if self.canceled:
|
||||
self.lock.release()
|
||||
return None
|
||||
|
||||
try:
|
||||
item = self.iter.next()
|
||||
except StopIteration:
|
||||
for item in self.iter:
|
||||
break
|
||||
else:
|
||||
item = None
|
||||
self.lock.release()
|
||||
return item
|
||||
|
Loading…
x
Reference in New Issue
Block a user