Remove debug echos

This commit is contained in:
Florian Schroedl
2022-06-18 12:21:09 +02:00
parent 788c2b4d2d
commit 99b587813d

View File

@@ -368,26 +368,18 @@ func highlightStreamPosition2(stream: string, position: int): string =
else:
(position, position)
debugEcho "char: " & $ch
debugEcho "position: " & $position
let startIndex = stream.rfind("\n", 0, lineStartPosition)
let lineStartIndex =
case startIndex:
of -1: 0
else: startIndex + 1
debugEcho "startIndex: " & $lineStartIndex
let endIndex = stream.find("\n", lineEndPosition)
let lineEndIndex =
case endIndex:
of -1: stream.len
else: endIndex
debugEcho "endIndex: " & $lineEndIndex
let spaceChars = " ".repeat((position - lineStartIndex).max(0))
let lineChars = "_".repeat((lineEndIndex - position).max(0) + 10)
@@ -403,8 +395,6 @@ func highlightStreamPosition2(stream: string, position: int): string =
of '\n': (lineEndIndex - 1).max(1)
else: lineEndIndex
debugEcho "insertMessageAtIndex: " & $insertMessageAtIndex
let beforeNewline =
case (startIndex, ch):
# Always print newline for newline at the stream begin
@@ -413,6 +403,12 @@ func highlightStreamPosition2(stream: string, position: int): string =
of (_, '\n'): ""
else: "\n"
# debugEcho "char: " & $ch
# debugEcho "position: " & $position
# debugEcho "startIndex: " & $lineStartIndex
# debugEcho "endIndex: " & $lineEndIndex
# debugEcho "insertMessageAtIndex: " & $insertMessageAtIndex
stream.dup(insert(&"{beforeNewline}{spaceChars}^{lineChars} Char at \"{escapedChar}\"\n", insertMessageAtIndex))
proc `$`*(x: ParserState): string =