From 1f10767c83fb70731e3cf1b4aeae3c1beb8f356b Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 18 Jun 2024 02:01:43 -0400 Subject: docs: move "General Options" to genopts.rst, include it where needed. --- renumbas.rst | 47 +++++++++++++---------------------------------- 1 file changed, 13 insertions(+), 34 deletions(-) (limited to 'renumbas.rst') diff --git a/renumbas.rst b/renumbas.rst index a0b79ba..7d963b1 100644 --- a/renumbas.rst +++ b/renumbas.rst @@ -32,11 +32,13 @@ e.g. if line 100 gets changed to 200, any other line that does a GOTO 100 (or GOSUB, RESTORE, TRAP, etc) will be updated with the new line number. -Computed line numbers can't be updated (e.g. GOTO A or GOSUB -1000+A*100). These will draw warnings on stderr, so you can fix them +Computed line numbers can't be updated (e.g. *GOTO A or GOSUB +1000+A*100*). These will cause warnings on stderr, so you can fix them manually. -Line numbers that don't exist will not be changed (e.g. TRAP 40000). +Valid line numbers (0 to 32767) that don't exist will not be changed, +but will cause a warning. Invalid line numbers (e.g. *TRAP 40000*) +will be ignored (no change, no warning). Remember that the maximum line number for Atari BASIC is 32767. Renumbering will fail, if the chosen start and increment values @@ -49,18 +51,6 @@ Options may appear in any order. The first non-option argument is used for **input-file**; the second is **output-file**. A third non-option argument is an error. -General Options ---------------- -**--help** - Print usage message and exit. - -**--version** - Print version number and exit. - -**-v** - Verbose operation. When displaying a number in verbose mode, it will - be prefixed with *$* if it's in hex, or no prefix for decimal. - Renumber Options ---------------- **-s** *start-lineno* @@ -73,32 +63,21 @@ Renumber Options Line number in original program where renumbering will start. Lines numbered lower that this will not be renumbered. Default: 0. +.. include:: genopts.rst + LIMITATIONS =========== -Computed line numbers with ON ------------------------------ -If an ON/GOTO or ON/GOSUB uses computed line numbers (and causes a -warning), none of the line numbers after the first computed one will -be updated, even if they are constant. Example:: - - 100 ON X GOTO 10,20*Y,30 - -The 10 will be changed to whatever line 10 got renumbered to, as expected. The 20 -will *not* be changed. **renumbas** just gives up, after the first computed -line number. - A pathological case:: - 100 ON X GOTO 10+0,20+0 + 100 GOTO 200+0 -The 10+0 and 20+0 are considered computed line numbers, even though -the results of the computation are constant. This is because neither -Atari BASIC nor **renumbas** does constant folding. +200+0 is considered a computed line number, even though the results of +the computation are constant. This is because neither Atari BASIC nor +**renumbas** does constant folding. -None of this should be a real-world problem: computed line numbers in -ON/GOTO or ON/GOSUB are exceedingly rare. The whole *point* of ON is -to avoid computing line numbers. +This shouldn't be a real-world problem; did *you* ever write code like +that in Atari BASIC? Warning line numbers -------------------- -- cgit v1.2.3