-
|
I'm attempting to update a parser to Chumsky 0.11, where my token type is a I have something like this from before: fn letter<'a, I>() -> impl Parser<'a, I, u8, extra::Err<MyError>> + Clone
where
I: ValueInput<'a, Token = u16, Span = SimpleSpan>,
{
one_of(0x41..=0x5b).labelled("A-Zθ").map(|x| x - 0x41)
}Using 0.11, this no longer works because in order to implement That doesn't seem useful- is this a shortcoming of how the error interface was changed in 0.11, or am I missing something that would allow me to label these parsers with human-readable names while still operating on non-textual tokens? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hmm, arbitrary labels should still be supported: they just require your error type to implement For example, Line 730 in 7733a7f |
Beta Was this translation helpful? Give feedback.
Hm, yeah; I think the error messages were being misleading. Changing my impl of
LabelErrorto take a genericLrather than directly specifying&'static stras the label type seems to work better. I haven't worked through all of it yet, but that seems promising.