MCPcopy Create free account
hub / github.com/apache/mesos / IsCppString

Function IsCppString

support/cpplint.py:1276–1290  ·  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

1274
1275
1276def IsCppString(line):
1277 """Does line terminate so, that the next symbol is in string constant.
1278
1279 This function does not consider single-line nor multi-line comments.
1280
1281 Args:
1282 line: is a partial line of code starting from the 0..n.
1283
1284 Returns:
1285 True, if next character appended to 'line' is inside a
1286 string constant.
1287 """
1288
1289 line = line.replace(r'\\', 'XX') # after this, \\" does not match to \"
1290 return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1
1291
1292
1293def CleanseRawStrings(raw_lines):

Callers 1

CleanseCommentsFunction · 0.85

Calls 1

countMethod · 0.45

Tested by

no test coverage detected