MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / IsCppString

Function IsCppString

steps/cpplint.py:1763–1777  ·  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

1761
1762
1763def IsCppString(line):
1764 """Does line terminate so, that the next symbol is in string constant.
1765
1766 This function does not consider single-line nor multi-line comments.
1767
1768 Args:
1769 line: is a partial line of code starting from the 0..n.
1770
1771 Returns:
1772 True, if next character appended to 'line' is inside a
1773 string constant.
1774 """
1775
1776 line = line.replace(r'\\', 'XX') # after this, \\" does not match to \"
1777 return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1
1778
1779
1780def CleanseRawStrings(raw_lines):

Callers 1

CleanseCommentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected