MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / scan

Method scan

tools/python-3.11.9-amd64/Lib/re/__init__.py:355–374  ·  view source on GitHub ↗
(self, string)

Source from the content-addressed store, hash-verified

353 p = _parser.SubPattern(s, [(BRANCH, (None, p))])
354 self.scanner = _compiler.compile(p)
355 def scan(self, string):
356 result = []
357 append = result.append
358 match = self.scanner.scanner(string).match
359 i = 0
360 while True:
361 m = match()
362 if not m:
363 break
364 j = m.end()
365 if i == j:
366 break
367 action = self.lexicon[m.lastindex-1][1]
368 if callable(action):
369 self.match = m
370 action = action(self, m.group())
371 if action is not None:
372 append(action)
373 i = j
374 return result, string[i:]

Callers

nothing calls this directly

Calls 5

matchFunction · 0.85
callableFunction · 0.50
appendClass · 0.50
endMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected