MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / _has_function_ancestor

Function _has_function_ancestor

scripts/code_verify_rules.py:2240–2249  ·  view source on GitHub ↗

True when `node` is nested inside another function_definition -- typically a lambda body or an inline helper. Such nodes inherit the enclosing function's @brief.

(node)

Source from the content-addressed store, hash-verified

2238
2239
2240def _has_function_ancestor(node) -> bool:
2241 """True when `node` is nested inside another function_definition --
2242 typically a lambda body or an inline helper. Such nodes inherit the
2243 enclosing function's @brief."""
2244 parent = node.parent
2245 while parent is not None:
2246 if parent.type in ("function_definition", "lambda_expression"):
2247 return True
2248 parent = parent.parent
2249 return False
2250
2251
2252def _comment_in_function_body(node) -> bool:

Callers 1

_cpp_rulesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected