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)
| 907 | |
| 908 | |
| 909 | def IsCppString(line): |
| 910 | """Does line terminate so, that the next symbol is in string constant. |
| 911 | |
| 912 | This function does not consider single-line nor multi-line comments. |
| 913 | |
| 914 | Args: |
| 915 | line: is a partial line of code starting from the 0..n. |
| 916 | |
| 917 | Returns: |
| 918 | True, if next character appended to 'line' is inside a |
| 919 | string constant. |
| 920 | """ |
| 921 | |
| 922 | line = line.replace(r'\\', 'XX') # after this, \\" does not match to \" |
| 923 | return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1 |
| 924 | |
| 925 | |
| 926 | def FindNextMultiLineCommentStart(lines, lineix): |
no test coverage detected