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

Function parse_enum_body

Tools/c-analyzer/c_parser/parser/_compound_decl_body.py:127–149  ·  view source on GitHub ↗
(source, _anon_name, _parent)

Source from the content-addressed store, hash-verified

125
126
127def parse_enum_body(source, _anon_name, _parent):
128 ending = None
129 while ending != '}':
130 for srcinfo in source:
131 m = ENUM_MEMBER_RE.match(srcinfo.text)
132 if m:
133 break
134 else:
135 # We ran out of lines.
136 if srcinfo is not None:
137 srcinfo.done()
138 return
139 remainder = srcinfo.text[m.end():]
140
141 (close,
142 name, init, ending,
143 ) = m.groups()
144 if close:
145 ending = '}'
146 else:
147 data = init
148 yield srcinfo.resolve('field', data, name, _parent)
149 srcinfo.advance(remainder)
150
151
152#############################

Callers

nothing calls this directly

Calls 6

matchMethod · 0.45
doneMethod · 0.45
endMethod · 0.45
groupsMethod · 0.45
resolveMethod · 0.45
advanceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…