From b0d8d1e3233eb296025a771484b0b07f4abb91ee Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 10 Apr 2022 23:21:53 +0200 Subject: [PATCH] Use pretty names for shared static constructors --- src/cogito/meter.d | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/cogito/meter.d b/src/cogito/meter.d index cded943..7521622 100644 --- a/src/cogito/meter.d +++ b/src/cogito/meter.d @@ -79,16 +79,29 @@ struct Meter { auto stringName = this.scoreScope.identifier.toString(); - switch (stringName) + if (stringName.empty) { - case "": - return "(λ)"; - case "__ctor": - return "this"; - case "__dtor": - return "~this"; - default: - return stringName; + return "(λ)"; + } + else if (stringName == "__ctor") + { + return "this"; + } + else if (stringName == "__dtor") + { + return "~this"; + } + else if (stringName.startsWith("_sharedStaticCtor_")) + { + return "shared static this"; + } + else if (stringName.startsWith("_sharedStaticDtor_")) + { + return "shared static ~this"; + } + else + { + return stringName; } }