json: relax float parsing some more

We already support more float variants than standard JSON in the relaxed
format, adding extra restrictions does not actually help much. If you
need to know if this is a value JSON number, there is now a function to
check that instead.
This commit is contained in:
Wim Taymans 2026-03-09 16:48:05 +01:00
parent 231a41a22f
commit ddf63e0863
2 changed files with 11 additions and 15 deletions

View file

@ -717,11 +717,11 @@ PWTEST(json_float_check)
{ "0,0", 0, 0 },
{ "0.0.5", 0, 0 },
{ "0x0", 0, 0 },
{ "0x0.0", 0, 0 },
{ "0x0", 1, 0 },
{ "0x0.0", 1, 0 },
{ "E10", 0, 0 },
{ "e20", 0, 0 },
{ " 0.0", 0, 0 },
{ " 0.0", 1, 0 },
{ "0.0 ", 0, 0 },
{ " 0.0 ", 0, 0 },
@ -1002,6 +1002,12 @@ PWTEST(json_data)
"n_number_-2..json",
"n_number_hex_1_digit.json",
"n_number_hex_2_digits.json",
"n_number_infinity.json",
"n_number_+Inf.json",
"n_number_Inf.json",
"n_number_minus_infinity.json",
"n_number_-NaN.json",
"n_number_NaN.json",
"n_number_neg_int_starting_with_zero.json",
"n_number_neg_real_without_int_part.json",
"n_number_real_without_fractional_part.json",