Available on crate feature
unstable-doc only.Expand description
§Chapter 8: Debugging
When things inevitably go wrong, you can introspect the parsing state by running your test case
with --features winnow/debug.
For example, the trace output of an escaped string parser:
You can extend your own parsers to show up by wrapping their body with
trace. Going back to do_nothing_parser.
use winnow::combinator::trace;
pub fn do_nothing_parser<'s>(input: &mut &'s str) -> ModalResult<&'s str> {
trace(
"do_nothing_parser",
|i: &mut _| Ok("")
).parse_next(input)
}