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