Skip to content

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