Skip to content

1.3.0

Latest

Choose a tag to compare

@BitoLabs BitoLabs released this 19 Dec 22:43

New features

  • The Json::parse() and parse_in_place() methods now have
    an additional options parameter, which can turn ON/OFF
    additional syntax that is not present in JSON standard.

  • New optHex parsing option (OFF by default). It allows integers
    in hex format (like: 0x1A, 0X2b).

  • New optIdentifiers parsing option (OFF by default). It allows
    object member names as C identifiers without quotes: {foo: "bar"}.

  • Added parsing options that are ON by default.
    Previous version supported these features, but these could not
    be turned off. Note that JSON standard doesn't allow these:

    • optUniqueMembers: disallow duplicate member names within the
      object. Apparently standard JSON allows (but not recommends)
      duplicates, see https://datatracker.ietf.org/doc/html/rfc8259#section-4
    • optTrailingComma: allow one trailing comma in arrays and objects,
      like [1,2,].
    • optEmptyFraction: Allow floating point numbers with no digits after
      decimal point (like 1. or 2.e3).
    • optLineCommentC: allow // comments.

Changes

  • Raise ErrSyntax if a null character is found before the text ends,
    when the length of input is passed explicitly to parse() method.

Fixes