added a simple debugging helper
This commit is contained in:
parent
3255b55266
commit
790f5bac01
1 changed files with 9 additions and 0 deletions
|
|
@ -31,6 +31,15 @@ when declared(echo):
|
||||||
proc debug*(n: PType; conf: ConfigRef = nil) {.exportc: "debugType", deprecated.}
|
proc debug*(n: PType; conf: ConfigRef = nil) {.exportc: "debugType", deprecated.}
|
||||||
proc debug*(n: PNode; conf: ConfigRef = nil) {.exportc: "debugNode", 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.} =
|
template debug*(x: PSym|PType|PNode) {.deprecated.} =
|
||||||
when compiles(c.config):
|
when compiles(c.config):
|
||||||
debug(c.config, x)
|
debug(c.config, x)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue