mirror of
https://github.com/catseye/SixtyPical.git
synced 2025-01-08 19:30:29 +00:00
Well, that's a hack. But it works.
This commit is contained in:
parent
a9bd8a3714
commit
a933c81768
@ -5,6 +5,7 @@ History of SixtyPical
|
|||||||
-------
|
-------
|
||||||
|
|
||||||
* Added `byte table` type locations and indexed addressing (`+ x`, `+ y`).
|
* Added `byte table` type locations and indexed addressing (`+ x`, `+ y`).
|
||||||
|
* Integer literals may be given in hexadecimal.
|
||||||
|
|
||||||
0.4
|
0.4
|
||||||
---
|
---
|
||||||
|
@ -33,7 +33,6 @@ TODO
|
|||||||
|
|
||||||
For 0.5:
|
For 0.5:
|
||||||
|
|
||||||
* hexadecimal literals.
|
|
||||||
* source code comments.
|
* source code comments.
|
||||||
|
|
||||||
For 0.6:
|
For 0.6:
|
||||||
|
@ -37,6 +37,11 @@ class Scanner(object):
|
|||||||
return
|
return
|
||||||
if self.scan_pattern(r'\d+', 'integer literal'):
|
if self.scan_pattern(r'\d+', 'integer literal'):
|
||||||
return
|
return
|
||||||
|
if self.scan_pattern(r'\$([0-9a-fA-F]+)', 'integer literal',
|
||||||
|
token_group=2, rest_group=3):
|
||||||
|
# ecch
|
||||||
|
self.token = str(eval('0x' + self.token))
|
||||||
|
return
|
||||||
if self.scan_pattern(r'\"(.*?)\"', 'string literal',
|
if self.scan_pattern(r'\"(.*?)\"', 'string literal',
|
||||||
token_group=2, rest_group=3):
|
token_group=2, rest_group=3):
|
||||||
return
|
return
|
||||||
|
@ -61,7 +61,7 @@ Add honours carry.
|
|||||||
= z: 1
|
= z: 1
|
||||||
|
|
||||||
| routine main {
|
| routine main {
|
||||||
| ld a, 255
|
| ld a, $ff
|
||||||
| st off, c
|
| st off, c
|
||||||
| add a, 1
|
| add a, 1
|
||||||
| }
|
| }
|
||||||
|
@ -19,7 +19,15 @@ Rudimentary program.
|
|||||||
| }
|
| }
|
||||||
= ok
|
= ok
|
||||||
|
|
||||||
Syntax error
|
Hex literals.
|
||||||
|
|
||||||
|
| routine main {
|
||||||
|
| ld a, $ff
|
||||||
|
| add a, $01
|
||||||
|
| }
|
||||||
|
= ok
|
||||||
|
|
||||||
|
Syntax error.
|
||||||
|
|
||||||
| routine foo (
|
| routine foo (
|
||||||
| ld a, 0
|
| ld a, 0
|
||||||
@ -27,7 +35,7 @@ Syntax error
|
|||||||
| )
|
| )
|
||||||
? SyntaxError
|
? SyntaxError
|
||||||
|
|
||||||
Another syntax error
|
Another syntax error.
|
||||||
|
|
||||||
| byte glee
|
| byte glee
|
||||||
| {
|
| {
|
||||||
|
Loading…
Reference in New Issue
Block a user