aboutsummaryrefslogtreecommitdiff
path: root/lua_cjson.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add build and package supportMark Pulford2011-05-011-0/+4
| | | | | - Add Makefile and RPM spec file - Add cjson.version variable
* Update lua_cjson.c with minor fixesMark Pulford2011-05-011-6/+3
| | | | | - Fix typo and comment - Change "while" to "for" loop
* Support optionally parsing Inf/NaN/Hex numbersMark Pulford2011-05-011-31/+73
| | | | | Change strict_numbers to control whether json.decode will parse an expanded set of numbers (Hex, Inf, NaN).
* Add MIT license and update lua_cjson.c caveatsMark Pulford2011-05-011-18/+34
|
* Detect and throw error when parsing hexadecimalMark Pulford2011-05-011-10/+20
|
* Simplify generating parse error tokensMark Pulford2011-05-011-28/+29
|
* 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.