From 0564031502ec380b62d7bb8f9f79a2c0dd786c03 Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Wed, 15 Jun 2022 09:46:03 -0600 Subject: [PATCH] Better module printing --- projects/shoggoth/src/python/ichor/state.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/projects/shoggoth/src/python/ichor/state.py b/projects/shoggoth/src/python/ichor/state.py index f2b15e5..5b50218 100644 --- a/projects/shoggoth/src/python/ichor/state.py +++ b/projects/shoggoth/src/python/ichor/state.py @@ -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)