Lines Matching refs:line
97 for line in self.data.split('\n'):
98 if line.strip() == '':
101 if line[:indent_amount] != indent:
105 new_lines.append(line[indent_amount:])
126 self.line = 1
151 self.pos.line += 1
161 line = ''
163 line += self.read(1)
165 return line
188 def format_error_lines(at, line_num, column_num, ctx, line):
189 pred = '%s line %d, column %d of %s: "' % (at, line_num, column_num, ctx)
190 return [pred + line + '"',
203 self.pattern_pos.line = pattern.pos.line
205 self.output_pos.line = output.pos.line
214 pat_line = self.pattern.get_line(pat_pos.line)
215 res = format_error_lines('at', pat_pos.line, pat_pos.column, 'pattern', pat_line)
219 pat_line = func_res.pattern.get_line(pat_pos.line)
220 res += format_error_lines('in', pat_pos.line, pat_pos.column, func_res.pattern.name, pat_line)
248 old_line = output.pos.line
250 if output.pos.line == old_line:
352 out_line = state.g['output'].get_line(res.output_pos.line)
353 state.result.log += '\n'.join(format_error_lines('at', res.output_pos.line, res.output_pos.column, 'output', out_line))
397 def parse_check(variant, line, checks, pos):
398 if line.startswith(';'):
399 line = line[1:]
401 checks[-1].data += '\n' + line
403 checks.append(CodeCheck(line, pos))
404 elif line.startswith('!'):
405 checks.append(PatternCheck(line[1:], False, pos))
406 elif line.startswith('>>'):
407 checks.append(PatternCheck(line[2:], True, pos))
408 elif line.startswith('~'):
409 end = len(line)
410 start = len(line)
412 if line.find(c) != -1 and line.find(c) < end:
413 end = line.find(c)
414 if end != len(line):
415 match = re.match(line[1:end], variant)
417 parse_check(variant, line[end:], checks, pos)
424 for line in open(fname, 'r').readlines():
425 if line.startswith('BEGIN_TEST(%s)' % test_name):
427 elif line.startswith('BEGIN_TEST_TODO(%s)' % test_name):
430 elif line.startswith('BEGIN_TEST_FAIL(%s)' % test_name):
433 elif line.startswith('END_TEST'):
436 test.append((line_num, line.strip()))
441 parse_check(variant, check, checks, 'line %d of %s' % (line_num, os.path.split(fname)[1]))
473 for line in result.log.rstrip().split('\n'):
474 print(' ' + line.rstrip())