Well, that's a hack. But it works.
Chris Pressey
6 years ago
4 | 4 |
-------
|
5 | 5 |
|
6 | 6 |
* Added `byte table` type locations and indexed addressing (`+ x`, `+ y`).
|
|
7 |
* Integer literals may be given in hexadecimal.
|
7 | 8 |
|
8 | 9 |
0.4
|
9 | 10 |
---
|
35 | 35 |
if self.scan_pattern(r'\,|\@|\+|\{|\}', 'operator'):
|
36 | 36 |
return
|
37 | 37 |
if self.scan_pattern(r'\d+', 'integer literal'):
|
|
38 |
return
|
|
39 |
if self.scan_pattern(r'\$([0-9a-fA-F]+)', 'integer literal',
|
|
40 |
token_group=2, rest_group=3):
|
|
41 |
# ecch
|
|
42 |
self.token = str(eval('0x' + self.token))
|
38 | 43 |
return
|
39 | 44 |
if self.scan_pattern(r'\"(.*?)\"', 'string literal',
|
40 | 45 |
token_group=2, rest_group=3):
|