Closed rscottfree closed 1 year ago
This is ~an undocumented~ a "feature" of RENUMBER. If you omit the space between RENUMBER
and its first argument, it will omit the whitespace that precedes line numbers in the translated source.
Try RENUMBER 10,10
in the example above and it'll preserve the whitespace. Note that if the source started out with no space before the line number, it'll stay that way in either case.
I don't know what to say about this dubious feature, but it's clearly intentional from the code, so not really a bug. ~If anyone wants me to remove it such that whitespace is preserved regardless of invocation, please reopen the ticket and I'll gladly do so.~ 😄
Someone pointed out that this is actually a documented feature, I just didn't notice because it's newer than the printed User's Guide. I'm not happy with the documented justification of the feature or its design, but that's separate from the issue being reported here. The requested improvement is for this "optimisation" mode to not remove spaces after THEN
if THEN
is not followed by a line number.
I'll file a separate issue to propose changing its calling syntax to be more consistent with the rest of the API, e.g. RENUMBER C ...
to "crunch" spaces.
Test Environment (required)
Describe the bug Renumbering a basic program with
THEN
keyword will remove any whitespace that comes afterTHEN
.To Reproduce
Create a basic program like this:
Then run
RENUMBER10,10
List the program and you'll see the removed whitespace between
THEN
ANDPRINT
.Expected behavior It would be nice if the whitespace were preserved as it appears to be for other keywords
Additional context It behaves the same whether it's a logical or numeric expression after the
THEN
keyword. I consider this low priority but wanted to document it.