MCPcopy Create free account
hub / github.com/BVLC/caffe / IsCppString

Function IsCppString

scripts/cpp_lint.py:1049–1063  ·  view source on GitHub ↗

Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string constant.

(line)

Source from the content-addressed store, hash-verified

1047
1048
1049def IsCppString(line):
1050 """Does line terminate so, that the next symbol is in string constant.
1051
1052 This function does not consider single-line nor multi-line comments.
1053
1054 Args:
1055 line: is a partial line of code starting from the 0..n.
1056
1057 Returns:
1058 True, if next character appended to 'line' is inside a
1059 string constant.
1060 """
1061
1062 line = line.replace(r'\\', 'XX') # after this, \\" does not match to \"
1063 return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1
1064
1065
1066def CleanseRawStrings(raw_lines):

Callers 1

CleanseCommentsFunction · 0.85

Calls 1

countMethod · 0.80

Tested by

no test coverage detected