MCPcopy Create free account
hub / github.com/apache/mesos / IsBlockInNameSpace

Function IsBlockInNameSpace

support/cpplint.py:5718–5736  ·  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

5716# Returns true if we are at a new block, and it is directly
5717# inside of a namespace.
5718def IsBlockInNameSpace(nesting_state, is_forward_declaration):
5719 """Checks that the new block is directly in a namespace.
5720
5721 Args:
5722 nesting_state: The _NestingState object that contains info about our state.
5723 is_forward_declaration: If the class is a forward declared class.
5724 Returns:
5725 Whether or not the new block is directly in a namespace.
5726 """
5727 if is_forward_declaration:
5728 if len(nesting_state.stack) >= 1 and (
5729 isinstance(nesting_state.stack[-1], _NamespaceInfo)):
5730 return True
5731 else:
5732 return False
5733
5734 return (len(nesting_state.stack) > 1 and
5735 nesting_state.stack[-1].check_namespace_indentation and
5736 isinstance(nesting_state.stack[-2], _NamespaceInfo))
5737
5738
5739def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected