Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Json strings not fully supported #2

Open
rbarreiro opened this issue Jun 10, 2015 · 1 comment
Open

Json strings not fully supported #2

rbarreiro opened this issue Jun 10, 2015 · 1 comment

Comments

@rbarreiro
Copy link

idris-config does not allow non empty strings. Also it does not allow special chars like \n or ". I don't fully understand other usages of literallyBetween besides the one in JSON.idr. I think that either the definition of jsonString or literallyBetween must change. The definition in https://github.com/ziman/lightyear/blob/master/examples/Json.idr works fine.

@jfdm
Copy link
Owner

jfdm commented Jun 11, 2015

None of the parser in this package are feature complete (it says as much in the projects README). More so I am fully aware of their limitations.

Special characters are not supported, as I choose not to support them at the time, my use cases don't require them. Also, I don't see why I should support empty strings, if the field has no value then why use it, best case if you need an 'empty' key value pair then have the value be none.

The parser literallyBetween takes literally anything that is between a named character pairing. It works precisely as it is intended to. When using the parser literallyBetween '"' it will consume everything between a pair of double quotes. Given that special characters are not supported this parser will complete at the first double quotes character.

I might replace the parsing of strings to use a more refined parser than literallyBetween, as you see in the JSON example from lightyear. However, I do not see the need to at this present moment in time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants