Lines Matching refs:lines

959 def FindNextMultiLineCommentStart(lines, lineix):  argument
961 while lineix < len(lines):
962 if lines[lineix].strip().startswith('/*'):
964 if lines[lineix].strip().find('*/', 2) < 0:
967 return len(lines)
970 def FindNextMultiLineCommentEnd(lines, lineix): argument
972 while lineix < len(lines):
973 if lines[lineix].strip().endswith('*/'):
976 return len(lines)
979 def RemoveMultiLineCommentsFromRange(lines, begin, end): argument
984 lines[i] = '// dummy'
987 def RemoveMultiLineComments(filename, lines, error): argument
990 while lineix < len(lines):
991 lineix_begin = FindNextMultiLineCommentStart(lines, lineix)
992 if lineix_begin >= len(lines):
994 lineix_end = FindNextMultiLineCommentEnd(lines, lineix_begin)
995 if lineix_end >= len(lines):
999 RemoveMultiLineCommentsFromRange(lines, lineix_begin, lineix_end + 1)
1028 def __init__(self, lines): argument
1030 self.lines = []
1031 self.raw_lines = lines
1032 self.num_lines = len(lines)
1033 for linenum in range(len(lines)):
1034 self.lines.append(CleanseComments(lines[linenum]))
1035 elided = self._CollapseStrings(lines[linenum])
1131 def CheckForCopyright(filename, lines, error): argument
1136 for line in xrange(1, min(len(lines), 11)):
1137 if re.search(r'Copyright', lines[line], re.I): break
1168 def CheckForHeaderGuard(filename, lines, error): argument
1187 for linenum, line in enumerate(lines):
1221 ParseNolintSuppressions(filename, lines[ifndef_linenum], ifndef_linenum,
1237 ParseNolintSuppressions(filename, lines[endif_linenum], endif_linenum,
1243 def CheckForUnicodeReplacementCharacters(filename, lines, error): argument
1256 for linenum, line in enumerate(lines):
1262 def CheckForNewlineAtEOF(filename, lines, error): argument
1275 if len(lines) < 3 or lines[-2]:
1276 error(filename, len(lines) - 2, 'whitespace/ending_newline', 5,
1813 line = clean_lines.lines[linenum]
1998 lines = clean_lines.lines
1999 line = lines[linenum]
2018 start_line = lines[start_linenum]
2552 matched = Match(r'\s*(public|protected|private):', clean_lines.lines[linenum])
2562 prev_line = clean_lines.lines[linenum - 1]
2572 if Search(r'\{\s*$', clean_lines.lines[i]):
3070 line = clean_lines.lines[linenum]
3857 def ProcessFileData(filename, file_extension, lines, error, argument
3872 lines = (['// marker so line numbers and indices both start at 1'] + lines +
3881 CheckForCopyright(filename, lines, error)
3884 CheckForHeaderGuard(filename, lines, error)
3886 RemoveMultiLineComments(filename, lines, error)
3887 clean_lines = CleansedLines(lines)
3898 CheckForUnicodeReplacementCharacters(filename, lines, error)
3900 CheckForNewlineAtEOF(filename, lines, error)
3933 lines = codecs.StreamReaderWriter(sys.stdin,
3938 lines = codecs.open(filename, 'r', 'utf8', 'replace').read().split('\n')
3942 for linenum in range(len(lines)):
3943 if lines[linenum].endswith('\r'):
3944 lines[linenum] = lines[linenum].rstrip('\r')
3961 ProcessFileData(filename, file_extension, lines, Error,