Lines Matching full:line

226 def respect_rule0(line):  argument
227 return line.lstrip() == line
230 def conformTo_rule0(line): argument
231 return line.lstrip()
234 # No spaces are allowed behind the line continuation symbol '\'
237 def respect_rule1(line): argument
238 if line.rstrip().endswith('\\'):
239 return line.endswith('\\')
244 def conformTo_rule1(line): argument
245 return line.rstrip()
251 def respect_rule2(line): argument
252 return line.count('\t') == 0
255 def conformTo_rule2(line): argument
256 return line.expandtabs()
260 # beginning of a line.
263 def respect_rule3(line): argument
264 if line.lstrip().startswith('#'):
265 return line.startswith('#')
270 def conformTo_rule3(line): argument
271 return line.lstrip()
277 def respect_rule4(line): argument
278 r = re.search(varRegexp, line)
286 def conformTo_rule4(line): argument
287 r = re.search(varRegexp, line)
294 def respect_rule5(line): argument
295 r = re.search(varRegexp, line)
299 def conformTo_rule5(line): argument
300 r = re.search(varRegexp, line)
307 def respect_rule6(line): argument
308 return not line.isspace() or line == "\n"
311 def conformTo_rule6(line): argument
318 def respect_rule7(line): argument
322 def conformTo_rule7(line): argument
323 return line
328 …(respect_rule1, conformTo_rule1, "No spaces are allowed behind the line continuation symbol '\\'"),
330 …_rule3, "Comments inside bb files are allowed using the '#' character at the beginning of a line"),
337 # Function to check that a line respects a rule. If not, it tries to conform
338 # the line to the rule. Reminder or Disgression message are dump accordingly.
341 def follow_rule(i, line): argument
342 oldline = line
343 # if the line does not respect the rule
344 if not rules[i][0](line):
346 line = rules[i][1](line)
347 # if the line still does not respect the rule
348 if not rules[i][0](line):
354 return line
361 for line in fileinput.input():
365 lines.append(line)
367 # expandtabs on each line so that rule2 is always respected
368 # rstrip each line so that rule1 is always respected
369 line = line.expandtabs().rstrip() variable
370 # ignore empty lines (or line filled with spaces or tabs only)
372 if line != '':
373 lines.append(line)
380 for line in lines:
381 originalLine = line
382 # rstrip line to remove line breaks characters
383 line = line.rstrip() variable
384 line = follow_rule(2, line) variable
385 line = follow_rule(1, line) variable
386 line = follow_rule(6, line) variable
389 if line.isspace() or line == '':
396 if line.startswith('}'):
398 keep = line.endswith('\\') or in_routine
401 if line.lstrip().startswith('#'):
404 line = follow_rule(3, line) variable
405 commentBloc.append(line)
412 seen_vars[var].append(line)
415 if line.startswith(k):
418 if re.match(routineRegexp, line) is not None:
420 line = follow_rule(0, line) variable
421 elif re.match(varRegexp, line) is not None:
422 line = follow_rule(0, line) variable
423 line = follow_rule(4, line) variable
424 line = follow_rule(5, line) variable
432 seen_vars[var].append(line)
452 for line in olines:
453 print(line)