Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found.
(self, filename, error)
| 3247 | return None |
| 3248 | |
| 3249 | def CheckCompletedBlocks(self, filename, error): |
| 3250 | """Checks that all classes and namespaces have been completely parsed. |
| 3251 | |
| 3252 | Call this when all lines in a file have been processed. |
| 3253 | Args: |
| 3254 | filename: The name of the current file. |
| 3255 | error: The function to call with any errors found. |
| 3256 | """ |
| 3257 | # Note: This test can result in false positives if #ifdef constructs |
| 3258 | # get in the way of brace matching. See the testBuildClass test in |
| 3259 | # cpplint_unittest.py for an example of this. |
| 3260 | for obj in self.stack: |
| 3261 | if isinstance(obj, _ClassInfo): |
| 3262 | error(filename, obj.starting_linenum, 'build/class', 5, |
| 3263 | 'Failed to find complete declaration of class %s' % |
| 3264 | obj.name) |
| 3265 | elif isinstance(obj, _NamespaceInfo): |
| 3266 | error(filename, obj.starting_linenum, 'build/namespaces', 5, |
| 3267 | 'Failed to find complete declaration of namespace %s' % |
| 3268 | obj.name) |
| 3269 | |
| 3270 | |
| 3271 | def CheckForNonStandardConstructs(filename, clean_lines, linenum, |