Return True if FL_NOEXCEPT / noexcept appears between ')' and body/';'.
(lines: list[str], start: int, open_paren: int)
| 275 | |
| 276 | |
| 277 | def signature_has_noexcept(lines: list[str], start: int, open_paren: int) -> bool: |
| 278 | """Return True if FL_NOEXCEPT / noexcept appears between ')' and body/';'.""" |
| 279 | close_line, close_col = _find_close_paren_multiline(lines, start, open_paren) |
| 280 | if close_line < 0: |
| 281 | return False # can't find closing paren, skip |
| 282 | |
| 283 | # Check remainder of the line containing ')' |
| 284 | tail = lines[close_line][close_col + 1 :] |
| 285 | if _HAS_NOEXCEPT.search(tail): |
| 286 | return True |
| 287 | |
| 288 | # Check up to 5 continuation lines |
| 289 | for j in range(1, 6): |
| 290 | idx = close_line + j |
| 291 | if idx >= len(lines): |
| 292 | break |
| 293 | nxt = lines[idx].strip() |
| 294 | if _HAS_NOEXCEPT.search(nxt): |
| 295 | return True |
| 296 | # Stop at statement/body terminators |
| 297 | if nxt.startswith("{") or nxt.endswith("{") or nxt == "};": |
| 298 | break |
| 299 | if nxt.startswith(":") and not nxt.startswith("::"): |
| 300 | break # member-init list |
| 301 | if nxt.endswith(";"): |
| 302 | break |
| 303 | |
| 304 | return False |
| 305 | |
| 306 | |
| 307 | # ── Checker class ─────────────────────────────────────────────────────────── |