aboutsummaryrefslogtreecommitdiff
path: root/lua_cjson.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Throw error on Inf/NaN by default when encodingMark Pulford2011-05-011-16/+49
| | | | | Add runtime configuration for generating Inf/NaN encoding errors through cjson.strict_numbers().
* Improve encoding exception error formatMark Pulford2011-05-011-6/+7
| | | | | Was: Cannot serialise <location>: <type> Now: Cannot serialise <type>: <reason>
* Add detailed parse error reportingMark Pulford2011-05-011-19/+45
| | | | | | | - Always report the correct index of the token error. - Use value.string to report what was found instead of just T_ERROR. - Fix inverted unicode escape error detection.
* Move static configuration into runtime userdataMark Pulford2011-05-011-137/+230
| | | | | | | Allow maximum nesting depth and sparse array ratio to be configured at runtime via the sparse_ratio() and max_depth() functions. Throw exceptions when encoding excessively nested structures.
* Encode very sparse arrays as objectsMark Pulford2011-05-011-1/+14
| | | | | | | Detect and encode very sparse arrays as objects. This prevents something like: { [1000000] = "nullfest" } ..from generating a huge array.
* Create "cjson" Lua module, support UCS-2 escapesMark Pulford2011-05-011-0/+780
- Convert lua_json_init() into luaopen_cjson() to support dynamic .so loading. - Rename "json" to "cjson" to reduce conflicts with other JSON modules. - Remove unnecessary *_pcall_* API. Lua calls are fast enough, even through C. - Encode empty tables as objects - Add support for decoding all UCS-2 escape codes.