git @ Cat's Eye Technologies yucca / 1a78593
Retain whitespace exactly, even leading and trailing on each line. catseye 13 years ago
2 changed file(s) with 12 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
7878
7979 * Show a warning message if the program contains computed jumps.
8080 * Show errors in the order they occur in the program.
81 * Handle duplicate and deleted lines (line number then nothing.)
8182
8283 Plans
8384 -----
8687 redundant `GOTO` to the next line, a line conaining another `GOTO`, and
8788 so forth.
8889
89 `yucca` can dump the input program with high fidelity; it retains case
90 and spacing of all lines, with the exception of stripping leading and
91 trailing whitespace from every line. This facility could be built upon
92 to give `yucca` the ability to renumber a program, or to supply missing
93 line numbers, or even transform a program with textual labels into one
94 with line numbers.
90 `yucca` can dump the input program with (as far as I can tell) total
91 fidelity; it retains case and spacing of all lines, even leading and
92 trailing whitespace.
93
94 This facility could be built upon to give `yucca` the ability to
95 renumber a program, or to supply missing line numbers, or even transform
96 a program with textual labels into one with line numbers.
159159 if text is None:
160160 self.command = None
161161 return
162 text = text.strip()
163 match = re.match(r'^(\d+\s*)(.*?)$', text)
162 text = text.rstrip('\r\n')
163 match = re.match(r'^(\s*\d+\s*)(.*?)$', text)
164164 if match:
165165 self.line_number = LineNumber(match.group(1))
166166 text = match.group(2)
269269 ... '\n'
270270 ... '800 PRINT::print:ZORK 30\n'
271271 ... '10 oN ERROR gOtO 100, 6,7, 800 ,3\n'
272 ... ' 99 what \n'
272273 ... 'if50then60\n'
273274 ... '50ifthisstuffistruegoto70\n'
274275 ... '60 If This Stuff Is True Then Print:GoTo 9\n'
280281 <BLANKLINE>
281282 800 PRINT::print:ZORK 30
282283 10 oN ERROR gOtO 100, 6,7, 800 ,3
284 99 what
283285 if50then60
284286 50ifthisstuffistruegoto70
285287 60 If This Stuff Is True Then Print:GoTo 9