Don't lint text between #if 0...#endif
This commit is contained in:
parent
49bceb269a
commit
d4be554988
|
@ -1377,7 +1377,8 @@ def CleanseRawStrings(raw_lines):
|
|||
def FindNextMultiLineCommentStart(lines, lineix):
|
||||
"""Find the beginning marker for a multiline comment."""
|
||||
while lineix < len(lines):
|
||||
if lines[lineix].strip().startswith('/*'):
|
||||
if (lines[lineix].strip().startswith('/*') or
|
||||
lines[lineix].strip().startswith('#if 0')):
|
||||
# Only return this marker if the comment goes beyond this line
|
||||
if lines[lineix].strip().find('*/', 2) < 0:
|
||||
return lineix
|
||||
|
@ -1388,7 +1389,8 @@ def FindNextMultiLineCommentStart(lines, lineix):
|
|||
def FindNextMultiLineCommentEnd(lines, lineix):
|
||||
"""We are inside a comment, find the end marker."""
|
||||
while lineix < len(lines):
|
||||
if lines[lineix].strip().endswith('*/'):
|
||||
if (lines[lineix].strip().endswith('*/') or
|
||||
lines[lineix].strip().endswith('#endif')):
|
||||
return lineix
|
||||
lineix += 1
|
||||
return len(lines)
|
||||
|
|
Loading…
Reference in New Issue