MCPcopy Index your code
hub / github.com/cpplint/cpplint / IsCppString

Function IsCppString

cpplint.py:1920–1934  ·  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 stri

(line)

Source from the content-addressed store, hash-verified

1918
1919
1920def IsCppString(line):
1921 """Does line terminate so, that the next symbol is in string constant.
1922
1923 This function does not consider single-line nor multi-line comments.
1924
1925 Args:
1926 line: is a partial line of code starting from the 0..n.
1927
1928 Returns:
1929 True, if next character appended to 'line' is inside a
1930 string constant.
1931 """
1932
1933 line = line.replace(r"\\", "XX") # after this, \\" does not match to \"
1934 return ((line.count('"') - line.count(r"\"") - line.count("'\"'")) & 1) == 1
1935
1936
1937def CleanseRawStrings(raw_lines):

Callers 1

CleanseCommentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected