Removes multiline (c-style) comments from lines.
(filename, lines, error)
| 1871 | |
| 1872 | |
| 1873 | def RemoveMultiLineComments(filename, lines, error): |
| 1874 | """Removes multiline (c-style) comments from lines.""" |
| 1875 | lineix = 0 |
| 1876 | while lineix < len(lines): |
| 1877 | lineix_begin = FindNextMultiLineCommentStart(lines, lineix) |
| 1878 | if lineix_begin >= len(lines): |
| 1879 | return |
| 1880 | lineix_end = FindNextMultiLineCommentEnd(lines, lineix_begin) |
| 1881 | if lineix_end >= len(lines): |
| 1882 | error(filename, lineix_begin + 1, 'readability/multiline_comment', 5, |
| 1883 | 'Could not find end of multi-line comment') |
| 1884 | return |
| 1885 | RemoveMultiLineCommentsFromRange(lines, lineix_begin, lineix_end + 1) |
| 1886 | lineix = lineix_end + 1 |
| 1887 | |
| 1888 | |
| 1889 | def CleanseComments(line): |
no test coverage detected