aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vxrefbas.160
-rw-r--r--vxrefbas.c18
-rw-r--r--vxrefbas.rst30
3 files changed, 102 insertions, 6 deletions
diff --git a/vxrefbas.1 b/vxrefbas.1
index 6c7b7ec..17780d9 100644
--- a/vxrefbas.1
+++ b/vxrefbas.1
@@ -83,6 +83,66 @@ Print version number and exit.
Verbose operation. When displaying a number in verbose mode, it will
be prefixed with \fI$\fP if it\(aqs in hex, or no prefix for decimal.
.UNINDENT
+.SH BUGS
+.sp
+This program:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+10 FILE=1:INPUT #FILE,LINE$
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Results in this:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+FILE/80: 10=AI (1)
+LINE$/81: 10=AI (1)
+ 2 variables, 0 unreferenced.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBvxrefbas\fP thinks \fIFILE\fP is being \fIINPUT\fP on line 10, which it isn\(aqt.
+The output for \fIFILE\fP should read \fI10=A (1)\fP\&.
+.sp
+Also, this program:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+10 DIM A(1):A(0)=10
+20 DIM B(A(0))
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Results in this:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+A(/80: 10=AD 20=D (2)
+B(/81: 20=D (1)
+ 2 variables, 0 unreferenced.
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+\fBvxrefbas\fP thinks \fIA(\fP is being DIMensioned on line 20, which it isn\(aqt. The
+output for \fIA(\fP should read \fI10=AD 20 (2)\fP\&.
.SH EXIT STATUS
.sp
0 for success, 1 for failure.
diff --git a/vxrefbas.c b/vxrefbas.c
index 21e8067..acc830c 100644
--- a/vxrefbas.c
+++ b/vxrefbas.c
@@ -7,10 +7,8 @@
#include "bas.h"
-/* FIXME: lists don't work correctly yet, DIM/READ/INPUT.
- Example: 10 DIM A$(10):? B$ ...it thinks B$ was also DIMed. */
-
int target_var, lastline, assign, is_for, is_next, is_dim, is_read, is_input;
+int in_dim, in_read, in_input;
int refcounts[128];
void print_help(void) {
@@ -48,16 +46,23 @@ CALLBACK(new_command) {
case CMD_NEXT:
is_next = 1; break;
case CMD_DIM:
- is_dim = 1; break;
+ in_dim = 1; break;
case CMD_READ:
- is_read= 1; break;
+ in_read= 1; break;
case CMD_INPUT:
- is_input= 1; break;
+ in_input= 1; break;
default: break;
}
}
+CALLBACK(end_stmt) {
+ in_dim = in_read = in_input = 0;
+}
+
CALLBACK(handle_var) {
+ if(in_dim) is_dim = 1;
+ if(in_input) is_input = 1;
+ if(in_read) is_read = 1;
if(lastline == lineno) return;
if((tok & 0x7f) == target_var) {
refcounts[target_var]++;
@@ -82,6 +87,7 @@ int main(int argc, char **argv) {
on_start_line = new_line;
on_end_line = end_line;
on_cmd_token = new_command;
+ on_end_stmt = end_stmt;
target_var = 0;
vnpos = vnstart;
diff --git a/vxrefbas.rst b/vxrefbas.rst
index 155cd80..510d016 100644
--- a/vxrefbas.rst
+++ b/vxrefbas.rst
@@ -64,6 +64,36 @@ General Options
Verbose operation. When displaying a number in verbose mode, it will
be prefixed with *$* if it's in hex, or no prefix for decimal.
+BUGS
+====
+
+This program::
+
+ 10 FILE=1:INPUT #FILE,LINE$
+
+Results in this::
+
+ FILE/80: 10=AI (1)
+ LINE$/81: 10=AI (1)
+ 2 variables, 0 unreferenced.
+
+**vxrefbas** thinks *FILE* is being *INPUT* on line 10, which it isn't.
+The output for *FILE* should read *10=A (1)*.
+
+Also, this program::
+
+ 10 DIM A(1):A(0)=10
+ 20 DIM B(A(0))
+
+Results in this::
+
+ A(/80: 10=AD 20=D (2)
+ B(/81: 20=D (1)
+ 2 variables, 0 unreferenced.
+
+**vxrefbas** thinks *A(* is being DIMensioned on line 20, which it isn't. The
+output for *A(* should read *10=AD 20 (2)*.
+
EXIT STATUS
===========