[docs minor]add some tips yo intern.rst

(cherry picked from commit 5af798c21b)
This commit is contained in:
flywind
2020-11-14 18:47:17 +08:00
committed by narimiran
parent b47a98f7f2
commit 452203a28e

View File

@@ -153,13 +153,21 @@ are also lots of procs that aid in debugging:
debug(symbol)
# pretty prints the Nim ast, but annotates symbol IDs:
echo renderTree(someNode, {renderIds})
if n.info ?? "temp.nim":
if `??`(conf, n.info, "temp.nim"):
# only output when it comes from "temp.nim"
echo renderTree(n)
if n.info ?? "temp.nim":
if `??`(conf, n.info, "temp.nim"):
# why does it process temp.nim here?
writeStackTrace()
These procs may not be imported by module, you can import them for debuging:
.. code-block:: nim
from astalgo import debug
from types import typeToString
from renderer import renderTree
from msgs import `??`
To create a new compiler for each run, use ``koch temp``::
./koch temp c /tmp/test.nim