From 99b587813db83f85de718ed6b6b74f82c474e698 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Sat, 18 Jun 2022 12:21:09 +0200 Subject: [PATCH] Remove debug echos --- src/parser/parser_types.nim | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/parser/parser_types.nim b/src/parser/parser_types.nim index 540faeb..78392b2 100644 --- a/src/parser/parser_types.nim +++ b/src/parser/parser_types.nim @@ -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 =