MCPcopy Create free account
hub / github.com/alibaba/GraphScope / IsBlockInNameSpace

Function IsBlockInNameSpace

analytical_engine/misc/cpplint.py:6278–6294  ·  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

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected