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)
| 1746 | |
| 1747 | |
| 1748 | def IsCppString(line): |
| 1749 | """Does line terminate so, that the next symbol is in string constant. |
| 1750 | |
| 1751 | This function does not consider single-line nor multi-line comments. |
| 1752 | |
| 1753 | Args: |
| 1754 | line: is a partial line of code starting from the 0..n. |
| 1755 | |
| 1756 | Returns: |
| 1757 | True, if next character appended to 'line' is inside a |
| 1758 | string constant. |
| 1759 | """ |
| 1760 | |
| 1761 | line = line.replace(r'\\', 'XX') # after this, \\" does not match to \" |
| 1762 | return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1 |
| 1763 | |
| 1764 | |
| 1765 | def CleanseRawStrings(raw_lines): |
no test coverage detected