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

Adds between' combinator which acts like between but doesn't consume … #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timmytofu
Copy link
Contributor

Currently:

> parseOnly stringValue "\"   hi\""
Right (StringValue "hi")

With between' (not the best name, maybe):

> parseOnly stringValue "\"   hi\""
Right (StringValue "   hi")

it properly captures the leading whitespace in string. It still eats whitespace after the closing quote, though, to follow the token system.

…whitespace after the opening token. Updates quotes combinator to use this to avoid losing leading whitespace in string literals
@jdnavarro
Copy link
Owner

String literals need to be actually taken care of, right now the stringValue combinator parser is just a stub. If you are feeling adventurous you can try to include a proper parser with this PR (or a new one if you prefer). Here are some source you can look up for hints:

It's not my intention to provide parsing combinators with this package. The current parsing combinators are meant to be used internally only, but I still have to make them private.

@timmytofu
Copy link
Contributor Author

I saw the TODO about escapes, I will see if I have time to work on it.

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