mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 22:33:49 +00:00
new debugging helper to replace and friends
This commit is contained in:
@@ -67,6 +67,23 @@ proc debug*(n: PSym) {.deprecated.}
|
||||
proc debug*(n: PType) {.deprecated.}
|
||||
proc debug*(n: PNode) {.deprecated.}
|
||||
|
||||
template mdbg*: bool {.dirty.} =
|
||||
when compiles(c.module):
|
||||
c.module.fileIdx == gProjectMainIdx
|
||||
elif compiles(m.c.module):
|
||||
m.c.module.fileIdx == gProjectMainIdx
|
||||
elif compiles(cl.c.module):
|
||||
cl.c.module.fileIdx == gProjectMainIdx
|
||||
elif compiles(p):
|
||||
when compiles(p.lex):
|
||||
p.lex.fileIdx == gProjectMainIdx
|
||||
else:
|
||||
p.module.module.fileIdx == gProjectMainIdx
|
||||
elif compiles(L.fileIdx):
|
||||
L.fileIdx == gProjectMainIdx
|
||||
else:
|
||||
false
|
||||
|
||||
# --------------------------- ident tables ----------------------------------
|
||||
proc idTableGet*(t: TIdTable, key: PIdObj): RootRef
|
||||
proc idTableGet*(t: TIdTable, key: int): RootRef
|
||||
|
||||
@@ -420,11 +420,6 @@ proc binaryStrSearch*(x: openArray[string], y: string): int =
|
||||
return mid
|
||||
result = - 1
|
||||
|
||||
template nimdbg*: untyped = c.module.fileIdx == gProjectMainIdx
|
||||
template cnimdbg*: untyped = p.module.module.fileIdx == gProjectMainIdx
|
||||
template pnimdbg*: untyped = p.lex.fileIdx == gProjectMainIdx
|
||||
template lnimdbg*: untyped = L.fileIdx == gProjectMainIdx
|
||||
|
||||
proc parseIdeCmd*(s: string): IdeCmd =
|
||||
case s:
|
||||
of "sug": ideSug
|
||||
|
||||
Reference in New Issue
Block a user