Skip to content
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

Add an :s one-or-more whitespace matcher #110

Merged
merged 3 commits into from
Jul 2, 2019

Conversation

nblumhardt
Copy link
Member

This has been omitted so far because either or {:*} is suitable for this in almost all cases. Looking for and thinking in terms of {:s} is natural, however, and there doesn't seem to be any harm in including it.

README updated with current matchers.


[Matcher("s")]
public static TextParser<object> WhiteSpace { get; } =
Span.WithAll(ch => ch == ' ' || ch == '\t')
Copy link
Member

Choose a reason for hiding this comment

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

Would you expect this to match carriage returns and linefeeds too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Many of the other patterns are linefeed-aware, so slurping them up can have unexpected consequences.

@nblumhardt nblumhardt merged commit 2a4ce92 into datalust:dev Jul 2, 2019
@KodrAus KodrAus mentioned this pull request Aug 26, 2019
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.

2 participants