-
I am using version I am writing a small parser where I optionally want to consume a new line (or an inline comment). For this I am using the fn comment<'a, I>() -> impl Parser<'a, I, (), Extra<'a, char>>
where
I: Input<'a, Token = char, Span = SimpleSpan> + StrInput<'a, char>,
{
just('#')
.then(any().and_is(text::newline().not()).repeated())
.ignored()
.labelled("comment")
}
fn comment_or_eol<'a, I>() -> impl Parser<'a, I, (), Extra<'a, char>>
where
I: Input<'a, Token = char, Span = SimpleSpan> + StrInput<'a, char>,
{
comment()
.or(text::newline())
.labelled("comment or end-of-line")
} The parser works as expected, but the labeling does not, and I don't know how to express this differently 😢
When parsing
Here, I would expect it to say |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Do you get this same issue if you point your project at the latest |
Beta Was this translation helpful? Give feedback.
Do you get this same issue if you point your project at the latest
main
?