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)
|
let prettyErrors = errors.map((x: ParserResult) => x.error().expected)
|
||||||
err(ParserError(
|
err(ParserError(
|
||||||
kind: choiceMismatchErr,
|
kind: choiceMismatchErr,
|
||||||
|
index: parser.state.position + 1,
|
||||||
expected: &"Choice ({prettyErrors})",
|
expected: &"Choice ({prettyErrors})",
|
||||||
unexpected: errors[0].error().unexpected,
|
unexpected: errors[0].error().unexpected,
|
||||||
parser: parser,
|
parser: parser,
|
||||||
|
|||||||
Reference in New Issue
Block a user