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

Method scan

Lib/re/__init__.py:409–428  ·  view source on GitHub ↗
(self, string)

Source from the content-addressed store, hash-verified

407 p = _parser.SubPattern(s, [(BRANCH, (None, p))])
408 self.scanner = _compiler.compile(p)
409 def scan(self, string):
410 result = []
411 append = result.append
412 match = self.scanner.scanner(string).match
413 i = 0
414 while True:
415 m = match()
416 if not m:
417 break
418 j = m.end()
419 if i == j:
420 break
421 action = self.lexicon[m.lastindex-1][1]
422 if callable(action):
423 self.match = m
424 action = action(self, m.group())
425 if action is not None:
426 append(action)
427 i = j
428 return result, string[i:]

Callers 1

test_scannerMethod · 0.95

Calls 5

matchFunction · 0.85
callableFunction · 0.85
scannerMethod · 0.80
endMethod · 0.45
groupMethod · 0.45

Tested by 1

test_scannerMethod · 0.76