Allowing blank lines...

This commit is contained in:
Rob Greene 2018-05-19 20:48:23 -05:00
parent b715dbc536
commit fc2a0ca979
2 changed files with 6 additions and 0 deletions

View File

@ -55,6 +55,10 @@ public class Parser {
public int expectNumber() {
Token c = tokens.remove();
while (c.type == Type.EOL) {
// Allow blank lines...
c = tokens.remove();
}
if (c.type != Type.NUMBER) {
throw new RuntimeException("Expected a number in line #" + c.line);
}

View File

@ -1,4 +1,5 @@
10 GOTO 100
20 REM DRAW CIRCLE ROUTINE
30 FOR A = 0 TO PT
40 X = X(A) * SZ:Y = Y(A) * SZ
@ -8,6 +9,7 @@
80 HPLOT XO - X,YO - Y
90 NEXT A
95 RETURN
100 REM MAIN PROGRAM
110 HGR
115 C(0)=1:C(1)=2:C(2)=3:C(3)=5:C(4)=6:C(5)=7