Add index for choice

This commit is contained in:
Florian Schroedl
2022-01-20 17:00:00 +01:00
parent afcb55b21f
commit 9d85ba8ae4

View File

@@ -307,6 +307,7 @@ func choice*(parsers: seq[Parser -> ParserResult]): (Parser -> ParserResult) {.i
let prettyErrors = errors.map((x: ParserResult) => x.error().expected)
err(ParserError(
kind: choiceMismatchErr,
index: parser.state.position + 1,
expected: &"Choice ({prettyErrors})",
unexpected: errors[0].error().unexpected,
parser: parser,