Closed nandanvasudevan closed 2 years ago
This is my mistake. First of all a fix to the regex is needed. The way you fixed it in to_js_number is way too complicated. I would do it like this:
exp_minus = *it == '-';
if (*it == '-' || *it == '+') ++it;
I agree. Please go ahead!
Tested, just in case... Works as expected! https://godbolt.org/z/YnYhK7jMo
Fixed
I just saw that the
to_js_number()
does not work when the exponent does not have a sign (like 1.0e8). A quick look into the JSON schema tells me that it is allowed.Was this missed or is support for these not required?
Here is a simple fix anyway. I am happy to provide a pull request if this is necessary. Just confused right now.
https://godbolt.org/z/7bo3d41K6