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)
| 6376 | |
| 6377 | |
| 6378 | def IsDerivedFunction(clean_lines, linenum): |
| 6379 | """Check if current line contains an inherited function. |
| 6380 | |
| 6381 | Args: |
| 6382 | clean_lines: A CleansedLines instance containing the file. |
| 6383 | linenum: The number of the line to check. |
| 6384 | Returns: |
| 6385 | True if current line contains a function with "override" |
| 6386 | virt-specifier. |
| 6387 | """ |
| 6388 | # Scan back a few lines for start of current function |
| 6389 | for i in range(linenum, max(-1, linenum - 10), -1): |
| 6390 | match = re.match(r"^([^()]*\w+)\(", clean_lines.elided[i]) |
| 6391 | if match: |
| 6392 | # Look for "override" after the matching closing parenthesis |
| 6393 | line, _, closing_paren = CloseExpression(clean_lines, i, len(match.group(1))) |
| 6394 | return closing_paren >= 0 and re.search(r"\boverride\b", line[closing_paren:]) |
| 6395 | return False |
| 6396 | |
| 6397 | |
| 6398 | def IsOutOfLineMethodDefinition(clean_lines, linenum): |
no test coverage detected
searching dependent graphs…