(line, reqfile=None)
| 217 | |
| 218 | |
| 219 | def _parse_marker_line(line, reqfile=None): |
| 220 | m = LINE_MARKER_RE.match(line) |
| 221 | if not m: |
| 222 | return None, None, None |
| 223 | lno, origfile, flags = m.groups() |
| 224 | lno = int(lno) |
| 225 | assert origfile not in META_FILES, (line,) |
| 226 | assert lno > 0, (line, lno) |
| 227 | flags = set(int(f) for f in flags.split()) if flags else () |
| 228 | |
| 229 | if 1 in flags: |
| 230 | # We're entering a file. |
| 231 | assert lno == 1, (line, lno) |
| 232 | assert 2 not in flags, (line,) |
| 233 | elif 2 in flags: |
| 234 | # We're returning to a file. |
| 235 | #assert lno > 1, (line, lno) |
| 236 | pass |
| 237 | elif reqfile and origfile == reqfile: |
| 238 | # We're starting the requested file. |
| 239 | assert lno == 1, (line, lno) |
| 240 | assert not flags, (line, flags) |
| 241 | else: |
| 242 | # It's the next line from the file. |
| 243 | assert lno > 1, (line, lno) |
| 244 | return lno, origfile, flags |
| 245 | |
| 246 | |
| 247 | def _strip_directives(line, partial=0): |
no test coverage detected
searching dependent graphs…