mirror of
https://github.com/python/cpython.git
synced 2025-11-19 10:46:17 +00:00
GH-111485: Sort cases in the case generator output (GH-112315)
This commit is contained in:
parent
fef6fb8762
commit
1619f4350e
3 changed files with 4580 additions and 4576 deletions
|
|
@ -769,6 +769,7 @@ class Generator(Analyzer):
|
|||
|
||||
# Write and count instructions of all kinds
|
||||
n_macros = 0
|
||||
cases = []
|
||||
for thing in self.everything:
|
||||
match thing:
|
||||
case parsing.InstDef():
|
||||
|
|
@ -776,11 +777,14 @@ class Generator(Analyzer):
|
|||
case parsing.Macro():
|
||||
n_macros += 1
|
||||
mac = self.macro_instrs[thing.name]
|
||||
stacking.write_macro_instr(mac, self.out)
|
||||
cases.append((mac.name, mac))
|
||||
case parsing.Pseudo():
|
||||
pass
|
||||
case _:
|
||||
assert_never(thing)
|
||||
cases.sort()
|
||||
for _, mac in cases:
|
||||
stacking.write_macro_instr(mac, self.out)
|
||||
|
||||
self.out.write_raw("\n")
|
||||
self.out.write_raw("#undef TIER_ONE\n")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue