Stores information about a generic block of code.
| 3020 | |
| 3021 | |
| 3022 | class _BlockInfo: |
| 3023 | """Stores information about a generic block of code.""" |
| 3024 | |
| 3025 | def __init__(self, linenum, seen_open_brace): |
| 3026 | self.starting_linenum = linenum |
| 3027 | self.seen_open_brace = seen_open_brace |
| 3028 | self.open_parentheses = 0 |
| 3029 | self.inline_asm = _NO_ASM |
| 3030 | self.check_namespace_indentation = False |
| 3031 | |
| 3032 | def CheckBegin(self, filename, clean_lines, linenum, error): |
| 3033 | """Run checks that applies to text up to the opening brace. |
| 3034 | |
| 3035 | This is mostly for checking the text after the class identifier |
| 3036 | and the "{", usually where the base class is specified. For other |
| 3037 | blocks, there isn't much to check, so we always pass. |
| 3038 | |
| 3039 | Args: |
| 3040 | filename: The name of the current file. |
| 3041 | clean_lines: A CleansedLines instance containing the file. |
| 3042 | linenum: The number of the line to check. |
| 3043 | error: The function to call with any errors found. |
| 3044 | """ |
| 3045 | pass |
| 3046 | |
| 3047 | def CheckEnd(self, filename, clean_lines, linenum, error): |
| 3048 | """Run checks that applies to text after the closing brace. |
| 3049 | |
| 3050 | This is mostly used for checking end of namespace comments. |
| 3051 | |
| 3052 | Args: |
| 3053 | filename: The name of the current file. |
| 3054 | clean_lines: A CleansedLines instance containing the file. |
| 3055 | linenum: The number of the line to check. |
| 3056 | error: The function to call with any errors found. |
| 3057 | """ |
| 3058 | pass |
| 3059 | |
| 3060 | def IsBlockInfo(self): |
| 3061 | """Returns true if this block is a _BlockInfo. |
| 3062 | |
| 3063 | This is convenient for verifying that an object is an instance of |
| 3064 | a _BlockInfo, but not an instance of any of the derived classes. |
| 3065 | |
| 3066 | Returns: |
| 3067 | True for this class, False for derived classes. |
| 3068 | """ |
| 3069 | return self.__class__ == _BlockInfo |
| 3070 | |
| 3071 | |
| 3072 | class _ExternCInfo(_BlockInfo): |
no outgoing calls
no test coverage detected
searching dependent graphs…