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)
| 5866 | |
| 5867 | |
| 5868 | def ExpectingFunctionArgs(clean_lines, linenum): |
| 5869 | """Checks whether where function type arguments are expected. |
| 5870 | |
| 5871 | Args: |
| 5872 | clean_lines: A CleansedLines instance containing the file. |
| 5873 | linenum: The number of the line to check. |
| 5874 | |
| 5875 | Returns: |
| 5876 | True if the line at 'linenum' is inside something that expects arguments |
| 5877 | of function types. |
| 5878 | """ |
| 5879 | line = clean_lines.elided[linenum] |
| 5880 | return (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or |
| 5881 | (linenum >= 2 and |
| 5882 | (Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$', |
| 5883 | clean_lines.elided[linenum - 1]) or |
| 5884 | Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$', |
| 5885 | clean_lines.elided[linenum - 2]) or |
| 5886 | Search(r'\bstd::m?function\s*\<\s*$', |
| 5887 | clean_lines.elided[linenum - 1])))) |
| 5888 | |
| 5889 | |
| 5890 | _HEADERS_CONTAINING_TEMPLATES = ( |
no test coverage detected