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)
| 1243 | |
| 1244 | |
| 1245 | def IsCppString(line): |
| 1246 | """Does line terminate so, that the next symbol is in string constant. |
| 1247 | |
| 1248 | This function does not consider single-line nor multi-line comments. |
| 1249 | |
| 1250 | Args: |
| 1251 | line: is a partial line of code starting from the 0..n. |
| 1252 | |
| 1253 | Returns: |
| 1254 | True, if next character appended to 'line' is inside a |
| 1255 | string constant. |
| 1256 | """ |
| 1257 | |
| 1258 | line = line.replace(r'\\', 'XX') # after this, \\" does not match to \" |
| 1259 | return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1 |
| 1260 | |
| 1261 | |
| 1262 | def CleanseRawStrings(raw_lines): |
no test coverage detected