BASIC: RENUM [start[,step]] renumbers lines and their references
Fixes the numbers after GOTO, GOSUB, THEN, RUN and ON ... GOTO/GOSUB; missing targets, quotes, REM and DATA are left alone. The new program is built above the old one and copied down at the end, so a step of 0, numbers past 65535, an over-long line or lack of memory change nothing. To make room without giving up --opt-code-speed: one decimal formatter (fmt_ul) shared by LIST, RENUM and number printing; fmt_num's output branches merged (same text for ~2M test values); parse_num reads the whole part and decimals in one loop. Works around an SDCC 4.5 bug that turned a 0-trip loop into a 256-trip djnz. Adds basic/test-renum.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c553824df0
commit
8f098b5502
7 files changed
+10302
-10089
No files matched your search
+10047
-10047
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user