9572a68b8832a09f716017742fbd3b4f1da3d131,scripts/cpp_lint.py,,,#,4269

Before Change


       "<algorithm>"))

_re_pattern_templates = []
for _header, _templates in _HEADERS_CONTAINING_TEMPLATES:
  for _template in _templates:
    _re_pattern_templates.append(
        (re.compile(r"(\<|\b)" + _template + r"\s*\<"),
         _template + "<>",
         _header))


def FilesBelongToSameModule(filename_cc, filename_h):
  Check if these two filenames belong to the same module.

  The concept of a "module" here is a as follows:

After Change


//     |   [^<>] )*
//   >
_RE_PATTERN_IDENT = r"[_a-zA-Z]\w*"  // =~ [[:alpha:]][[:alnum:]]*
_RE_PATTERN_TYPE = (
    r"(?:const\s+)?(?:typename\s+|class\s+|struct\s+|union\s+|enum\s+)?"
    r"(?:\w|"
    r"\s*<(?:<(?:<[^<>]*>|[^<>])*>|[^<>])*>|"
    r"::)+")
// A call-by-reference parameter ends with "& identifier".
_RE_PATTERN_REF_PARAM = re.compile(
    r"(" + _RE_PATTERN_TYPE + r"(?:\s*(?:\bconst\b|[*]))*\s*"
    r"&\s*" + _RE_PATTERN_IDENT + r")\s*(?:=[^,()]+)?[,)]")
// A call-by-const-reference parameter either ends with "const& identifier"
// or looks like "const type& identifier" when "type" is atomic.
_RE_PATTERN_CONST_REF_PARAM = (
    r"(?:.*\s*\bconst\s*&\s*" + _RE_PATTERN_IDENT +
    r"|const\s+" + _RE_PATTERN_TYPE + r"\s*&\s*" + _RE_PATTERN_IDENT + r")")


def CheckLanguage(filename, clean_lines, linenum, file_extension,
                  include_state, nesting_state, error):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: BVLC/caffe
Commit Name: 9572a68b8832a09f716017742fbd3b4f1da3d131
Time: 2014-08-12
Author: jeff.donahue@gmail.com
File Name: scripts/cpp_lint.py
Class Name:
Method Name:


Project Name: BVLC/caffe
Commit Name: 16176a2d3e934528c1b6a4c80d0fc53c86ec5933
Time: 2014-04-22
Author: jeff.donahue@gmail.com
File Name: scripts/cpp_lint.py
Class Name:
Method Name:


Project Name: coala/coala-bears
Commit Name: bfd61fb7a0c4456ce812a227f3b1962b2c727879
Time: 2016-09-03
Author: abdealikothari@gmail.com
File Name: bears/general/KeywordBear.py
Class Name: KeywordBear
Method Name: run