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

Method getuntil

Lib/re/_parser.py:274–289  ·  view source on GitHub ↗
(self, terminator, name)

Source from the content-addressed store, hash-verified

272 self.__next()
273 return result
274 def getuntil(self, terminator, name):
275 result = ''
276 while True:
277 c = self.next
278 self.__next()
279 if c is None:
280 if not result:
281 raise self.error("missing " + name)
282 raise self.error("missing %s, unterminated name" % terminator,
283 len(result))
284 if c == terminator:
285 if not result:
286 raise self.error("missing " + name, 1)
287 break
288 result += c
289 return result
290 @property
291 def pos(self):
292 return self.index - len(self.next or '')

Callers 4

parse_templateFunction · 0.95
_class_escapeFunction · 0.80
_escapeFunction · 0.80
_parseFunction · 0.80

Calls 2

__nextMethod · 0.95
errorMethod · 0.95

Tested by

no test coverage detected