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