Closed mayawarrier closed 1 year ago
Looks like a good idea. I will review and I expect to merge.
@mayawarrier I think that the JSON format does not allow a leading +
... only in the exponent, so 1e+1
is ok, but +1e1
is not.
@mayawarrier I think that the JSON format does not allow a leading
+
... only in the exponent, so1e+1
is ok, but+1e1
is not.
Got it, I'll just ignore the FASTFLOAT_ALLOWS_LEADING_PLUS macro when the runtime format is json.
I disallowed leading pluses as requested. I also added an option to allow inf/nan in JSON mode. This is a common option in JSON parsers despite not being part of the standard.
I am sure that this could be perfected, but it looks solid to me, merging.
Details on the format are available here (RFC 8259): https://datatracker.ietf.org/doc/html/rfc8259#section-6 This is compatible with previous JSON RFCs as well as the number format hasn't changed.