mercurial/parser.py
changeset 25171 d647f97f88dd
parent 20778 7c4778bc29f0
child 25253 3f1a9b44b8c2
equal deleted inserted replaced
25170:c69f4f7fe01a 25171:d647f97f88dd
    25         self._methods = methods
    25         self._methods = methods
    26         self.current = None
    26         self.current = None
    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'
    37         if self.current[0] != m:
    34         if self.current[0] != m:
    38             raise error.ParseError(_("unexpected token: %s") % self.current[0],
    35             raise error.ParseError(_("unexpected token: %s") % self.current[0],