1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2025-02-21 04:29:14 +00:00

Reduce number of errors under Python 3 another smidge.

This commit is contained in:
Chris Pressey 2018-09-06 14:21:29 +01:00
parent 3c1564ea09
commit 3fd7e52bc7
3 changed files with 9 additions and 5 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
"""Usage: sixtypical [OPTIONS] FILES """Usage: sixtypical [OPTIONS] FILES

View File

@ -172,7 +172,7 @@ class LocationRef(Ref):
@classmethod @classmethod
def format_set(cls, location_refs): def format_set(cls, location_refs):
return '{%s}' % ', '.join([str(loc) for loc in sorted(location_refs)]) return '{%s}' % ', '.join([str(loc) for loc in sorted(location_refs, key=lambda x: x.name)])
class IndirectRef(Ref): class IndirectRef(Ref):

View File

@ -2001,6 +2001,8 @@ It will continue to be defined outside the block.
A trashed value that has been saved can be used inside the block. A trashed value that has been saved can be used inside the block.
It will continue to be trashed outside the block. It will continue to be trashed outside the block.
(Note, both x and a are unmeaningful in this test.)
| routine main | routine main
| inputs a | inputs a
| outputs a, x | outputs a, x
@ -2013,7 +2015,7 @@ It will continue to be trashed outside the block.
| ld x, 1 | ld x, 1
| } | }
| } | }
? UnmeaningfulOutputError: x ? UnmeaningfulOutputError
The known range of a value will be preserved outside the block as well. The known range of a value will be preserved outside the block as well.
@ -2272,7 +2274,9 @@ Can't `copy` to a memory location that doesn't appear in (outputs trashes).
| } | }
? ForbiddenWriteError: lives ? ForbiddenWriteError: lives
a, z, and n are trashed, and must be declared as such a, z, and n are trashed, and must be declared as such.
(Note, both n and z are forbidden writes in this tests.)
| byte lives | byte lives
| routine main | routine main
@ -2280,7 +2284,7 @@ a, z, and n are trashed, and must be declared as such
| { | {
| copy 0, lives | copy 0, lives
| } | }
? ForbiddenWriteError: n ? ForbiddenWriteError
a, z, and n are trashed, and must not be declared as outputs. a, z, and n are trashed, and must not be declared as outputs.