-
-
Notifications
You must be signed in to change notification settings - Fork 54
Remove ISeekable from Else/ElseError #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,28 +8,15 @@ | |
|
|
||
| namespace Parlot.Fluent; | ||
|
|
||
| public sealed class ElseError<T> : Parser<T>, ICompilable, ISeekable | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a breaking change
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a marker class, doesn't matter.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While it's a public API it's a breaking-change :) |
||
| public sealed class ElseError<T> : Parser<T>, ICompilable | ||
| { | ||
| private readonly Parser<T> _parser; | ||
| private readonly string _message; | ||
|
|
||
| public bool CanSeek { get; } | ||
|
|
||
| public char[] ExpectedChars { get; } = []; | ||
|
|
||
| public bool SkipWhitespace { get; } | ||
|
|
||
| public ElseError(Parser<T> parser, string message) | ||
| { | ||
| _parser = parser ?? throw new ArgumentNullException(nameof(parser)); | ||
| _message = message; | ||
|
|
||
| if (_parser is ISeekable seekable) | ||
| { | ||
| CanSeek = seekable.CanSeek; | ||
| ExpectedChars = seekable.ExpectedChars; | ||
| SkipWhitespace = seekable.SkipWhitespace; | ||
| } | ||
| } | ||
|
|
||
| public override bool Parse(ParseContext context, ref ParseResult<T> result) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change