Check if current line contains an inherited function. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if current line contains a function with "override" virt-specifier.
(clean_lines, linenum)
| 5181 | |
| 5182 | |
| 5183 | def IsDerivedFunction(clean_lines, linenum): |
| 5184 | """Check if current line contains an inherited function. |
| 5185 | |
| 5186 | Args: |
| 5187 | clean_lines: A CleansedLines instance containing the file. |
| 5188 | linenum: The number of the line to check. |
| 5189 | Returns: |
| 5190 | True if current line contains a function with "override" |
| 5191 | virt-specifier. |
| 5192 | """ |
| 5193 | # Scan back a few lines for start of current function |
| 5194 | for i in xrange(linenum, max(-1, linenum - 10), -1): |
| 5195 | match = Match(r'^([^()]*\w+)\(', clean_lines.elided[i]) |
| 5196 | if match: |
| 5197 | # Look for "override" after the matching closing parenthesis |
| 5198 | line, _, closing_paren = CloseExpression( |
| 5199 | clean_lines, i, len(match.group(1))) |
| 5200 | return (closing_paren >= 0 and |
| 5201 | Search(r'\boverride\b', line[closing_paren:])) |
| 5202 | return False |
| 5203 | |
| 5204 | |
| 5205 | def IsOutOfLineMethodDefinition(clean_lines, linenum): |
no test coverage detected