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)
| 6286 | # Returns true if we are at a new block, and it is directly |
| 6287 | # inside of a namespace. |
| 6288 | def 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 | |
| 6307 | def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item, |
no outgoing calls
no test coverage detected