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)
| 5472 | |
| 5473 | |
| 5474 | def IsDerivedFunction(clean_lines, linenum): |
| 5475 | """Check if current line contains an inherited function. |
| 5476 | |
| 5477 | Args: |
| 5478 | clean_lines: A CleansedLines instance containing the file. |
| 5479 | linenum: The number of the line to check. |
| 5480 | Returns: |
| 5481 | True if current line contains a function with "override" |
| 5482 | virt-specifier. |
| 5483 | """ |
| 5484 | # Scan back a few lines for start of current function |
| 5485 | for i in xrange(linenum, max(-1, linenum - 10), -1): |
| 5486 | match = Match(r'^([^()]*\w+)\(', clean_lines.elided[i]) |
| 5487 | if match: |
| 5488 | # Look for "override" after the matching closing parenthesis |
| 5489 | line, _, closing_paren = CloseExpression( |
| 5490 | clean_lines, i, len(match.group(1))) |
| 5491 | return (closing_paren >= 0 and |
| 5492 | Search(r'\boverride\b', line[closing_paren:])) |
| 5493 | return False |
| 5494 | |
| 5495 | |
| 5496 | def IsOutOfLineMethodDefinition(clean_lines, linenum): |
no test coverage detected