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

Method bol

Lib/_pyrepl/reader.py:494–505  ·  view source on GitHub ↗

Return the 0-based index of the line break preceding p most immediately. p defaults to self.pos.

(self, p: int | None = None)

Source from the content-addressed store, hash-verified

492 return p
493
494 def bol(self, p: int | None = None) -> int:
495 """Return the 0-based index of the line break preceding p most
496 immediately.
497
498 p defaults to self.pos."""
499 if p is None:
500 p = self.pos
501 b = self.buffer
502 p -= 1
503 while p >= 0 and b[p] != "\n":
504 p -= 1
505 return p + 1
506
507 def eol(self, p: int | None = None) -> int:
508 """Return the 0-based index of the line break following p most

Callers 4

doMethod · 0.80
doMethod · 0.80
doMethod · 0.80
doMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected