Hello everyone, I would need to debug the NimNodes returned from
getImpl
calls, and I was looking for a function that would print out a NimNode tree structure given a NimNode, not a block of nim code. I looked at
dumpTree
, but it is not working for NimNodes inside the macro. Is there such a function?
On a similar topic,shouldn't
echo
support the printing of NimNodes?
try
echo treeRepr nimNode
dumpTree takes an untyped value as it's first argument and then converts it into a NimNode before calling echo treeRepr on it
Your untyped data has already been converted into a NimNode by passing it into a macro so you need to skip the conversion step.
It's the same reason calling macros while already inside a macro is tricky.