MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / IsBlockInNameSpace

Function IsBlockInNameSpace

steps/cpplint.py:6288–6304  ·  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

6286# Returns true if we are at a new block, and it is directly
6287# inside of a namespace.
6288def IsBlockInNameSpace(nesting_state, is_forward_declaration):
6289 """Checks that the new block is directly in a namespace.
6290
6291 Args:
6292 nesting_state: The _NestingState object that contains info about our state.
6293 is_forward_declaration: If the class is a forward declared class.
6294 Returns:
6295 Whether or not the new block is directly in a namespace.
6296 """
6297 if is_forward_declaration:
6298 return len(nesting_state.stack) >= 1 and (
6299 isinstance(nesting_state.stack[-1], _NamespaceInfo))
6300
6301
6302 return (len(nesting_state.stack) > 1 and
6303 nesting_state.stack[-1].check_namespace_indentation and
6304 isinstance(nesting_state.stack[-2], _NamespaceInfo))
6305
6306
6307def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected