summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | Use Perl builtin UTF-8 support, not Text::IconvMark Pulford2011-05-161-7/+13
| | | | | | | | Remove Perl dependency on Text::Iconv to improve portability.
* | Move all benchmark code into bench.luaMark Pulford2011-05-162-39/+34
| | | | | | | | | | Move benchmark() into bench.lua since it not used elsewhere. Replace posix.gettimeofday() with socket.gettime() to improve portability.
* | Remove invalid newlines from JSON examplesMark Pulford2011-05-162-8/+4
| |
* | Add command line encode/decode utilitiesMark Pulford2011-05-162-0/+37
| |
* | Warn that a failed NaN test may not be an errorMark Pulford2011-05-162-3/+9
| | | | | | | | | | | | | | Sprintf returns "-nan" rather than "nan" on some platforms, which causes the test script to incorrectly flag a failure. Also allow test functions without "==> Config" output.
* | Add rockspec to build under LuaRocksMark Pulford2011-05-152-1/+31
| | | | | | | | | | | | Remove "-lm" from LDFLAGS in Makefile since it breaks the build under Windows and isn't required under Linux. Math lib fix suggested by: Steve Donovan <steve.j.donovan@gmail.com>
* | Remove trailing whitespace1.0.1Mark Pulford2011-05-106-20/+20
| |
* | Add stack overflow fix to NEWSMark Pulford2011-05-101-1/+2
| |
* | run_test_group(): Change helper functions to localMark Pulford2011-05-101-2/+2
| |
* | Add runtime option for persistent encode bufferMark Pulford2011-05-107-19/+75
| |
* | Suspend the garbage collector during benchmarksMark Pulford2011-05-101-1/+2
| | | | | | | | Suspending GC appears to make the benchmark results more consistent.
* | Fix memory leak when throwing stack overflow errorMark Pulford2011-05-101-2/+11
| | | | | | | | json->tmp was not freed when throwing a Lua stack overflow exception.
* | Remove whitespace from generated JSON outputMark Pulford2011-05-103-13/+14
| | | | | | | | | | | | | | Remove excess whitespace to reduce output size and increase encode performance. Suggested by: Zhang "agentzh" Yichun <agentzh@gmail.com>
* | Add extra encoding/nesting testsMark Pulford2011-05-103-10/+45
| | | | | | | | | | | | - Use pcall() to call test config functions. - Test encoding with refuse_invalid_numbers() options. - Test encoding invalid types.
* | Add support for perl installs outside of /usr/binMark Pulford2011-05-101-1/+2
| | | | | | | | | | Change "perl -w" to "use warnings" for compatibility with systems that put all #! args into argv[1].
* | Update version to 1.0.1Mark Pulford2011-05-105-8/+10
| |
* | Add build support for Mac OSXMark Pulford2011-05-101-1/+11
| |
* | Add TODO file1.0Mark Pulford2011-05-092-1/+8
| |
* | Tidy and reformat lua_cjson.c (minor)Mark Pulford2011-05-091-12/+9
| |
* | Add changelog (NEWS)Mark Pulford2011-05-082-1/+3
| |
* | Add documentation (README)Mark Pulford2011-05-082-1/+212
| |
* | Add test for excessive nesting during encodeMark Pulford2011-05-082-6/+16
| |
* | Add NaN/Inf encoding tests, rearrange test orderMark Pulford2011-05-081-71/+74
| |
* | Generate error when attempting to decode UTF-16/32Mark Pulford2011-05-082-0/+12
| |
* | Add UTF-16 surrogate pair decode supportMark Pulford2011-05-085-11/+149
| | | | | | | | | | | | | | | | - Add tests for UTF-16 decoding and failures - Add getutf8.pl to assist with UTF-16 decode testing - Re-add test_decode_cycle() which was accidentally removed earlier - Rename bytestring.dat to octets-escaped.dat
* | Test octect encode/decode separatelyMark Pulford2011-05-082-24/+9
| |
* | Convert tests to automatically verify outputMark Pulford2011-05-081-106/+107
| |
* | Implement data driven test frameworkMark Pulford2011-05-083-29/+158
| | | | | | | | | | | | | | | | - Add run_test(): Test a function and verify its output - Add run_test_group(): Execute a test batch - Add serialise_value(): Serialise a Lua value into the Lua syntax - Add file_save() helper function - Add NaN comparison support to compare_values()
* | Rework runtime config optionsMark Pulford2011-05-071-56/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Rename API for consistency: - sparse_ratio() -> encode_sparse_array() - max_depth() -> encode_max_depth() - invalid_numbers() -> refuse_invalid_numbers() - Adjust sparse array handling: - Add "safe" option to allow small sparse arrays regardless of the ratio. - Generate an error by default instead of converting an array into an object (POLA). - Update invalid number handling: - Allow decoding invalid numbers by default since many JSON implementations output NaN/Infinity. - Throw an error by default when attempting to encode NaN/Infinity since the RFC explicitly states it is not permitted. - Support specifying invalid number configuration separately for encode/decode.
* | Add test to compare objects after decode/encodeMark Pulford2011-05-072-3/+40
| |
* | Escape forward slash when encodingMark Pulford2011-05-071-1/+1
| | | | | | | | | | Escaping forward slash can be useful when including JSON output in HTML (Eg, embedded in SCRIPT tags).
* | Fix strbuf_t leak on lua_close()Mark Pulford2011-05-051-3/+20
| | | | | | | | - Add __gc metatable method to clean up json_config_t userdata.
* | Add tests directory to RPM %doc installMark Pulford2011-05-051-1/+1
| |
* | Add benchmark results (performance.txt)Mark Pulford2011-05-042-1/+43
| |
* | Document permission received to use examplesMark Pulford2011-05-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | Douglas Crockford <douglas@crockford.com> has given permission for these examples to be used. Message-ID: <4DC01FB7.8090001@crockford.com> Date: Tue, 03 May 2011 08:31:03 -0700 From: Douglas Crockford To: Mark Pulford Subject: Re: JSON examples
* | Add basic JSON tests and benchmarkMark Pulford2011-05-0311-0/+465
| |
* | Generate parse error for invalid leading zerosMark Pulford2011-05-031-8/+17
| |
* | Preallocate temporary decode string bufferMark Pulford2011-05-032-11/+20
| | | | | | | | | | The preallocated buffer removes the need for buffer length checks while processing strings and results in a 10 - 15% speedup.
* | Add strbuf_reset() to reset string lengthMark Pulford2011-05-032-2/+8
| | | | | | | | | | Add strbuf_reset() to reset string length and hide the string implementation.
* | Escape all unprintable ASCII when encodingMark Pulford2011-05-031-47/+94
| | | | | | | | | | | | | | | | | | | | | | | | Replace json_escape_char() with a static char2escape[] lookup table. Escape all unprintable ASCII (0-31, 127) and JSON special characters (double quote, backslash). Dynamic creation of the char2escape table has been left commented out due to an apparent performance hit. The performance loss may be due to memory/page alignment (unknown). Rename parsing lookup table from ch2escape to escape2char for consistency.
* | Implement minor performance improvementsMark Pulford2011-05-031-42/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use strbuf_append_mem() for small static strings (~2% speedup). - Use &json_config_key for storing registry data. It's more unique and faster than a text string. - Use strbuf_append_char_unsafe() for string quotes (~4% speedup). - Use strbuf_append_number() instead of strbuf_append_fmt(). It is much simpler and avoids the potential for 2 expensive calls to vsnprintf(). - Make encoding buffer persistent across calls to avoid extra malloc/free (~4% speedup on example2.json). These performance improvements can be much more pronounced depending on the data. Eg, small strings, numbers, booleans, etc..
* | Add strbuf_append_number()Mark Pulford2011-05-032-8/+27
| | | | | | | | | | | | | | | | The separate strbuf_append_number() function avoids a potential double call to the slow vsnprintf() function required by strbuf_append_fmt(). Also inline strbuf_append_mem() since it is very simple and will be used often.
* | Add build and package supportMark Pulford2011-05-013-0/+83
| | | | | | | | | | - 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-014-18/+102
| |
* | 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>