aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bas.h4
-rw-r--r--tokens.c38
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;