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)
| 6232 | |
| 6233 | |
| 6234 | def IsDerivedFunction(clean_lines, linenum): |
| 6235 | """Check if current line contains an inherited function. |
| 6236 | |
| 6237 | Args: |
| 6238 | clean_lines: A CleansedLines instance containing the file. |
| 6239 | linenum: The number of the line to check. |
| 6240 | Returns: |
| 6241 | True if current line contains a function with "override" |
| 6242 | virt-specifier. |
| 6243 | """ |
| 6244 | # Scan back a few lines for start of current function |
| 6245 | for i in range(linenum, max(-1, linenum - 10), -1): |
| 6246 | match = re.match(r"^([^()]*\w+)\(", clean_lines.elided[i]) |
| 6247 | if match: |
| 6248 | # Look for "override" after the matching closing parenthesis |
| 6249 | line, _, closing_paren = CloseExpression(clean_lines, i, len(match.group(1))) |
| 6250 | return closing_paren >= 0 and re.search(r"\boverride\b", line[closing_paren:]) |
| 6251 | return False |
| 6252 | |
| 6253 | |
| 6254 | def IsOutOfLineMethodDefinition(clean_lines, linenum): |
no test coverage detected