Reduce number of errors under Python 3 another smidge.
Chris Pressey
3 years ago
0 | |
#!/usr/bin/env python
|
|
0 |
#!/usr/bin/env python3
|
1 | 1 |
|
2 | 2 |
"""Usage: sixtypical [OPTIONS] FILES
|
3 | 3 |
|
171 | 171 |
|
172 | 172 |
@classmethod
|
173 | 173 |
def format_set(cls, location_refs):
|
174 | |
return '{%s}' % ', '.join([str(loc) for loc in sorted(location_refs)])
|
|
174 |
return '{%s}' % ', '.join([str(loc) for loc in sorted(location_refs, key=lambda x: x.name)])
|
175 | 175 |
|
176 | 176 |
|
177 | 177 |
class IndirectRef(Ref):
|
2000 | 2000 |
A trashed value that has been saved can be used inside the block.
|
2001 | 2001 |
It will continue to be trashed outside the block.
|
2002 | 2002 |
|
|
2003 |
(Note, both x and a are unmeaningful in this test.)
|
|
2004 |
|
2003 | 2005 |
| routine main
|
2004 | 2006 |
| inputs a
|
2005 | 2007 |
| outputs a, x
|
|
2012 | 2014 |
| ld x, 1
|
2013 | 2015 |
| }
|
2014 | 2016 |
| }
|
2015 | |
? UnmeaningfulOutputError: x
|
|
2017 |
? UnmeaningfulOutputError
|
2016 | 2018 |
|
2017 | 2019 |
The known range of a value will be preserved outside the block as well.
|
2018 | 2020 |
|
|
2271 | 2273 |
| }
|
2272 | 2274 |
? ForbiddenWriteError: lives
|
2273 | 2275 |
|
2274 | |
a, z, and n are trashed, and must be declared as such
|
|
2276 |
a, z, and n are trashed, and must be declared as such.
|
|
2277 |
|
|
2278 |
(Note, both n and z are forbidden writes in this tests.)
|
2275 | 2279 |
|
2276 | 2280 |
| byte lives
|
2277 | 2281 |
| routine main
|
|
2279 | 2283 |
| {
|
2280 | 2284 |
| copy 0, lives
|
2281 | 2285 |
| }
|
2282 | |
? ForbiddenWriteError: n
|
|
2286 |
? ForbiddenWriteError
|
2283 | 2287 |
|
2284 | 2288 |
a, z, and n are trashed, and must not be declared as outputs.
|
2285 | 2289 |
|