[docs minor]add some tips to intern.rst (#15967)
* [docs minor]add some tips yo intern.rst * minor
This commit is contained in:
commit
1978b91202
1 changed files with 10 additions and 2 deletions
|
|
@ -153,13 +153,21 @@ are also lots of procs that aid in debugging:
|
||||||
debug(symbol)
|
debug(symbol)
|
||||||
# pretty prints the Nim ast, but annotates symbol IDs:
|
# pretty prints the Nim ast, but annotates symbol IDs:
|
||||||
echo renderTree(someNode, {renderIds})
|
echo renderTree(someNode, {renderIds})
|
||||||
if n.info ?? "temp.nim":
|
if `??`(conf, n.info, "temp.nim"):
|
||||||
# only output when it comes from "temp.nim"
|
# only output when it comes from "temp.nim"
|
||||||
echo renderTree(n)
|
echo renderTree(n)
|
||||||
if n.info ?? "temp.nim":
|
if `??`(conf, n.info, "temp.nim"):
|
||||||
# why does it process temp.nim here?
|
# why does it process temp.nim here?
|
||||||
writeStackTrace()
|
writeStackTrace()
|
||||||
|
|
||||||
|
These procs may not be imported by a module. You can import them directly for debugging:
|
||||||
|
|
||||||
|
.. 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``::
|
To create a new compiler for each run, use ``koch temp``::
|
||||||
|
|
||||||
./koch temp c /tmp/test.nim
|
./koch temp c /tmp/test.nim
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue