Description
Currently, the parser parses numbers immediately in tokenization step then stringifies them again when it turns out to be part of an unquoted string. This should probably be changed to store a string and parse only when it really is a number, in parsing step.
Reproduction Steps
- Call the decoder with:
Case 1:
Case 2:
- Observe the output.
Expected Behavior
Case 1: Parsed to { "a": "1.0 b" } (JSON for convenience)
Case 2: Parsed to { "a": "1e1 b" } (JSON for convenience)
Actual Behavior
Case 1: Parsed to { "a": "1 b" } (JSON for convenience)
Case 2: Parsed to { "a": "10 b" } (JSON for convenience)
Environment
- Package version: 0.4.4
- Runtime: Rust 1.96.0 (nightly)
- OS: Windows 11
Additional Context
No response
Description
Currently, the parser parses numbers immediately in tokenization step then stringifies them again when it turns out to be part of an unquoted string. This should probably be changed to store a string and parse only when it really is a number, in parsing step.
Reproduction Steps
Case 1:
Expected Behavior
Case 1: Parsed to
{ "a": "1.0 b" }(JSON for convenience)Case 2: Parsed to
{ "a": "1e1 b" }(JSON for convenience)Actual Behavior
Case 1: Parsed to
{ "a": "1 b" }(JSON for convenience)Case 2: Parsed to
{ "a": "10 b" }(JSON for convenience)Environment
Additional Context
No response