Skip to content

Commit

Permalink
Add test for "20 DATA GOTO 10" (should be negative)
Browse files Browse the repository at this point in the history
Anything in a DATA statement is not a token and should not be
considered a jump target.
  • Loading branch information
hackerb9 committed Jul 10, 2024
1 parent 3134286 commit a3e8fcb
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions samples/JUMPTEST.DO
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
1 ' Test for m100-jumps.lex which
2 ' emits all lines which are targets
3 ' of GOTO or similar commands.
4 ' Line numbers <500 should be printed. >= 500 should not.
5 '
6 ' When testing m100-decommenter,
7 ' lines 500--1000 will be removed.
8 '
10 REM ERL Equals
20 REM ERL Less than
30 REM ERL Less than or equal to
Expand All @@ -8,11 +16,18 @@
80 REM Less than or equal to ERL
90 REM Greater than ERL
100 REM Greater than or equal to ERL
110 REM 110-
120 REM 120-130
130 REM 120-130
140 REM -140
110 REM LLIST 110-
120 REM 120-130
130 REM 120-130
140 REM -140
150 REM ALL CATS ARE GREY
160 REM RUN 160
170 REM GOSUB 170
180 REM ON A GO TO 1,2,3, 180, 4,5,6,7,8,9
500 '
510 REM DATA GOTO 510
520 REM DATA "GOTO 520"
1000 '
1010 IF ERL = 10 THEN PRINT "Equals works"
1020 IF ERL < 20 THEN PRINT "Less than works"
1030 IF ERL <= 30 THEN PRINT "Less than or equal works"
Expand All @@ -28,3 +43,9 @@
1130 LLIST -
1140 LLIST - 140
1150 GOTO 150
1160 RUN 160
1170 GOSUB 170
1170 ON A GO TO 1,2,3, 180, 4,5,6,7,8,9
1500 '
1510 DATA GOTO 510
1520 DATA "GOTO 520"

0 comments on commit a3e8fcb

Please sign in to comment.