diff python/ppci/errors.py @ 295:917eab04b8b7

Added disasm
author Windel Bouwman
date Thu, 28 Nov 2013 21:10:32 +0100
parents 6aa721e7b10b
children 9417caea2eb3
line wrap: on
line diff
--- a/python/ppci/errors.py	Thu Nov 28 20:39:56 2013 +0100
+++ b/python/ppci/errors.py	Thu Nov 28 21:10:32 2013 +0100
@@ -45,23 +45,21 @@
 
     def printErrors(self):
         if len(self.diags) > 0:
-            print('==============')
             print('{0} Errors'.format(len(self.diags)))
             for d in self.diags:
-                print('==============')
                 self.printError(d)
-            print('==============')
 
     def printError(self, e):
         def printLine(row, txt):
             print(str(row)+':'+txt)
-        print(type(e), e, e.msg)
+        print('==============')
         if not e.loc:
             print('Error: {0}'.format(e))
         else:
             if e.loc.filename not in self.sources:
                 print('Error: {0}'.format(e))
                 return
+            print("File: {}".format(e.loc.filename))
             source = self.sources[e.loc.filename]
             lines = source.split('\n')
             ro, co = e.row, e.col
@@ -81,3 +79,4 @@
             # print trailing source line:
             for r in range(ro+1, afterrow+1):
               printLine(r, lines[r-1])
+        print('==============')