remy / vscode-nextbasic

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

Export fails due to parsing bugs (examples in thread): #59

Closed NealeTools closed 4 weeks ago

NealeTools commented 2 months ago

v1.11.7 There are a few parsing bugs that pass OK into RunInCSpect, but are picked up as errors in Export (and cause export to fail).

Examples:

%CODE:

image

ERROR$:

image

IF %SPRITE AT (j,1)>127 THEN SPRITE CONTINUE %j,,%SPRITE AT (j,1)-(i*i[0]) TO %239 STEP %SGN{-i[0]} RUN (I think this is referring to both the "TO %239" and "%SGN{-i[0]}" parts, both of which are valid syntax and actually encode fine I think it i just the error stops the export.

image
remy commented 1 month ago

Note to self: I need to merge the logic from the parser across to the validation (specifically subStatement int logic)

NealeTools commented 1 month ago

Bump: example 2 and 3 still fail export in v1.11.8

remy commented 1 month ago

Yeah, this is validation, as per my comment, I need to make time to merge the logic from the new parsing to the validator (not a simple process)

NealeTools commented 1 month ago

In the short-term could you just turn off the validator? The code compiles and runs fine in CSpect, so the tokenisation is OK, but export never happens due to the check, so I cannot test any export functionality etc. :-)

remy commented 1 month ago

yep - you can disable it from the settings ("Perform custom inline NextBASIC validation" - uncheck that)

NealeTools commented 1 month ago

Great! My apologies for not realising what this option did! 🫣

NealeTools commented 1 month ago

Hi @remy : Unfortunately, unticking this option does not allow the export to complete. I can see that the red underline no longer is present, but the file does not build if there are any syntax errors. This prevents me exporting to test on HW via NextSync, which is an essential part of my workflow now because I am using some HW features that CSpect does not support - thanks!

image
remy commented 1 month ago

I'll sort this. That checkbox is primarily there to disable validation across the board and allow export even when my (wrong) validation fails.

On Thu, 13 Jun 2024, 11:06 MattN, @.***> wrote:

Hi @remy https://github.com/remy : Unfortunately, unticking this option does not allow the export to complete. I can see that the red underline no longer is present, but the file does not build if there are any syntax errors. This prevents me exporting to test on HW via NextSync, which is an essential part of my workflow now because I am using some HW features that CSpect does not support - thanks! image.png (view on web) https://github.com/remy/vscode-nextbasic/assets/19664927/a783ffff-c0b0-4076-9086-3d4818be434c

— Reply to this email directly, view it on GitHub https://github.com/remy/vscode-nextbasic/issues/59#issuecomment-2165204016, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADLBBXPVQVZL2TWRARVBDZHFVLFAVCNFSM6AAAAABJG2NHZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRVGIYDIMBRGY . You are receiving this because you were mentioned.Message ID: @.***>

NealeTools commented 1 month ago

@remy Apologies for the nag, but is there any quick fix for turning off the validation on export? I feel like the new parser is 99% there! :-) The validation check is currently preventing me from exporting working code as multiple .bank sections—or indeed exporting any code for test on HW. Thanks!

remy commented 4 weeks ago

I'm snagging early morning time to get these done.

Any chance you have a snippet of the code that's causing this. I'm reviewing the code and it "says" it's not validating by default, so I wonder if I'm missing something else...

NealeTools commented 4 weeks ago

IF %SPRITE AT (j,1)>127 THEN SPRITE CONTINUE %j,,%SPRITE AT (j,1)-(i*i[0]) TO %239 STEP %SGN{-i[0]} RUN

NealeTools commented 4 weeks ago

Also %CODE and ERROR$ get underlined. They pass "run in CSpect", so get encoded correctly, but the syntax checker flags them (red underline) and stops the Export script.

NealeTools commented 4 weeks ago

Actually, %CODE seems OK now, but ERROR$ is underlined and fails:

image
NealeTools commented 4 weeks ago

Here is the another one:

image
remy commented 4 weeks ago

Found the code now, it says the default is false, but somehow I changed the default much deeper down to true 🤦

remy commented 4 weeks ago

Okay, v1.11.1 (all the ones) disables validation during export. Sorry that took so long.

NealeTools commented 4 weeks ago

Thanks Remy! I can confirm the export now works (syntax is still underlined in red when enabled).

I'll try out bank exports next and hopefully there won't be any further headaches I unearth! :-)