MCPcopy Create free account
hub / github.com/SIPp/sipp / IsCppString

Function IsCppString

cpplint.py:909–923  ·  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

907
908
909def IsCppString(line):
910 """Does line terminate so, that the next symbol is in string constant.
911
912 This function does not consider single-line nor multi-line comments.
913
914 Args:
915 line: is a partial line of code starting from the 0..n.
916
917 Returns:
918 True, if next character appended to 'line' is inside a
919 string constant.
920 """
921
922 line = line.replace(r'\\', 'XX') # after this, \\" does not match to \"
923 return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1
924
925
926def FindNextMultiLineCommentStart(lines, lineix):

Callers 1

CleanseCommentsFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected