sonic-cpp icon indicating copy to clipboard operation
sonic-cpp copied to clipboard

Proposal: Support parsing JSON number as RawNumber type

Open liuq19 opened this issue 2 years ago • 0 comments

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:

  1. Add a new kRawNumber enum to represent JSON number values, and add a RawNumberclass to distinguish it from stringview type.
  2. Provide support for construct, modifying, copying, and comparing RawNumber values. Especially, validate the number in construct and set API, because the number is from the user and maybe invalid numbers
  3. Use IsRawNumber to check for the presence of a RawNumber, while IsNumber continues to check for numeric types.

Implementation branch: #60 Status: To be reviewed.

liuq19 avatar Apr 18 '23 11:04 liuq19