MCPcopy Index your code
hub / github.com/RustPython/RustPython / next_valid_char

Function next_valid_char

Lib/traceback.py:855–863  ·  view source on GitHub ↗

Gets the next valid character index in `lines`, if the current location is not valid. Handles empty lines.

(lineno, col)

Source from the content-addressed store, hash-verified

853 return _byte_offset_to_character_offset(lines[lineno], offset)
854
855 def next_valid_char(lineno, col):
856 """Gets the next valid character index in `lines`, if
857 the current location is not valid. Handles empty lines.
858 """
859 while lineno < len(lines) and col >= len(lines[lineno]):
860 col = 0
861 lineno += 1
862 assert lineno < len(lines) and col < len(lines[lineno])
863 return lineno, col
864
865 def increment(lineno, col):
866 """Get the next valid character index in `lines`."""

Callers 3

incrementFunction · 0.85
nextlineFunction · 0.85
setup_positionsFunction · 0.85

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected