##// END OF EJS Templates
parsers: use 'next' instead of try/except...
Pierre-Yves David -
r25171:d647f97f default
parent child Browse files
Show More
@@ -27,10 +27,7 b' class parser(object):'
27 def _advance(self):
27 def _advance(self):
28 'advance the tokenizer'
28 'advance the tokenizer'
29 t = self.current
29 t = self.current
30 try:
30 self.current = next(self._iter, None)
31 self.current = self._iter.next()
32 except StopIteration:
33 pass
34 return t
31 return t
35 def _match(self, m, pos):
32 def _match(self, m, pos):
36 'make sure the tokenizer matches an end condition'
33 'make sure the tokenizer matches an end condition'
General Comments 0
You need to be logged in to leave comments. Login now