Retain whitespace exactly, even leading and trailing on each line.
catseye
13 years ago
78 | 78 |
|
79 | 79 |
* Show a warning message if the program contains computed jumps.
|
80 | 80 |
* Show errors in the order they occur in the program.
|
|
81 |
* Handle duplicate and deleted lines (line number then nothing.)
|
81 | 82 |
|
82 | 83 |
Plans
|
83 | 84 |
-----
|
|
86 | 87 |
redundant `GOTO` to the next line, a line conaining another `GOTO`, and
|
87 | 88 |
so forth.
|
88 | 89 |
|
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.
|
159 | 159 |
if text is None:
|
160 | 160 |
self.command = None
|
161 | 161 |
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)
|
164 | 164 |
if match:
|
165 | 165 |
self.line_number = LineNumber(match.group(1))
|
166 | 166 |
text = match.group(2)
|
|
269 | 269 |
... '\n'
|
270 | 270 |
... '800 PRINT::print:ZORK 30\n'
|
271 | 271 |
... '10 oN ERROR gOtO 100, 6,7, 800 ,3\n'
|
|
272 |
... ' 99 what \n'
|
272 | 273 |
... 'if50then60\n'
|
273 | 274 |
... '50ifthisstuffistruegoto70\n'
|
274 | 275 |
... '60 If This Stuff Is True Then Print:GoTo 9\n'
|
|
280 | 281 |
<BLANKLINE>
|
281 | 282 |
800 PRINT::print:ZORK 30
|
282 | 283 |
10 oN ERROR gOtO 100, 6,7, 800 ,3
|
|
284 |
99 what
|
283 | 285 |
if50then60
|
284 | 286 |
50ifthisstuffistruegoto70
|
285 | 287 |
60 If This Stuff Is True Then Print:GoTo 9
|