diff options
author | B. Watson <urchlay@slackware.uk> | 2024-06-17 17:05:51 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-06-17 17:05:51 -0400 |
commit | 2a73f95e7204ded74409adc03eeac62868e3500f (patch) | |
tree | 6887a9803e4421df99c41fc1d7e8a13f2cd036ac /cxrefbas.c | |
parent | ed910cdfa474bd7a3fd0cf3082119abc41b094e4 (diff) | |
download | bw-atari8-tools-2a73f95e7204ded74409adc03eeac62868e3500f.tar.gz |
cxrefbas: handle IF <x> THEN <lineno>.
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: |