MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / ExpectingFunctionArgs

Function ExpectingFunctionArgs

util/cpplint.py:5246–5265  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

5244
5245
5246def ExpectingFunctionArgs(clean_lines, linenum):
5247 """Checks whether where function type arguments are expected.
5248
5249 Args:
5250 clean_lines: A CleansedLines instance containing the file.
5251 linenum: The number of the line to check.
5252
5253 Returns:
5254 True if the line at 'linenum' is inside something that expects arguments
5255 of function types.
5256 """
5257 line = clean_lines.elided[linenum]
5258 return (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or
5259 (linenum >= 2 and
5260 (Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$',
5261 clean_lines.elided[linenum - 1]) or
5262 Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$',
5263 clean_lines.elided[linenum - 2]) or
5264 Search(r'\bstd::m?function\s*\<\s*$',
5265 clean_lines.elided[linenum - 1]))))
5266
5267
5268_HEADERS_CONTAINING_TEMPLATES = (

Callers 1

CheckCastsFunction · 0.85

Calls 2

MatchFunction · 0.85
SearchFunction · 0.85

Tested by

no test coverage detected