git @ Cat's Eye Technologies SixtyPical / a933c81
Well, that's a hack. But it works. Chris Pressey 6 years ago
5 changed file(s) with 17 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
44 -------
55
66 * Added `byte table` type locations and indexed addressing (`+ x`, `+ y`).
7 * Integer literals may be given in hexadecimal.
78
89 0.4
910 ---
3232
3333 For 0.5:
3434
35 * hexadecimal literals.
3635 * source code comments.
3736
3837 For 0.6:
3535 if self.scan_pattern(r'\,|\@|\+|\{|\}', 'operator'):
3636 return
3737 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))
3843 return
3944 if self.scan_pattern(r'\"(.*?)\"', 'string literal',
4045 token_group=2, rest_group=3):
6060 = z: 1
6161
6262 | routine main {
63 | ld a, 255
63 | ld a, $ff
6464 | st off, c
6565 | add a, 1
6666 | }
1818 | }
1919 = ok
2020
21 Syntax error
21 Hex literals.
22
23 | routine main {
24 | ld a, $ff
25 | add a, $01
26 | }
27 = ok
28
29 Syntax error.
2230
2331 | routine foo (
2432 | ld a, 0
2634 | )
2735 ? SyntaxError
2836
29 Another syntax error
37 Another syntax error.
3038
3139 | byte glee
3240 | {