MCPcopy Create free account
hub / github.com/alibaba/GraphScope / ExpectingFunctionArgs

Function ExpectingFunctionArgs

analytical_engine/misc/cpplint.py:5868–5887  ·  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

5866
5867
5868def 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 = (

Callers 1

CheckCastsFunction · 0.85

Calls 2

SearchFunction · 0.85
MatchFunction · 0.70

Tested by

no test coverage detected