From 5af798c21b5d32bb6c2b9cff21e8288dc829a41a Mon Sep 17 00:00:00 2001 From: flywind Date: Sat, 14 Nov 2020 18:47:17 +0800 Subject: [PATCH 1/2] [docs minor]add some tips yo intern.rst --- doc/intern.rst | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/intern.rst b/doc/intern.rst index 89d477d099..ea9e1a07c7 100644 --- a/doc/intern.rst +++ b/doc/intern.rst @@ -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 From bfa387d384762cf0b46431407669ec1889b8c4a3 Mon Sep 17 00:00:00 2001 From: flywind Date: Sat, 14 Nov 2020 18:51:05 +0800 Subject: [PATCH 2/2] minor --- doc/intern.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/intern.rst b/doc/intern.rst index ea9e1a07c7..3f8a2ce565 100644 --- a/doc/intern.rst +++ b/doc/intern.rst @@ -160,7 +160,7 @@ are also lots of procs that aid in debugging: # why does it process temp.nim here? writeStackTrace() -These procs may not be imported by module, you can import them for debuging: +These procs may not be imported by a module. You can import them directly for debugging: .. code-block:: nim from astalgo import debug