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)
| 4853 | |
| 4854 | |
| 4855 | def IsDerivedFunction(clean_lines, linenum): |
| 4856 | """Check if current line contains an inherited function. |
| 4857 | |
| 4858 | Args: |
| 4859 | clean_lines: A CleansedLines instance containing the file. |
| 4860 | linenum: The number of the line to check. |
| 4861 | Returns: |
| 4862 | True if current line contains a function with "override" |
| 4863 | virt-specifier. |
| 4864 | """ |
| 4865 | # Scan back a few lines for start of current function |
| 4866 | for i in range(linenum, max(-1, linenum - 10), -1): |
| 4867 | match = Match(r'^([^()]*\w+)\(', clean_lines.elided[i]) |
| 4868 | if match: |
| 4869 | # Look for "override" after the matching closing parenthesis |
| 4870 | line, _, closing_paren = CloseExpression( |
| 4871 | clean_lines, i, len(match.group(1))) |
| 4872 | return (closing_paren >= 0 and |
| 4873 | Search(r'\boverride\b', line[closing_paren:])) |
| 4874 | return False |
| 4875 | |
| 4876 | |
| 4877 | def IsOutOfLineMethodDefinition(clean_lines, linenum): |
no test coverage detected