From 790f5bac0103fed9e89ead35364387c50d526cf5 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 8 Sep 2019 11:03:08 +0200 Subject: [PATCH] added a simple debugging helper --- compiler/astalgo.nim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index 06611313cf..700092e67a 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -31,6 +31,15 @@ when declared(echo): proc debug*(n: PType; conf: ConfigRef = nil) {.exportc: "debugType", deprecated.} proc debug*(n: PNode; conf: ConfigRef = nil) {.exportc: "debugNode", deprecated.} + proc typekinds*(t: PType) {.deprecated.} = + var t = t + var s = "" + while t != nil and t.len > 0: + s.add $t.kind + s.add " " + t = t.lastSon + echo s + template debug*(x: PSym|PType|PNode) {.deprecated.} = when compiles(c.config): debug(c.config, x)