(self)
| 238 | self.next = None |
| 239 | self.__next() |
| 240 | def __next(self): |
| 241 | index = self.index |
| 242 | try: |
| 243 | char = self.decoded_string[index] |
| 244 | except IndexError: |
| 245 | self.next = None |
| 246 | return |
| 247 | if char == "\\": |
| 248 | index += 1 |
| 249 | try: |
| 250 | char += self.decoded_string[index] |
| 251 | except IndexError: |
| 252 | raise error("bad escape (end of pattern)", |
| 253 | self.string, len(self.string) - 1) from None |
| 254 | self.index = index + 1 |
| 255 | self.next = char |
| 256 | def match(self, char): |
| 257 | if char == self.next: |
| 258 | self.__next() |