git @ Cat's Eye Technologies SixtyPical / 8efa73f
Explicitly sort the chains by their content, for stable sort. Chris Pressey 3 years ago
3 changed file(s) with 19 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
66 * Split TODO off into own file.
77 * `sixtypical` no longer writes the compiled binary to standard
88 output. The `--output` command-line argument should be given.
9 * Many tests pass when `sixtypical` is run with Python 3.
9 * All tests pass when `sixtypical` is run under Python 3.5.2.
1010
1111 0.16
1212 ----
4242
4343 while pending_routines:
4444 chains = [self.find_chain(k, pending_routines) for k in pending_routines.keys()]
45 chains.sort(key=len, reverse=True)
45 chains.sort(key=lambda x: (len(x), str(x)), reverse=True)
4646 c = chains[0]
4747 roster.append(c)
4848 for k in c:
173173 = "main"
174174 = ],
175175 = [
176 = "bar",
177 = "foo"
176 = "foo",
177 = "bar"
178178 = ]
179179 = ]
180180
205205 = "main"
206206 = ],
207207 = [
208 = "foo"
209 = ],
210 = [
208211 = "bar"
209 = ],
210 = [
211 = "foo"
212212 = ]
213213 = ]
214214
270270 = "main"
271271 = ],
272272 = [
273 = "foo"
274 = ],
275 = [
273276 = "bar"
274 = ],
275 = [
276 = "foo"
277277 = ]
278278 = ]
279279
415415 | {
416416 | }
417417 = $080D RTS
418 = $080E LDA #$FF
419 = $0810 RTS
420 = $0811 LDA #$00
421 = $0813 BNE $081D
422 = $0815 LDA #$01
423 = $0817 JMP $080E
424 = $081A JMP $0822
425 = $081D LDA #$02
426 = $081F JMP $080D
418 = $080E LDA #$00
419 = $0810 BNE $081A
420 = $0812 LDA #$01
421 = $0814 JMP $081F
422 = $0817 JMP $081F
423 = $081A LDA #$02
424 = $081C JMP $080D
425 = $081F LDA #$FF
426 = $0821 RTS