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)
| 1963 | |
| 1964 | |
| 1965 | def 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 | |
| 1982 | def CleanseRawStrings(raw_lines): |
no test coverage detected
searching dependent graphs…