summary refs log tree commit diff stats
path: root/compiler/astalgo.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/astalgo.nim')
-rw-r--r--compiler/astalgo.nim42
1 files changed, 23 insertions, 19 deletions
diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim
index a4a14405e..290ac05ee 100644
--- a/compiler/astalgo.nim
+++ b/compiler/astalgo.nim
@@ -34,32 +34,36 @@ when declared(echo):
   template debug*(x: PSym|PType|PNode) {.deprecated.} =
     when compiles(c.config):
       debug(c.config, x)
+    elif compiles(c.graph.config):
+      debug(c.graph.config, x)
     else:
       error()
 
   template debug*(x: auto) {.deprecated.} =
     echo x
 
-template mdbg*: bool {.dirty.} =
-  when compiles(c.module):
-    c.module.fileIdx == c.config.projectMainIdx
-  elif compiles(c.c.module):
-    c.c.module.fileIdx == c.c.config.projectMainIdx
-  elif compiles(m.c.module):
-    m.c.module.fileIdx == m.c.config.projectMainIdx
-  elif compiles(cl.c.module):
-    cl.c.module.fileIdx == cl.c.config.projectMainIdx
-  elif compiles(p):
-    when compiles(p.lex):
-      p.lex.fileIdx == p.lex.config.projectMainIdx
+  template mdbg*: bool {.deprecated.} =
+    when compiles(c.graph):
+      c.module.fileIdx == c.graph.config.projectMainIdx
+    elif compiles(c.module):
+      c.module.fileIdx == c.config.projectMainIdx
+    elif compiles(c.c.module):
+      c.c.module.fileIdx == c.c.config.projectMainIdx
+    elif compiles(m.c.module):
+      m.c.module.fileIdx == m.c.config.projectMainIdx
+    elif compiles(cl.c.module):
+      cl.c.module.fileIdx == cl.c.config.projectMainIdx
+    elif compiles(p):
+      when compiles(p.lex):
+        p.lex.fileIdx == p.lex.config.projectMainIdx
+      else:
+        p.module.module.fileIdx == p.config.projectMainIdx
+    elif compiles(m.module.fileIdx):
+      m.module.fileIdx == m.config.projectMainIdx
+    elif compiles(L.fileIdx):
+      L.fileIdx == L.config.projectMainIdx
     else:
-      p.module.module.fileIdx == p.config.projectMainIdx
-  elif compiles(m.module.fileIdx):
-    m.module.fileIdx == m.config.projectMainIdx
-  elif compiles(L.fileIdx):
-    L.fileIdx == L.config.projectMainIdx
-  else:
-    error()
+      error()
 
 # --------------------------- ident tables ----------------------------------
 proc idTableGet*(t: TIdTable, key: PIdObj): RootRef