Advance the position from its current place according to the given string of characters.
( self, s )
| 1463 | self.__last_was_cr = False |
| 1464 | |
| 1465 | def advance( self, s ): |
| 1466 | """Advance the position from its current place according to |
| 1467 | the given string of characters. |
| 1468 | |
| 1469 | """ |
| 1470 | if s: |
| 1471 | self.text_after = None |
| 1472 | for c in s: |
| 1473 | self.__char_position += 1 |
| 1474 | if c == '\n' and self.__last_was_cr: |
| 1475 | self.__last_was_cr = False |
| 1476 | elif helpers.char_is_unicode_eol(c): |
| 1477 | self.__line += 1 |
| 1478 | self.__column = 0 |
| 1479 | self.__last_was_cr = (c == '\r') |
| 1480 | else: |
| 1481 | self.__column += 1 |
| 1482 | self.__last_was_cr = False |
| 1483 | |
| 1484 | # ---------------------------------------------------------------------- |
| 1485 | # Buffered Stream Reader |
no test coverage detected