parseJSON5NumericLiteral

fnbool parseJSON5NumericLiteral(out var value, const(char)[] text, const Json5Policy policy = Json5Policy.init) @safe

Parse a JSON5 numeric literal from text into out value.

Supported forms (case-sensitive where applicable):

  • Decimal integers with optional leading sign, e.g., 42, -7, +10.
  • Hex integers: 0x1f, -0XFF (sign allowed), mapped to LONG/ULONG if fitting, otherwise DOUBLE.
  • Decimal floats with optional sign and exponent: .5, 5., 1e-3, +2.5e+8.
  • Special values: NaN, Infinity, with optional leading sign (e.g., -Infinity, +NaN).
  • Negative zero is preserved when the input is a floating-point form like -0, -0.0, -0e0.

Returns

true on successful parse. On failure, returns false and sets value = var.init.