remy / vscode-nextbasic

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

Error tokenizing BIN #7

Closed jsanjose closed 4 years ago

jsanjose commented 4 years ago

Testing the "spriteAnim" example that comes with Next, previously converted to text file with dot command bas2txt, if I launch it with "run with cspect" it gives me an "Integer out of range" error on this line:

310 SPRITE CONTINUE 0,0 TO 303 STEP 1 RUN ,0 TO 240 STEP 1 RUN ,1 TO 4, BIN 1000,rate+8

If I delete and enter this line by hand into the BASIC editor it works. Same happens on line 370:

370 SPRITE -2,16,0,1,1, BIN 110

So I suspect it's something about tokenizing BIN.

remy commented 4 years ago

You're finding them all 😄 - but thank you for filing the issues, it lets me squash them.

(I've got a fix ready for #5 - I just need to package it up with tests - I just want to bundle these together in one go).

I'm not sure if this is a bug with my lexer not preventing that line from parsing, or if I've missed a trick somewhere, but I'm pretty sure you can work around the bug (for the time being) by using % BIN 110.

jsanjose commented 4 years ago

Thanks, if you prefer I report them all as one issue tell me and I will do so.

remy commented 4 years ago

Oh, no, definitely prefer individual issues - it helps me find them later and track individual isolated issues better 👍

remy commented 4 years ago

Confirmed - (note to self) my code is encoding the binary value as a literal number (so 0E 00 00 6E 00 00 instead of 0E 00 00 06 00 00)

remy commented 4 years ago

These fixes (the channel number fix too) are going up to the vscode extension @ 1.3.6 - live in a few minutes (apparently)