MCPcopy Index your code
hub / github.com/cpplint/cpplint / RemoveMultiLineComments

Function RemoveMultiLineComments

cpplint.py:2040–2058  ·  view source on GitHub ↗

Removes multiline (c-style) comments from lines.

(filename, lines, error)

Source from the content-addressed store, hash-verified

2038
2039
2040def 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
2061def CleanseComments(line):

Callers 1

ProcessFileDataFunction · 0.85

Tested by

no test coverage detected