sonic-cpp
sonic-cpp copied to clipboard
Proposal: Support parsing JSON number as RawNumber type
In order to parse JSON numbers with full precision and improve parsing performance, we propose adding a new RawNumber type for representing parsed JSON number values.
The design of this feature includes the following steps:
- Add a new
kRawNumberenum to represent JSON number values, and add aRawNumberclass to distinguish it fromstringviewtype. - Provide support for construct, modifying, copying, and comparing
RawNumbervalues. Especially, validate the number in construct and set API, because the number is from the user and maybe invalid numbers - Use
IsRawNumberto check for the presence of aRawNumber, whileIsNumbercontinues to check for numeric types.
Implementation branch: #60 Status: To be reviewed.