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)
| 4931 | |
| 4932 | |
| 4933 | def IsDerivedFunction(clean_lines, linenum): |
| 4934 | """Check if current line contains an inherited function. |
| 4935 | |
| 4936 | Args: |
| 4937 | clean_lines: A CleansedLines instance containing the file. |
| 4938 | linenum: The number of the line to check. |
| 4939 | Returns: |
| 4940 | True if current line contains a function with "override" |
| 4941 | virt-specifier. |
| 4942 | """ |
| 4943 | # Scan back a few lines for start of current function |
| 4944 | for i in xrange(linenum, max(-1, linenum - 10), -1): |
| 4945 | match = Match(r'^([^()]*\w+)\(', clean_lines.elided[i]) |
| 4946 | if match: |
| 4947 | # Look for "override" after the matching closing parenthesis |
| 4948 | line, _, closing_paren = CloseExpression( |
| 4949 | clean_lines, i, len(match.group(1))) |
| 4950 | return (closing_paren >= 0 and |
| 4951 | Search(r'\boverride\b', line[closing_paren:])) |
| 4952 | return False |
| 4953 | |
| 4954 | |
| 4955 | def IsOutOfLineMethodDefinition(clean_lines, linenum): |
no test coverage detected