aboutsummaryrefslogtreecommitdiff
path: root/listbas.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-16 19:21:51 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-16 19:21:51 -0400
commit8f4d68dfc51726bc3f53742524522ad254f66117 (patch)
tree13699ad1a81c9371fe083ab65873aaf70c01e6b2 /listbas.c
parent21ed0c9090c6bab5e315474cd3a959abeb70ac11 (diff)
downloadbw-atari8-tools-8f4d68dfc51726bc3f53742524522ad254f66117.tar.gz
listbas: colorize aplus ops correctly, fix spacing of THEN, NOT, etc.
Diffstat (limited to 'listbas.c')
-rw-r--r--listbas.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/listbas.c b/listbas.c
index 8c55f99..de375fd 100644
--- a/listbas.c
+++ b/listbas.c
@@ -492,12 +492,20 @@ CALLBACK(print_cmd) {
}
void aplus_op_color_on(unsigned char tok) {
- switch(tok) {
- default:
- break;
+ int c = color_op;
+
+ if((tok >= 0x17 && tok <= 0x1c) || (tok >= 0x29 && tok <= 0x2b)) {
+ /* keywords */
+ c = color_cmd;
+ } else if(tok >= 0x40) {
+ /* functions */
+ c = color_func;
+ } else if(tok == 0x38 || tok == 0x39) {
+ /* unary +/- */
+ c = color_const;
}
- color_on(color_op);
+ color_on(c);
}
void op_color_on(unsigned char tok) {