Lines Matching refs:line
17 at the end of files. Also ensure the last line ends with a newline.
19 If no paths are given on the command line, reindent operates as a filter,
160 def _rstrip(line, JUNK='\n \t'):
161 """Return line stripped of trailing spaces, tabs, newlines.
163 Note that line.rstrip() instead also strips sundry control characters,
168 i = len(line)
169 while i > 0 and line[i - 1] in JUNK:
171 return line[:i]
184 # that we can use tokenize's 1-based line numbering easily.
185 # Note that a line is all-blank iff it's "\n".
186 self.lines = [_rstrip(line).expandtabs() + "\n"
187 for line in self.raw]
189 self.index = 1 # index into self.lines of next line
192 # comment line. indentlevel is -1 for comment lines, as a
217 # we see a line with *something* on it.
226 # A comment line.
228 # An indented comment line. If we saw the same
243 # line got shifted.
261 for line in lines[thisstmt:nextstmt]:
263 if line == "\n":
264 after.append(line)
266 after.append(" " * diff + line)
268 remove = min(getlspace(line), -diff)
269 after.append(line[remove:])
278 line = ""
280 line = self.lines[self.index]
282 return line
285 def tokeneater(self, type, token, slinecol, end, line,
320 if line: # not endmarker
325 def getlspace(line):
326 i, n = 0, len(line)
327 while i < n and line[i] == " ":