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)
| 1043 | |
| 1044 | |
| 1045 | def IsCppString(line): |
| 1046 | """Does line terminate so, that the next symbol is in string constant. |
| 1047 | |
| 1048 | This function does not consider single-line nor multi-line comments. |
| 1049 | |
| 1050 | Args: |
| 1051 | line: is a partial line of code starting from the 0..n. |
| 1052 | |
| 1053 | Returns: |
| 1054 | True, if next character appended to 'line' is inside a |
| 1055 | string constant. |
| 1056 | """ |
| 1057 | |
| 1058 | line = line.replace(r'\\', 'XX') # after this, \\" does not match to \" |
| 1059 | return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1 |
| 1060 | |
| 1061 | |
| 1062 | def CleanseRawStrings(raw_lines): |
no test coverage detected