From c87e1097e5d0b35cc8d9b62d6d8df23087039bbe Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 27 Jun 2024 04:06:44 -0400 Subject: token.h, bas.h: commentary. --- bas.h | 4 ++-- tokens.c | 38 +++++++++++++++++++------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/bas.h b/bas.h index 211004e..3a24c38 100644 --- a/bas.h +++ b/bas.h @@ -139,8 +139,8 @@ #define OP_DIM_ARR_LPAR 0x39 #define OP_FUNC_LPAR 0x3a #define OP_DIM_STR_LPAR 0x3b -#define OP_ARR_COMMA 0x3c -#define OP_FUNC_STR 0x3d +#define OP_ARR_COMMA 0x3c /* used for A(1,1) or A$(1,1) (also in DIM) */ +#define OP_FUNC_STR 0x3d /* the rest are functions */ #define OP_FUNC_CHR 0x3e #define OP_FUNC_USR 0x3f #define OP_FUNC_ASC 0x40 diff --git a/tokens.c b/tokens.c index 32a818c..ce7b846 100644 --- a/tokens.c +++ b/tokens.c @@ -63,29 +63,29 @@ const char *operators[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - ",", + ",", /* $12 */ "$", - ":", + ":", /* $14, named OP_COLON and OP_EOS in bas.h */ ";", - "", /* $16, EOL */ + "", /* $16, EOL */ " GOTO ", - " GOSUB ", /* $18 */ + " GOSUB ", /* $18 */ " TO ", " STEP ", " THEN ", - "#", + "#", /* $1C */ "<=", "<>", ">=", - "<", /* $20 */ + "<", /* $20 */ ">", "=", "^", - "*", + "*", /* $24 */ "+", "-", "/", - " NOT ", /* $28 */ + " NOT ", /* $28 */ " OR ", " AND ", "(", @@ -93,43 +93,43 @@ const char *operators[] = { "=", "=", "<=", - "<>", /* $30 */ + "<>", /* $30 */ ">=", "<", ">", - "=", + "=", /* $34 */ "+", "-", "(", - "", /* $38, redunant "(" for arrays */ - "", /* $39, ditto for strings */ + "", /* $38, redundant "(" for arrays */ + "", /* $39, ditto for strings */ "(", "(", - ",", + ",", /* $3C */ "STR$", "CHR$", "USR", - "ASC", /* $40 */ + "ASC", /* $40 */ "VAL", "LEN", "ADR", - "ATN", + "ATN", /* $44 */ "COS", "PEEK", "SIN", - "RND", /* $48 */ + "RND", /* $48 */ "FRE", "EXP", "LOG", - "CLOG", + "CLOG", /* $4C */ "SQR", "SGN", "ABS", - "INT", /* $50 */ + "INT", /* $50 */ "PADDLE", "STICK", "PTRIG", - "STRIG" /* $54 */ + "STRIG" /* $54 */ }; const unsigned short last_operator = (sizeof(operators) / sizeof(char *)) - 1; -- cgit v1.2.3