Checks whether where function type arguments are expected. Args: clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. Returns: True if the line at 'linenum' is inside something that expects arguments of function types.
(clean_lines, linenum)
| 6808 | |
| 6809 | |
| 6810 | def ExpectingFunctionArgs(clean_lines, linenum): |
| 6811 | """Checks whether where function type arguments are expected. |
| 6812 | |
| 6813 | Args: |
| 6814 | clean_lines: A CleansedLines instance containing the file. |
| 6815 | linenum: The number of the line to check. |
| 6816 | |
| 6817 | Returns: |
| 6818 | True if the line at 'linenum' is inside something that expects arguments |
| 6819 | of function types. |
| 6820 | """ |
| 6821 | line = clean_lines.elided[linenum] |
| 6822 | return re.match(r"^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(", line) or ( |
| 6823 | linenum >= 2 |
| 6824 | and ( |
| 6825 | re.match( |
| 6826 | r"^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$", |
| 6827 | clean_lines.elided[linenum - 1], |
| 6828 | ) |
| 6829 | or re.match( |
| 6830 | r"^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$", clean_lines.elided[linenum - 2] |
| 6831 | ) |
| 6832 | or re.search(r"\bstd::m?function\s*\<\s*$", clean_lines.elided[linenum - 1]) |
| 6833 | ) |
| 6834 | ) |
| 6835 | |
| 6836 | |
| 6837 | _HEADERS_CONTAINING_TEMPLATES: tuple[tuple[str, tuple[str, ...]], ...] = ( |
no test coverage detected
searching dependent graphs…