aboutsummaryrefslogtreecommitdiff
path: root/cxrefbas.c
diff options
context:
space:
mode:
Diffstat (limited to 'cxrefbas.c')
-rw-r--r--cxrefbas.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/cxrefbas.c b/cxrefbas.c
index 7cc3114..9228f28 100644
--- a/cxrefbas.c
+++ b/cxrefbas.c
@@ -8,6 +8,14 @@
#include "bas.h"
#include "bcdfp.h"
+/* not yet...
+typedef struct {
+ unsigned short lineno;
+ unsigned short pos;
+ unsigned char type;
+} lineref_t;
+*/
+
unsigned short *linerefs[32769];
int refcounts[32769];
int lines_exist[32769];
@@ -79,6 +87,10 @@ void computed_msg(unsigned short lineno) {
cmd = "RESTORE"; break;
case CMD_TRAP:
cmd = "TRAP"; break;
+ /*
+ case CMD_IF:
+ cmd = "IF/THEN"; break;
+ */
case CMD_ON:
if(on_op == OP_GOSUB)
cmd = "ON/GOSUB";
@@ -107,6 +119,7 @@ CALLBACK(got_var) {
}
CALLBACK(got_exp) {
+ unsigned char last_tok = program[pos - 1];
int standalone;
if(last_cmd == CMD_ON) {
@@ -129,8 +142,12 @@ CALLBACK(got_exp) {
computed_msg(lineno);
}
break;
+ case CMD_IF:
+ if(last_tok == OP_THEN) {
+ add_lineref(lineno, fp2int(program + pos + 1));
+ }
+ break;
case CMD_ON: {
- unsigned char last_tok = program[pos - 1];
switch(last_tok) {
case OP_GOTO:
case OP_GOSUB: