astalgo: use the code style that the other lines use; make debug() less verbose
This commit is contained in:
parent
045e026d0e
commit
0e157de3a0
1 changed files with 11 additions and 11 deletions
|
|
@ -424,19 +424,19 @@ proc value(this: var DebugPrinter; value: string) =
|
||||||
|
|
||||||
proc value(this: var DebugPrinter; value: BiggestInt) =
|
proc value(this: var DebugPrinter; value: BiggestInt) =
|
||||||
if this.useColor:
|
if this.useColor:
|
||||||
this.res.add numberStyle
|
this.res.add numberStyle
|
||||||
this.res.add value
|
this.res.add value
|
||||||
if this.useColor:
|
if this.useColor:
|
||||||
this.res.add resetStyle
|
this.res.add resetStyle
|
||||||
|
|
||||||
proc value[T: enum](this: var DebugPrinter; value: T) =
|
proc value[T: enum](this: var DebugPrinter; value: T) =
|
||||||
if this.useColor:
|
if this.useColor:
|
||||||
this.res.add enumStyle
|
this.res.add enumStyle
|
||||||
this.res.add "\""
|
this.res.add "\""
|
||||||
this.res.add $value
|
this.res.add $value
|
||||||
this.res.add "\""
|
this.res.add "\""
|
||||||
if this.useColor:
|
if this.useColor:
|
||||||
this.res.add resetStyle
|
this.res.add resetStyle
|
||||||
|
|
||||||
proc value[T: enum](this: var DebugPrinter; value: set[T]) =
|
proc value[T: enum](this: var DebugPrinter; value: set[T]) =
|
||||||
this.openBracket
|
this.openBracket
|
||||||
|
|
@ -463,12 +463,12 @@ template earlyExit(this: var DebugPrinter; n: PType | PNode | PSym) =
|
||||||
this.res.add(this.currentLine - index)
|
this.res.add(this.currentLine - index)
|
||||||
this.res.add " lines upwards>"
|
this.res.add " lines upwards>"
|
||||||
if this.useColor:
|
if this.useColor:
|
||||||
this.res.add resetStyle
|
this.res.add resetStyle
|
||||||
return
|
return
|
||||||
|
|
||||||
proc value(this: var DebugPrinter; value: PType): void
|
proc value(this: var DebugPrinter; value: PType)
|
||||||
proc value(this: var DebugPrinter; value: PNode): void
|
proc value(this: var DebugPrinter; value: PNode)
|
||||||
proc value(this: var DebugPrinter; value: PSym): void =
|
proc value(this: var DebugPrinter; value: PSym) =
|
||||||
earlyExit(this, value)
|
earlyExit(this, value)
|
||||||
|
|
||||||
this.openCurly
|
this.openCurly
|
||||||
|
|
@ -492,7 +492,7 @@ proc value(this: var DebugPrinter; value: PSym): void =
|
||||||
|
|
||||||
this.closeCurly
|
this.closeCurly
|
||||||
|
|
||||||
proc value(this: var DebugPrinter; value: PType): void =
|
proc value(this: var DebugPrinter; value: PType) =
|
||||||
earlyExit(this, value)
|
earlyExit(this, value)
|
||||||
|
|
||||||
this.openCurly
|
this.openCurly
|
||||||
|
|
@ -530,7 +530,7 @@ proc value(this: var DebugPrinter; value: PType): void =
|
||||||
|
|
||||||
this.closeCurly
|
this.closeCurly
|
||||||
|
|
||||||
proc value(this: var DebugPrinter; value: PNode): void =
|
proc value(this: var DebugPrinter; value: PNode) =
|
||||||
earlyExit(this, value)
|
earlyExit(this, value)
|
||||||
|
|
||||||
this.openCurly
|
this.openCurly
|
||||||
|
|
@ -599,7 +599,7 @@ when declared(echo):
|
||||||
proc debug(n: PNode; conf: ConfigRef) =
|
proc debug(n: PNode; conf: ConfigRef) =
|
||||||
var this: DebugPrinter
|
var this: DebugPrinter
|
||||||
this.visited = initTable[pointer, int]()
|
this.visited = initTable[pointer, int]()
|
||||||
this.renderSymType = true
|
#this.renderSymType = true
|
||||||
this.useColor = not defined(windows)
|
this.useColor = not defined(windows)
|
||||||
this.value(n)
|
this.value(n)
|
||||||
echo($this.res)
|
echo($this.res)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue