MCPcopy Index your code
hub / github.com/nodejs/node / IsCppString

Function IsCppString

tools/cpplint.py:1965–1979  ·  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

1963
1964
1965def IsCppString(line):
1966 """Does line terminate so, that the next symbol is in string constant.
1967
1968 This function does not consider single-line nor multi-line comments.
1969
1970 Args:
1971 line: is a partial line of code starting from the 0..n.
1972
1973 Returns:
1974 True, if next character appended to 'line' is inside a
1975 string constant.
1976 """
1977
1978 line = line.replace(r"\\", "XX") # after this, \\" does not match to \"
1979 return ((line.count('"') - line.count(r"\"") - line.count("'\"'")) & 1) == 1
1980
1981
1982def CleanseRawStrings(raw_lines):

Callers 1

CleanseCommentsFunction · 0.85

Calls 1

countMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…