remy / vscode-nextbasic

VS Code tools for NextBASIC
https://marketplace.visualstudio.com/items?itemName=remysharp.nextbasic
8 stars 2 forks source link

PRINT POINT encoding bug #49

Closed NealeTools closed 4 months ago

NealeTools commented 4 months ago

5 %i=5 10 DIM s$(10,20) 20 PRINT s$(%i,1 TO 10) 30 PRINT POINT %i<<3,%i;s$(%i,1 TO 10)

Fails on line 30. In case it helps, small mods that pass: 30 PRINT POINT %i,%i;s$(%i,1 TO 10) 30 PRINT POINT %i<<3,%i;s$(%i)

Tested on v1.11.1 (integer slicing is a 2.08/.09 addition).

remy commented 4 months ago

Note to self, the error is this line:

 30 PRINT POINT %i<<3,%i;s$(%i,1 TO 10)

Because the 1 TO 10 are being treated as ints instead of regular numbers (parsing bug).

NealeTools commented 4 months ago

Nice catch. Indeed: adding %tokens to the slicing solves this: 30 PRINT POINT %i<<3,%i;s$(%i,%1 TO %10)

remy commented 4 months ago

I've got a fix in the wings for this (and your LAYER issue too) - both related to the same parsing problem.

NealeTools commented 4 months ago

Hi Remy. Was this fixed? I have a similar issue in v1.11.3: 10 PRINT AT %1,%29;%840/PEEK 23672 Gives Nonsense in BASIC. This used to work fine on earlier VSCode versions. Removing the integer % before 840 avoids the error. NOTE: The error seems to arise after the PRINT has completed (note the "3" printed on screen).

image
NealeTools commented 4 months ago

@remy Is this fixed as well? 10 PRINT AT %1,%29;%840/PEEK 23672