| @@ 5878-5894 (lines=17) @@ | ||
| 5875 | ||
| 5876 | # Returns true if we are at a new block, and it is directly |
|
| 5877 | # inside of a namespace. |
|
| 5878 | def IsBlockInNameSpace(nesting_state, is_forward_declaration): |
|
| 5879 | """Checks that the new block is directly in a namespace. |
|
| 5880 | ||
| 5881 | Args: |
|
| 5882 | nesting_state: The _NestingState object that contains info about our state. |
|
| 5883 | is_forward_declaration: If the class is a forward declared class. |
|
| 5884 | Returns: |
|
| 5885 | Whether or not the new block is directly in a namespace. |
|
| 5886 | """ |
|
| 5887 | if is_forward_declaration: |
|
| 5888 | return len(nesting_state.stack) >= 1 and ( |
|
| 5889 | isinstance(nesting_state.stack[-1], _NamespaceInfo)) |
|
| 5890 | ||
| 5891 | ||
| 5892 | return (len(nesting_state.stack) > 1 and |
|
| 5893 | nesting_state.stack[-1].check_namespace_indentation and |
|
| 5894 | isinstance(nesting_state.stack[-2], _NamespaceInfo)) |
|
| 5895 | ||
| 5896 | ||
| 5897 | def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item, |
|
| @@ 5878-5894 (lines=17) @@ | ||
| 5875 | ||
| 5876 | # Returns true if we are at a new block, and it is directly |
|
| 5877 | # inside of a namespace. |
|
| 5878 | def IsBlockInNameSpace(nesting_state, is_forward_declaration): |
|
| 5879 | """Checks that the new block is directly in a namespace. |
|
| 5880 | ||
| 5881 | Args: |
|
| 5882 | nesting_state: The _NestingState object that contains info about our state. |
|
| 5883 | is_forward_declaration: If the class is a forward declared class. |
|
| 5884 | Returns: |
|
| 5885 | Whether or not the new block is directly in a namespace. |
|
| 5886 | """ |
|
| 5887 | if is_forward_declaration: |
|
| 5888 | return len(nesting_state.stack) >= 1 and ( |
|
| 5889 | isinstance(nesting_state.stack[-1], _NamespaceInfo)) |
|
| 5890 | ||
| 5891 | ||
| 5892 | return (len(nesting_state.stack) > 1 and |
|
| 5893 | nesting_state.stack[-1].check_namespace_indentation and |
|
| 5894 | isinstance(nesting_state.stack[-2], _NamespaceInfo)) |
|
| 5895 | ||
| 5896 | ||
| 5897 | def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item, |
|