Removes multiline (c-style) comments from lines.
(filename, lines, error)
| 2038 | |
| 2039 | |
| 2040 | def RemoveMultiLineComments(filename, lines, error): |
| 2041 | """Removes multiline (c-style) comments from lines.""" |
| 2042 | lineix = 0 |
| 2043 | while lineix < len(lines): |
| 2044 | lineix_begin = FindNextMultiLineCommentStart(lines, lineix) |
| 2045 | if lineix_begin >= len(lines): |
| 2046 | return |
| 2047 | lineix_end = FindNextMultiLineCommentEnd(lines, lineix_begin) |
| 2048 | if lineix_end >= len(lines): |
| 2049 | error( |
| 2050 | filename, |
| 2051 | lineix_begin + 1, |
| 2052 | "readability/multiline_comment", |
| 2053 | 5, |
| 2054 | "Could not find end of multi-line comment", |
| 2055 | ) |
| 2056 | return |
| 2057 | RemoveMultiLineCommentsFromRange(lines, lineix_begin, lineix_end + 1) |
| 2058 | lineix = lineix_end + 1 |
| 2059 | |
| 2060 | |
| 2061 | def CleanseComments(line): |
no test coverage detected