MCPcopy Index your code
hub / github.com/python/cpython / eow

Method eow

Lib/_pyrepl/reader.py:428–442  ·  view source on GitHub ↗

Return the 0-based index of the word break following p most immediately. p defaults to self.pos; word boundaries are determined using self.syntax_table.

(self, p: int | None = None)

Source from the content-addressed store, hash-verified

426 return p + 1
427
428 def eow(self, p: int | None = None) -> int:
429 """Return the 0-based index of the word break following p most
430 immediately.
431
432 p defaults to self.pos; word boundaries are determined using
433 self.syntax_table."""
434 if p is None:
435 p = self.pos
436 st = self.syntax_table
437 b = self.buffer
438 while p < len(b) and st.get(b[p], SYNTAX_WORD) != SYNTAX_WORD:
439 p += 1
440 while p < len(b) and st.get(b[p], SYNTAX_WORD) == SYNTAX_WORD:
441 p += 1
442 return p
443
444 def bol(self, p: int | None = None) -> int:
445 """Return the 0-based index of the line break preceding p most

Callers 2

doMethod · 0.80
doMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected