Better module printing

This commit is contained in:
Reid 'arrdem' McKenzie 2022-06-15 09:46:03 -06:00
parent 7f3efc882a
commit d567f95c1f

View file

@ -203,9 +203,19 @@ class Module(t.NamedTuple):
def __str__(self):
b = []
b.append("functions:")
for sig, fun in self.functions.items():
b.append(f" {sig!r}:")
b.append(f" name: {fun.name}")
b.append(f" typeconstraints: {fun.typeconstraints}")
b.append(f" arguments: {fun.arguments}")
b.append(f" returns: {fun.returns}")
b.append(f" ip: {self.labels[fun.signature]}")
b.append("codepage:")
marks = {v: k for k, v in self.labels.items()}
for i, o in zip(range(1<<64), self.codepage):
if(i in marks):
b.append(f"{marks[i]}:")
b.append(f"{i: >10}: {o}")
b.append(f" {marks[i]!r}:")
b.append(f" {i: >10}: {o}")
return "\n".join(b)