MCPcopy
hub / github.com/waditu/tushare / advance

Method advance

tushare/util/demjson.py:1465–1482  ·  view source on GitHub ↗

Advance the position from its current place according to the given string of characters.

( self, s )

Source from the content-addressed store, hash-verified

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

Callers 6

skipMethod · 0.80
skipuntilMethod · 0.80
popMethod · 0.80
popstrMethod · 0.80
popifMethod · 0.80
pop_if_startswithMethod · 0.80

Calls 1

char_is_unicode_eolMethod · 0.80

Tested by

no test coverage detected