Mercurial > lcfOS
diff python/ppci/common.py @ 249:e41e4109addd
Added current position arrow
author | Windel Bouwman |
---|---|
date | Fri, 26 Jul 2013 20:26:05 +0200 |
parents | b01429a5d695 |
children | 1c7c1e619be8 |
line wrap: on
line diff
--- a/python/ppci/common.py Fri Jul 26 16:46:02 2013 +0200 +++ b/python/ppci/common.py Fri Jul 26 20:26:05 2013 +0200 @@ -13,10 +13,14 @@ return 'Token({0}, {1})'.format(self.typ, self.val) class SourceLocation: - def __init__(self, row, col, ln): - self.row = row - self.col = col - self.length = ln + def __init__(self, row, col, ln): + self.row = row + self.col = col + self.length = ln + self.filename = '' + + def __repr__(self): + return '{}, {}'.format(self.row, self.col) SourceRange = namedtuple('SourceRange', ['p1', 'p2'])