Giter Club home page Giter Club logo

Comments (19)

remy avatar remy commented on May 27, 2024

Okay, so there's something you're seeing that I'm not - here's a screenshot, the renumbering isn't happening for me:

SCR-20240310-jcxe

Untitled.bas is the result of the export command in vscode. Then I tested with both the command line bas2txt and the vscode import command, both result in the correct line numbers.

The sequence I used was -

  • copy your code above
  • select nextbasic as the language
  • "export to binary .bas"

from vscode-nextbasic.

remy avatar remy commented on May 27, 2024

I should add, when I run with cspect, the result is the same - I don't have any renumbering happening…

It shouldn't matter, but worth removing all .bas files just to clear out any (potential) confusion with other files? Then repeat?

from vscode-nextbasic.

NealeTools avatar NealeTools commented on May 27, 2024

I did that (cleaned up directory). And in my workflow I get the same result I was seeing after opening Untitled.bas and converting:
image

from vscode-nextbasic.

NealeTools avatar NealeTools commented on May 27, 2024

Are there possibly two export to binary commands? I'm using SHIFT+OPTION+E

from vscode-nextbasic.

remy avatar remy commented on May 27, 2024

Nope, shift+opt+e is just bound to the nextbasic.export command.

I'm trying to update the tool on zx.remysharp.com to see if we can get out of vscode to find out if that's the issue (maybe some config that I'm missing…) - but I've got some build problems so I'll let you know where I get to.

If you have node installed (and you want to do more testing - https://nodejs.org/en) - you could install node, then on the command line run: npm install --global txt2bas, then with your source file (let's assume it's called test.bas.txt) run:

txt2bas -i text.bas.txt | bas2txt

This will convert it and then import and spit out the plain text. If you still have renumbering, then upload the contents of text.bas.txt, if you don't have renumbering, then it's vscode somewhere…

from vscode-nextbasic.

NealeTools avatar NealeTools commented on May 27, 2024

This works fine:
gdsc021754:GeneralCode mn98$ txt2bas -i FirstTest.bas | bas2txt
#autostart 1
5 RUN AT 3: PRINT "<<< MULTI_BANK_OUTPUT >>>"
10 LOAD "BANK20" BANK 20
15 LOAD "BANK21" BANK 21
17 LOAD "BANK22" BANK 22
20 PRINT "BASIC ON THE..."
30 BANK 20 GO SUB 30
35 BANK 21 GO SUB 30
37 BANK 22 GO SUB 30
40 GO TO 20

But this is also true of the RunInCSpect version (no aberrant renumbering).
The only one that renumbers is the Export to binary .bas.

from vscode-nextbasic.

remy avatar remy commented on May 27, 2024

I'm still a bit stumped as to how this is happening. Are you able to reduce it right down to replicate?

from vscode-nextbasic.

NealeTools avatar NealeTools commented on May 27, 2024

I'll have a look again tonight. I may also just try a VSCode etc reinstall...

from vscode-nextbasic.

NealeTools avatar NealeTools commented on May 27, 2024

OK - just tried on my work machine. It is fine!
So it has to be a problem with my laptop install. I'll rework that tonight an see if it fixes it!
image

from vscode-nextbasic.

remy avatar remy commented on May 27, 2024

Weird.

I've pushed a release now (which will sort out those red lines on the line numbers too).

from vscode-nextbasic.

NealeTools avatar NealeTools commented on May 27, 2024

Uninstalled and reinstalled v1.11.4 and still the same result on my laptop...
image

from vscode-nextbasic.

NealeTools avatar NealeTools commented on May 27, 2024

@remy
OMG I solved it. And I seem to recall this was also a bug from ages and ages ago...
image

Strip Comments during export!!!
image
I had this ticked—which seems to switch on auto-renumber!
Hopefully this will be an easy fix!

from vscode-nextbasic.

remy avatar remy commented on May 27, 2024

Right, re-opening with that detail 👍

from vscode-nextbasic.

remy avatar remy commented on May 27, 2024

I know why it renumbers - because if you have something like "20 REM this is a comment" it renumbers to get that out of the way. I suspect the safest approach is just to remove them and leave gaps in the numbering (which, probably doesn't matter)

from vscode-nextbasic.

NealeTools avatar NealeTools commented on May 27, 2024
  1. By the way, ticking the "strip comments" option doesn't actually seem to remove comments that use semi colon when doing RunInCSpect ;
    Is that a bug? Or is this only relevant for the Export to bas version but not the RunInCspect version?
  2. Are # lines always stripped, regardless of option ticking?
  3. Finally, .asm uses ;comments to denote lines of inline assembly that follow the .asm token. You may want to consider handling that?

from vscode-nextbasic.

remy avatar remy commented on May 27, 2024
  1. It's for export - I'll clarify that in the options (unless you think it should apply across both export and test?)
  2. Lines with # aren't comments, they're definitions for the txt2bas to process, so these are always removed in the basic file, but an attempt to restore them happens in the bas2txt.
  3. The .asm is kinda arbitrary, it could be .convert_to_asm, but these dotfiles rely on parsing the source nextbasic tokens to find comments in the code, slurp them up and convert to bytecode. So this is down to the author to ensure these remain.

What I might do is to add a detail to the notification that comes up to state the comments have been stripped in the export

from vscode-nextbasic.

NealeTools avatar NealeTools commented on May 27, 2024
  1. It perhaps would be more consistent if both export and test behaved the same. After all, the RunInCSpect test version is also exporting to the .bas format.
  2. Understood (now). I think I've had this ticked by default because I thought it was necessary to remove the # lines.
  3. Understood. I like the idea of a notification.

I'm still not clear why stripping lines with REM/; comments in them necessitates a global (or any) renumber. I think stripping comments and renumbering can/should be independently controlled.

from vscode-nextbasic.

remy avatar remy commented on May 27, 2024

On the renumbering: that was just a decision I made, and it's wrong. So I'm reversing it and will public the fix (which is why I reopened this issue)

from vscode-nextbasic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.