diff python/ppci/errors.py @ 251:6ed3d3a82a63

Added another c3 example. First import attempt
author Windel Bouwman
date Mon, 29 Jul 2013 20:23:13 +0200
parents b10d46e5c8dd
children 7416c923a02a
line wrap: on
line diff
--- a/python/ppci/errors.py	Sun Jul 28 19:07:51 2013 +0200
+++ b/python/ppci/errors.py	Mon Jul 29 20:23:13 2013 +0200
@@ -14,7 +14,7 @@
             self.row = loc.row
             self.col = loc.col
         else:
-            self.row = self.col = None
+            self.row = self.col = 0
 
     def __repr__(self):
         if self.row:
@@ -23,11 +23,11 @@
             return 'Compilererror: "{0}"'.format(self.msg)
 
 def printError(source, e):
-     def printLine(row, txt):
+    def printLine(row, txt):
         print(str(row)+':'+txt)
-     if e.loc.row == 0:
-        print('Error: {0}'.format(e.msg))
-     else:
+    if e.row == 0:
+            print('Error: {0}'.format(e.msg))
+    else:
         lines = source.split('\n')
         ro, co = e.row, e.col
         prerow = ro - 2