Lines Matching refs:r
324 r'[ =()](' + ('|'.join(_ALT_TOKEN_REPLACEMENT.keys())) + r')(?=[ (]|$)')
342 _MATCH_ASM = re.compile(r'^\s*(?:asm|_asm|__asm|__asm__)'
343 r'(?:\s+(volatile|__volatile__))?'
344 r'\s*[{(]')
350 _RE_SUPPRESSION = re.compile(r'\bNOLINT\b(\([^)]*\))?')
712 if Match(r'T(EST|est)', self.current_function):
896 r'\\([abfnrtv?"\\\']|\d+|x[0-9a-fA-F]+)')
898 _RE_PATTERN_CLEANSE_LINE_DOUBLE_QUOTES = re.compile(r'"[^"]*"')
900 _RE_PATTERN_CLEANSE_LINE_SINGLE_QUOTES = re.compile(r"'.'")
910 r"""(\s*/\*.*\*/\s*$|
929 line = line.replace(r'\\', 'XX') # after this, \\" does not match to \"
930 return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1
1111 if re.search(r'Copyright', lines[line], re.I): break
1132 filename = re.sub(r'_flymake\.h$', '.h', filename)
1133 filename = re.sub(r'/\.flymake/([^/]*)$', r'/\1', filename)
1139 return re.sub(r'[-./\s]', '_', file_path_from_root).upper() + '_'
1339 r'^\s*\*\w+(\+\+|--);')
1458 and not Match(r'};*\s*(//|/\*).*\bnamespace\b', line)):
1475 if not Match((r'};*\s*(//|/\*).*\bnamespace\s+' + re.escape(self.name) +
1476 r'[\*/\.\\\s]*$'),
1483 if not Match(r'};*\s*(//|/\*).*\bnamespace[\*/\.\\\s]*$', line):
1556 if Match(r'^\s*#\s*(if|ifdef|ifndef)\b', line):
1560 elif Match(r'^\s*#\s*(else|elif)\b', line):
1575 elif Match(r'^\s*#\s*endif\b', line):
1636 namespace_decl_match = Match(r'^\s*namespace\b\s*([:\w]+)?(.*)$', line)
1670 r'\s*(template\s*<[\w\s<>,:]*>\s*)?'
1687 access_match = Match(r'\s*(public|private|protected)\s*:', line)
1694 matched = Match(r'^[^{;)}]*([{;)}])(.*)$', line)
1789 if Search(r'printf\s*\(.*".*%[-+ ]?\d*q', line):
1793 if Search(r'printf\s*\(.*".*%\d+\$', line):
1800 if Search(r'("|\').*\\(%|\[|\(|{)', line):
1807 if Search(r'\b(const|volatile|void|char|short|int|long'
1808 r'|float|double|signed|unsigned'
1809 r'|schar|u?int8|u?int16|u?int32|u?int64)'
1810 r'\s+(register|static|extern|typedef)\b',
1815 if Match(r'\s*#\s*endif\s*[^/\s]+', line):
1819 if Match(r'\s*class\s+(\w+\s*::\s*)+\w+\s*;', line):
1823 if Search(r'(\w+|[+-]?\d+(\.\d*)?)\s*(<|>)\?=?\s*(\w+|[+-]?\d+)(\.\d*)?',
1828 if Search(r'^\s*const\s*string\s*&\s*\w+\s*;', line):
1853 args = Match(r'\s+(?:inline\s+)?%s\s*\(([^,()]+)\)'
1858 not Match(r'(const\s+)?%s\s*(?:<\w+>\s*)?&' % re.escape(base_classname),
1879 for pattern in (r'\bif\s*\((.*)\)\s*{',
1880 r'\bfor\s*\((.*)\)\s*{',
1881 r'\bwhile\s*\((.*)\)\s*[{;]',
1882 r'\bswitch\s*\((.*)\)\s*{'):
1904 not Search(r'\b(if|for|while|switch|return|delete|new)\b', fncall) and
1907 not Search(r' \([^)]+\)\([^)]*(\)|,$)', fncall) and
1909 not Search(r' \([^)]+\)\[[^\]]+\]', fncall)):
1910 if Search(r'\w\s*\(\s(?!\s*\\$)', fncall): # a ( used for a fn call
1913 elif Search(r'\(\s+(?!(\s*\\)|\()', fncall):
1916 if (Search(r'\w\s+\(', fncall) and
1917 not Search(r'#\s*define|typedef', fncall) and
1918 not Search(r'\w\s+\((\w+::)?\*\w+\)\(', fncall)):
1923 if Search(r'[^)]\s+\)\s*[^{\s]', fncall):
1926 if Search(r'^\s+\)', fncall):
1979 regexp = r'(\w(\w|::|\*|\&|\s)*)\(' # decls * & space::name( ...
1986 not Match(r'[A-Z_]+$', function_name)):
1994 if Search(r'(;|})', start_line): # Declarations and trivial functions
1997 elif Search(r'{', start_line):
1999 function = Search(r'((\w|:)*)\(', line).group(1)
2000 if Match(r'TEST', function): # Handle TEST... macros
2001 parameter_regexp = Search(r'(\(.*\))', joined_line)
2012 elif Match(r'^\}\s*$', line): # function end
2015 elif not Match(r'^\s*$', line):
2019 _RE_PATTERN_TODO = re.compile(r'^//(\s*)TODO(\(.+?\))?:?(\s|$)?')
2064 matched = Match((r'\s*(DISALLOW_COPY_AND_ASSIGN|'
2065 r'DISALLOW_EVIL_CONSTRUCTORS|'
2066 r'DISALLOW_IMPLICIT_CONSTRUCTORS)'), line)
2105 match = Search(r'^[^<>(),;\[\]]*([<>(),;\[\]])(.*)$', line)
2167 match = Search(r'^(.*)([<>(),;\[\]])[^<>(),;\[\]]*$', line)
2259 if Match(r' {6}\w', prev_line): # Initializer list?
2264 and Match(r' {6}\w', elided[search_position])):
2275 exception = (Match(r' {4}\w[^\(]*\)\s*(const\s*)?(\{\s*$|:)',
2277 or Match(r' {4}:', prev_line))
2293 and Match(r'\s*}', next_line)
2298 matched = Match(r'\s*(public|protected|private):', prev_line)
2311 if (not Match(r'^\s*{ //', line) and
2328 match = (Search(r'[=/-]{4,}\s*$', line[commentend:]) or
2329 Search(r'^/$', line[commentend:]) or
2330 Search(r'^/+ ', line[commentend:]))
2339 line = re.sub(r'operator(==|!=|<|<<|<=|>=|>>|>)\(', 'operator\(', line)
2345 if Search(r'[\w.]=[\w.]', line) and not Search(r'\b(if|while) ', line):
2357 match = Search(r'[^<>=!\s](==|!=|<=|>=)[^<>=!\s]', line)
2363 match = Search(r'(\S)(?:L|UL|ULL|l|ul|ull)?<<(\S)', line)
2367 elif not Match(r'#.*include', line):
2375 match = Search(r'[^\s<]<([^\s=<].*)', reduced_line)
2384 match = Search(r'^(.*[^\s>])>[^\s=>]', reduced_line)
2403 match = Search(r'>>[a-zA-Z_]', line)
2409 match = Search(r'(!\s|~\s|[\s]--[\s;]|[\s]\+\+[\s;])', line)
2415 match = Search(r' (if\(|for\(|while\(|switch\()', line)
2425 match = Search(r'\b(if|for|while|switch)\s*'
2426 r'\(([ ]*)(.).*[^ ]+([ ]*)\)\s*{\s*$',
2432 not match.group(2) and Search(r'\bfor\s*\(.*; \)', line)):
2441 if Search(r',[^\s]', line):
2449 if Search(r';[^\s};\\)/]', line):
2460 if Search(r'[^ ({]{', line):
2465 if Search(r'}else', line):
2471 if Search(r'\w\s+\[', line) and not Search(r'delete\s+\[', line):
2478 if Search(r':\s*;\s*$', line):
2481 elif Search(r'^\s*;\s*$', line):
2485 elif (Search(r'\s+;\s*$', line) and
2486 not Search(r'\bfor\b', line)):
2526 matched = Match(r'\s*(public|protected|private):', clean_lines.lines[linenum])
2538 not Search(r'\b(class|struct)\b', prev_line) and
2539 not Search(r'\\$', prev_line)):
2546 if Search(r'\{\s*$', clean_lines.lines[i]):
2589 if Match(r'\s*{\s*$', line):
2598 if (not Search(r'[;:}{]\s*$', prevline) and
2599 not Match(r'\s*#', prevline)):
2604 if Match(r'\s*else\s*', line):
2606 if Match(r'\s*}\s*$', prevline):
2612 if Search(r'}\s*else[^{]*$', line) or Match(r'[^}]*else\s*{', line):
2613 if Search(r'}\s*else if([^{]*)$', line): # could be multi-line if
2627 if Search(r'\belse [^\s{]', line) and not Search(r'\belse if\b', line):
2632 if Match(r'\s*do [^\s{]', line):
2642 if Match(r'\s+{.*}\s*;', line) and not prevline.count(';'):
2646 if (Search(r'{.*}\s*;', line) and
2648 not Search(r'struct|class|enum|\s*=\s*{', line)):
2667 if Match(r'\s*(for|while)\s*\(', line):
2675 if end_pos >= 0 and Match(r';', end_line[end_pos:]):
2696 match_constant = r'([-+]?(\d+|0[xX][0-9a-fA-F]+)[lLuU]{0,3}|".*"|\'.*\')'
2703 match_this = (r'\s*' + macro + r'\((\s*' +
2704 match_constant + r'\s*' + operator + r'[^<>].*|'
2705 r'.*[^<>]' + operator + r'\s*' + match_constant +
2706 r'\s*\))')
2712 return Match(match_this, line) and not Search(r'NULL|&&|\|\|', line)
2760 if Match(r'^\s*#', line):
2848 not Match(r'\s*\w+\s*:\s*$', cleansed_line)):
2853 elif not initial_spaces and line[:2] != '//' and Search(r'[^:]:\s*$',
2879 not Match(r'^\s*//.*http(s?)://\S*$', line) and
2880 not Match(r'^// \$Id:.*#[0-9]+ \$$', line)):
2913 _RE_PATTERN_INCLUDE_NEW_STYLE = re.compile(r'#include +"[^/]+\.h"')
2914 _RE_PATTERN_INCLUDE = re.compile(r'^\s*#\s*include\s*([<"])([^>"]*)[>"].*$')
2920 _RE_FIRST_COMPONENT = re.compile(r'^[^-_.]+')
3090 if Match(r'(f|ind|io|i|o|parse|pf|stdio|str|)?stream$', include):
3200 if (len(re.findall(r'\([^()]*\b(?:[\w:]|<[^()]*>)+(\s?&|&\s?)\w+', fnline)) >
3201 len(re.findall(r'\([^()]*\bconst\s+(?:typename\s+)?(?:struct\s+)?'
3202 r'(?:[\w:]|<[^()]*>)+(\s?&|&\s?)\w+', fnline)) +
3203 len(re.findall(r'\([^()]*\b(?:[\w:]|<[^()]*>)+\s+const(\s?&|&\s?)[\w]+',
3210 r'(for|swap|Swap|operator[<>][<>])\s*\(\s*'
3211 r'(?:(?:typename\s*)?[\w:]|<.*>)+\s*&',
3222 r'(\bnew\s+)?\b' # Grab 'new' operator, if it's there
3223 r'(int|float|double|bool|char|int32|uint32|int64|uint64)\([^)]', line)
3234 not (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or
3237 Match(r'^\s*MockCallback<.*>', line) or
3238 Match(r'^\s*std::function<.*>', line))):
3247 not Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(\S+,\s*$',
3256 r'\((int|float|double|bool|char|u?int(16|32|64))\)', error)
3263 'const_cast', r'\((char\s?\*+\s?)\)\s*"', error):
3268 'reinterpret_cast', r'\((\w+\s?\*+\s?)\)', error)
3274 r'(&\([^)]+\)[\w(])|(&(static|dynamic|reinterpret)_cast\b)', line):
3284 r'((?:|static +)(?:|const +))string +([a-zA-Z0-9_:]+)\b(.*)',
3289 if match and not Match(r'\s*(<.*>)?(::[a-zA-Z0-9_]+)?\s*\(([^"]|$)',
3297 if Search(r'\bdynamic_cast<', line) and not _IsTestFilename(filename):
3303 if Search(r'\b([A-Za-z0-9_]*_)\(\1\)', line):
3317 if Search(r'\bshort port\b', line):
3318 if not Search(r'\bunsigned short port\b', line):
3322 match = Search(r'\b(short|long(?! +double)|long long)\b', line)
3328 match = Search(r'snprintf\s*\(([^,]*),\s*([0-9]*)\s*,', line)
3336 if Search(r'\bsprintf\b', line):
3339 match = Search(r'\b(strcpy|strcat)\b', line)
3344 if Search(r'\bsscanf\b', line):
3354 if Search(r'\boperator\s*&\s*\(\s*\)', line):
3360 if Search(r'\}\s*if\s*\(', line):
3371 printf_args = _GetTextInside(line, r'(?i)\b(string)?printf\s*\(')
3373 match = Match(r'([\w.\->()]+)$', printf_args)
3375 function_name = re.search(r'\b((?:string)?printf)\s*\(',
3382 match = Search(r'memset\s*\(([^,]*),\s*([^,]*),\s*0\s*\)', line)
3383 if match and not Match(r"^''|-?[0-9]+|0x[0-9A-Fa-f]$", match.group(2)):
3388 if Search(r'\busing namespace\b', line):
3394 match = Match(r'\s*(.+::)?(\w+) [a-z]\w*\[(.+)];', line)
3400 tokens = re.split(r'\s|\+|\-|\*|\/|<<|>>]', match.group(3))
3408 if Search(r'sizeof\(.+\)', tok): continue
3409 if Search(r'arraysize\(\w+\)', tok): continue
3414 if Match(r'\d+', tok): continue
3415 if Match(r'0[xX][0-9a-fA-F]+', tok): continue
3416 if Match(r'k[A-Z0-9]\w*', tok): continue
3417 if Match(r'(.+::)?k[A-Z0-9]\w*', tok): continue
3418 if Match(r'(.+::)?[A-Z][A-Z0-9_]*', tok): continue
3436 (r'\s*'
3437 r'(DISALLOW_(EVIL_CONSTRUCTORS|COPY_AND_ASSIGN|IMPLICIT_CONSTRUCTORS))'
3438 r'\(.*\);$'),
3448 if not Search(r'^\s*}[\w\*,\s]*;', next_line):
3456 and Search(r'\bnamespace\s*{', line)
3489 sizeof_match = Match(r'.*sizeof\s*$', line[0:match.start(1) - 1])
3514 function_match = Match(r'\s*(\)|=|(const)?\s*(;|\{|throw\(\)|>))', remainder)
3569 _RE_PATTERN_STRING = re.compile(r'\bstring\b')
3577 (re.compile(r'[^>.]\b' + _template + r'(<.*?>)?\([^\)]'),
3585 (re.compile(r'(\<|\b)' + _template + r'\s*\<'),
3739 abs_filename = re.sub(r'_flymake\.cc$', '.cc', abs_filename)
3767 _RE_PATTERN_EXPLICIT_MAKEPAIR = re.compile(r'\bmake_pair\s*<')