Function
parse_enum_body
(source, _anon_name, _parent)
Source from the content-addressed store, hash-verified
| 125 | |
| 126 | |
| 127 | def 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
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…