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

Function parse_struct_body

Tools/c-analyzer/c_parser/parser/_compound_decl_body.py:29–48  ·  view source on GitHub ↗
(source, anon_name, parent)

Source from the content-addressed store, hash-verified

27
28
29def parse_struct_body(source, anon_name, parent):
30 done = False
31 while not done:
32 done = True
33 for srcinfo in source:
34 m = STRUCT_MEMBER_RE.match(srcinfo.text)
35 if m:
36 break
37 else:
38 # We ran out of lines.
39 if srcinfo is not None:
40 srcinfo.done()
41 return
42 for item in _parse_struct_next(m, srcinfo, anon_name, parent):
43 if callable(item):
44 parse_body = item
45 yield from parse_body(source)
46 else:
47 yield item
48 done = False
49
50
51def _parse_struct_next(m, srcinfo, anon_name, parent):

Callers

nothing calls this directly

Calls 4

_parse_struct_nextFunction · 0.85
parse_bodyFunction · 0.70
matchMethod · 0.45
doneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…