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

Function IsBlockInNameSpace

util/cpplint.py:5640–5658  ·  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

5638# Returns true if we are at a new block, and it is directly
5639# inside of a namespace.
5640def IsBlockInNameSpace(nesting_state, is_forward_declaration):
5641 """Checks that the new block is directly in a namespace.
5642
5643 Args:
5644 nesting_state: The _NestingState object that contains info about our state.
5645 is_forward_declaration: If the class is a forward declared class.
5646 Returns:
5647 Whether or not the new block is directly in a namespace.
5648 """
5649 if is_forward_declaration:
5650 if len(nesting_state.stack) >= 1 and (
5651 isinstance(nesting_state.stack[-1], _NamespaceInfo)):
5652 return True
5653 else:
5654 return False
5655
5656 return (len(nesting_state.stack) > 1 and
5657 nesting_state.stack[-1].check_namespace_indentation and
5658 isinstance(nesting_state.stack[-2], _NamespaceInfo))
5659
5660
5661def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected