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

Function log_match

Tools/c-analyzer/c_parser/parser/_common.py:10–28  ·  view source on GitHub ↗
(group, m, depth_before=None, depth_after=None)

Source from the content-addressed store, hash-verified

8
9
10def log_match(group, m, depth_before=None, depth_after=None):
11 from . import _logger
12
13 if m is not None:
14 text = m.group(0)
15 if text.startswith(('(', ')')) or text.endswith(('(', ')')):
16 _logger.debug(f'matched <{group}> ({text!r})')
17 else:
18 _logger.debug(f'matched <{group}> ({text})')
19
20 elif depth_before is not None or depth_after is not None:
21 if depth_before is None:
22 depth_before = '???'
23 elif depth_after is None:
24 depth_after = '???'
25 _logger.log(1, f'depth: %s -> %s', depth_before, depth_after)
26
27 else:
28 raise NotImplementedError('this should not have been hit')
29
30
31#############################

Callers 4

parse_function_bodyFunction · 0.85
_parse_next_local_staticFunction · 0.85
_parse_struct_nextFunction · 0.85
_parse_nextFunction · 0.85

Calls 5

groupMethod · 0.45
startswithMethod · 0.45
endswithMethod · 0.45
debugMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…