Type: Stabilize attribute and alias output in statements.

Sort attributes and aliases in Type.statement().

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
This commit is contained in:
Chris PeBenito 2024-10-28 11:35:20 -04:00
parent 525cc9069f
commit a9e65732f2
No known key found for this signature in database
GPG Key ID: C6363EF1C9697B14
1 changed files with 3 additions and 3 deletions

View File

@ -107,11 +107,11 @@ cdef class Type(BaseType):
stmt = f"type {self.name}"
if count > 1:
stmt += f" alias {{ {' '.join(self._aliases)} }}"
stmt += f" alias {{ {' '.join(sorted(self._aliases))} }}"
elif count == 1:
stmt += f" alias {self._aliases[0]}"
for attr in self._attrs:
stmt += f", {attr}"
if self._attrs:
stmt += f", {', '.join(a.name for a in sorted(self._attrs))}"
stmt += ";"
return stmt