endlos99/xdt99

xbas99 line label names and scope

Closed this issue · 7 comments

mcvde commented

This is a feature request.

  1. It'd be great to support underscores in the line label names to increase readability.
  2. An advanced feature would be limiting the scope (visibility) of line labels located in subprograms, so that duplicates within the whole program can exist, similar to using the same variable names in a program in separate subprograms. This would be helpful as there are many cases where a label such as "READ_NEXT_LINE" can be very descriptive in methods that are reading files. It's easy to have many in a program with lots of I/O. As it is right now, one must generate unique labels even when the names would otherwise be the same, such as READNEXTLINE01, ...02, etc.
  1. should be really easy to implement; I think I just missed '_' when looking at legal chars in variable names.

  2. is a good idea. I already have something like this for assembly and GPL, so again I can do something similar for BASIC. You'll have to mark these local variables somehow, since subprograms can also access global variables, and xbas99 needs to know which one is which.

mcvde commented

Cool, I'm glad #1 is just a simple miss.
On #2, without knowing the code, even something simple such as first character must be '_' to be local would be fine to me.

First char must be %, which is otherwise not legal in a label name.

mcvde commented

Excellent. Is there a length limit to the label names?

No, there isn't.

I've just pushed a new version of xbas99.py to the xdt99 repository. Please see this file for a description of the new features.

If everything is OK, I'll make a new release on the weekend.

mcvde commented

Awesome. I look forward to trying out the new features. Hopefully can do so over the weekend.