Improve JSON parser demo
There are a couple issues in the JSON parser demo (recently discussed in this pointfree Slack thread):
- Parsing characters built up of more than one utf-8 code point, such as
再, fails. - The literal unicode code point format is faulty, lacking a literal
ucharacter before the numbers.
This PR fixes those issues, as well as extends the JSON parser to fully conform to the json standard. This means adding support for handling UTF-16 surrogate pairs, and exactly match the JSON specification's number format, instead of relying on Double.parser() which isn't exactly the same.
@stephencelis how do you feel about getting this merged?
@oskarek Sorry for losing track of this! I think we're down for the correctness fixes, but let's resist distinguishing Int from Double. That feels like a more opinionated change that you can feel free to do in your own version, but for the sake of the demo let's keep things as neutral to the spec as possible.
@stephencelis I have updated the PR now, and removed the Int/Double separation
@oskarek Thanks! Just one more thing came to mind.