Fix negative index for start of parser
This commit is contained in:
@@ -75,7 +75,7 @@ proc `$`*(x: ParserError): string =
|
|||||||
of charMismatchErr(expected: @expected, parser: @parser, index: @index, unexpected: @unexpected):
|
of charMismatchErr(expected: @expected, parser: @parser, index: @index, unexpected: @unexpected):
|
||||||
# TODO: Only works for single line right now
|
# TODO: Only works for single line right now
|
||||||
let original = parser.state.stream
|
let original = parser.state.stream
|
||||||
let errSpace = " ".repeat(index - 1)
|
let errSpace = " ".repeat(max(0, index))
|
||||||
|
|
||||||
&"""Parsing Error (Character Mismatch Error):
|
&"""Parsing Error (Character Mismatch Error):
|
||||||
{original}
|
{original}
|
||||||
|
|||||||
Reference in New Issue
Block a user