Skip to content

Conversation

@zesterer
Copy link
Owner

image

@zesterer zesterer force-pushed the better-delimiter-errors branch from a9eb1d5 to d84d7e7 Compare November 19, 2025 17:55
@zesterer
Copy link
Owner Author

I'd be interested in your thoughts on this @Hedgehogo

/// The span `start` is the span of the starting delimiter.
///
/// `scope` is the span from (and including) the starting delimiter, up to the location of the error.
fn in_delimited(&mut self, start: I::Span, scope: I::Span) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we introducing this method? It imposes an additional obligation on current errors. It provides backward compatibility (albeit not significantly).

At the same time, we could instead create a label (DelimitersExpected) whose position would be the entire parser and which would contain the position of the opening separator as a field.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense, I'll have a go at that if I get a moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants