示例#1
0
 def as_string(self):
     result = f'{self.error_name}: {self.details}'
     result += f'\nFile: {self.position_start.file_name}, Line: {self.position_start.line + 1}, Column: {self.position_start.column + 1}'
     result += '\n\n' + error_pointer(self.position_start.file_text,
                                      self.position_start,
                                      self.position_end)
     return result
示例#2
0
 def as_string(self):
     result = self.traceback()
     result += f'{self.error_name}: {self.details}'
     result += '\n\n' + error_pointer(self.position_start.file_text,
                                      self.position_start,
                                      self.position_end)
     return result