Add index for choice
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user