Removes multiline (c-style) comments from lines.
(filename, lines, error)
| 2083 | |
| 2084 | |
| 2085 | def RemoveMultiLineComments(filename, lines, error): |
| 2086 | """Removes multiline (c-style) comments from lines.""" |
| 2087 | lineix = 0 |
| 2088 | while lineix < len(lines): |
| 2089 | lineix_begin = FindNextMultiLineCommentStart(lines, lineix) |
| 2090 | if lineix_begin >= len(lines): |
| 2091 | return |
| 2092 | lineix_end = FindNextMultiLineCommentEnd(lines, lineix_begin) |
| 2093 | if lineix_end >= len(lines): |
| 2094 | error( |
| 2095 | filename, |
| 2096 | lineix_begin + 1, |
| 2097 | "readability/multiline_comment", |
| 2098 | 5, |
| 2099 | "Could not find end of multi-line comment", |
| 2100 | ) |
| 2101 | return |
| 2102 | RemoveMultiLineCommentsFromRange(lines, lineix_begin, lineix_end + 1) |
| 2103 | lineix = lineix_end + 1 |
| 2104 | |
| 2105 | |
| 2106 | def CleanseComments(line): |
no test coverage detected
searching dependent graphs…