Mercurial > lcfOS
diff python/ppci/errors.py @ 167:0b5b2ee6b435
Added 2 unit tests
author | Windel Bouwman |
---|---|
date | Fri, 22 Mar 2013 17:40:13 +0100 |
parents | b73bc14a3aa3 |
children | 5a7d37d615ee |
line wrap: on
line diff
--- a/python/ppci/errors.py Fri Mar 22 16:15:31 2013 +0100 +++ b/python/ppci/errors.py Fri Mar 22 17:40:13 2013 +0100 @@ -8,7 +8,7 @@ self.msg = msg self.loc = loc def __repr__(self): - return 'Compilererror {0} at {1}'.format(self.msg, self.loc) + return 'Compilererror {0} at row {1}'.format(self.msg, self.loc.row) def printError(source, e): def printLine(row, txt): @@ -42,4 +42,6 @@ self.diags.append(d) def error(self, msg, loc): self.addDiag(CompilerError(msg, loc)) + def clear(self): + self.diags.clear()