@@ 5479-5498 (lines=20) @@ | ||
5476 | return True |
|
5477 | ||
5478 | ||
5479 | def ExpectingFunctionArgs(clean_lines, linenum): |
|
5480 | """Checks whether where function type arguments are expected. |
|
5481 | ||
5482 | Args: |
|
5483 | clean_lines: A CleansedLines instance containing the file. |
|
5484 | linenum: The number of the line to check. |
|
5485 | ||
5486 | Returns: |
|
5487 | True if the line at 'linenum' is inside something that expects arguments |
|
5488 | of function types. |
|
5489 | """ |
|
5490 | line = clean_lines.elided[linenum] |
|
5491 | return (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or |
|
5492 | (linenum >= 2 and |
|
5493 | (Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$', |
|
5494 | clean_lines.elided[linenum - 1]) or |
|
5495 | Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$', |
|
5496 | clean_lines.elided[linenum - 2]) or |
|
5497 | Search(r'\bstd::m?function\s*\<\s*$', |
|
5498 | clean_lines.elided[linenum - 1])))) |
|
5499 | ||
5500 | ||
5501 | _HEADERS_CONTAINING_TEMPLATES = ( |
@@ 5479-5498 (lines=20) @@ | ||
5476 | return True |
|
5477 | ||
5478 | ||
5479 | def ExpectingFunctionArgs(clean_lines, linenum): |
|
5480 | """Checks whether where function type arguments are expected. |
|
5481 | ||
5482 | Args: |
|
5483 | clean_lines: A CleansedLines instance containing the file. |
|
5484 | linenum: The number of the line to check. |
|
5485 | ||
5486 | Returns: |
|
5487 | True if the line at 'linenum' is inside something that expects arguments |
|
5488 | of function types. |
|
5489 | """ |
|
5490 | line = clean_lines.elided[linenum] |
|
5491 | return (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or |
|
5492 | (linenum >= 2 and |
|
5493 | (Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$', |
|
5494 | clean_lines.elided[linenum - 1]) or |
|
5495 | Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$', |
|
5496 | clean_lines.elided[linenum - 2]) or |
|
5497 | Search(r'\bstd::m?function\s*\<\s*$', |
|
5498 | clean_lines.elided[linenum - 1])))) |
|
5499 | ||
5500 | ||
5501 | _HEADERS_CONTAINING_TEMPLATES = ( |