[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: [ANN] dkjson 2.2
- From: David Heiko Kolf <kolf@...>
- Date: Tue, 01 May 2012 09:08:47 +0200
dkjson is a module for encoding and decoding JSON data. It supports UTF-8.
dkjson is written in Lua without any dependencies, but
when LPeg is available dkjson uses it to speed up decoding.
Changes since version 2.1:
* __jsontype is only used for empty tables.
* It is possible to decode tables without assigning metatables.
* Locations for error messages were off by one in the first line.
* There is no LPeg version of json.quotestring anymore.
The main change since the last version is the treatment of the
__jsontype value in the metatable. In previous versions (2.0 and 2.1)
this replaced the usual test for an array and selected the type of the
However, I received reports that this caused confusion and undesired
behaviour when for example an empty table got encoded as an array,
decoded with the default metatables, extended with string keys and
encoded again. As the table was forced by the metatable to be encoded as
an array, the new keys were lost.
Now __jsontype is only used for empty tables to decide whether they are
arrays or objects.