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)
| 6664 | |
| 6665 | |
| 6666 | def ExpectingFunctionArgs(clean_lines, linenum): |
| 6667 | """Checks whether where function type arguments are expected. |
| 6668 | |
| 6669 | Args: |
| 6670 | clean_lines: A CleansedLines instance containing the file. |
| 6671 | linenum: The number of the line to check. |
| 6672 | |
| 6673 | Returns: |
| 6674 | True if the line at 'linenum' is inside something that expects arguments |
| 6675 | of function types. |
| 6676 | """ |
| 6677 | line = clean_lines.elided[linenum] |
| 6678 | return re.match(r"^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(", line) or ( |
| 6679 | linenum >= 2 |
| 6680 | and ( |
| 6681 | re.match( |
| 6682 | r"^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$", |
| 6683 | clean_lines.elided[linenum - 1], |
| 6684 | ) |
| 6685 | or re.match( |
| 6686 | r"^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$", clean_lines.elided[linenum - 2] |
| 6687 | ) |
| 6688 | or re.search(r"\bstd::m?function\s*\<\s*$", clean_lines.elided[linenum - 1]) |
| 6689 | ) |
| 6690 | ) |
| 6691 | |
| 6692 | |
| 6693 | _HEADERS_CONTAINING_TEMPLATES: tuple[tuple[str, tuple[str, ...]], ...] = ( |