diff --git a/src/test.nim b/src/test.nim index caeb064..dae6e81 100644 --- a/src/test.nim +++ b/src/test.nim @@ -75,7 +75,7 @@ proc `$`*(x: ParserError): string = of charMismatchErr(expected: @expected, parser: @parser, index: @index, unexpected: @unexpected): # TODO: Only works for single line right now let original = parser.state.stream - let errSpace = " ".repeat(index - 1) + let errSpace = " ".repeat(max(0, index)) &"""Parsing Error (Character Mismatch Error): {original}