MCPcopy Create free account
hub / github.com/FastLED/FastLED / signature_has_noexcept

Function signature_has_noexcept

ci/lint_cpp/noexcept_special_members_checker.py:277–304  ·  view source on GitHub ↗

Return True if FL_NOEXCEPT / noexcept appears between ')' and body/';'.

(lines: list[str], start: int, open_paren: int)

Source from the content-addressed store, hash-verified

275
276
277def 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 ───────────────────────────────────────────────────────────

Callers 6

test_same_lineMethod · 0.90
test_next_lineMethod · 0.90
check_file_contentMethod · 0.70
fix_fileFunction · 0.70

Calls 1

Tested by 4

test_same_lineMethod · 0.72
test_next_lineMethod · 0.72