I'm writing a parser for cron expressions with nom. There are several crates that already do this but I want to make it tolerant for input errors. For example, with expression 5 4 *- * *
I want to record the error from parsing the days of the month and continue parsing the months and days of the week instead of failing completely.
I have a basic version of the parser working here but I can't figure out how to make the fault tolerant part work. Obviously in cron_expression()
when the first parsing error is encountered, it's propagated by the ?
operator and the complete parser fails but I don't see another way to get to the remaining input to pass it to the next parser.