MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / IsBlockInNameSpace

Function IsBlockInNameSpace

src/tests/coding/cpplint.py:6275–6291  ·  view source on GitHub ↗

Checks that the new block is directly in a namespace. Args: nesting_state: The _NestingState object that contains info about our state. is_forward_declaration: If the class is a forward declared class. Returns: Whether or not the new block is directly in a namespace.

(nesting_state, is_forward_declaration)

Source from the content-addressed store, hash-verified

6273# Returns true if we are at a new block, and it is directly
6274# inside of a namespace.
6275def IsBlockInNameSpace(nesting_state, is_forward_declaration):
6276 """Checks that the new block is directly in a namespace.
6277
6278 Args:
6279 nesting_state: The _NestingState object that contains info about our state.
6280 is_forward_declaration: If the class is a forward declared class.
6281 Returns:
6282 Whether or not the new block is directly in a namespace.
6283 """
6284 if is_forward_declaration:
6285 return len(nesting_state.stack) >= 1 and (
6286 isinstance(nesting_state.stack[-1], _NamespaceInfo))
6287
6288
6289 return (len(nesting_state.stack) > 1 and
6290 nesting_state.stack[-1].check_namespace_indentation and
6291 isinstance(nesting_state.stack[-2], _NamespaceInfo))
6292
6293
6294def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected