diff options
Diffstat (limited to 'cxrefbas.c')
-rw-r--r-- | cxrefbas.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -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: |