Mercurial > lcfOS
comparison python/ppci/common.py @ 292:534b94b40aa8
Fixup reorganize
author | Windel Bouwman |
---|---|
date | Wed, 27 Nov 2013 08:06:42 +0100 |
parents | 1c7c1e619be8 |
children | 6aa721e7b10b |
comparison
equal
deleted
inserted
replaced
290:7b38782ed496 | 292:534b94b40aa8 |
---|---|
8 self.val = val | 8 self.val = val |
9 if loc is None: | 9 if loc is None: |
10 loc = SourceLocation('', 0, 0, 0) | 10 loc = SourceLocation('', 0, 0, 0) |
11 assert type(loc) is SourceLocation | 11 assert type(loc) is SourceLocation |
12 self.loc = loc | 12 self.loc = loc |
13 | |
13 def __repr__(self): | 14 def __repr__(self): |
14 return 'Token({0}, {1})'.format(self.typ, self.val) | 15 return 'Token({0}, {1})'.format(self.typ, self.val) |
15 | 16 |
16 | 17 |
17 class SourceLocation: | 18 class SourceLocation: |
24 def __repr__(self): | 25 def __repr__(self): |
25 return '{}, {}'.format(self.row, self.col) | 26 return '{}, {}'.format(self.row, self.col) |
26 | 27 |
27 | 28 |
28 SourceRange = namedtuple('SourceRange', ['p1', 'p2']) | 29 SourceRange = namedtuple('SourceRange', ['p1', 'p2']) |
29 |