2 JSON Parser/Constructor for Lua
4 Author: Thomas Harning Jr. <harningt@gmail.com>
7 http://repo.or.cz/luajson
10 http://github.com/harningt/luajson
15 LPeg (Tested with 0.7, 0.8, 0.9 ... 0.6 mostly works)
17 lfs (Tested with 1.4.1)
22 All-but tests: MIT-style, See LICENSE for details
23 tests/*: Public Domain / MIT - whichever is least restrictive
25 Module/Function overview:
26 json.encode (callable module referencing json.encode.encode)
27 --encode ( value : ANY-valid )
29 Takes in a JSON-encodable value and returns the JSON-encoded text
32 array-like table (spec below)
36 'null' - represented by json.util.null
37 Table keys (string,number,boolean) are encoded as strings, others are erroneus
38 Table values are any valid input-type
39 Array-like tables are converted into JSON arrays...
40 Position 1 maps to JSON Array position 0
41 --isEncodable ( value : ANY )
42 Returns a boolean stating whether is is encodeable or not
43 NOTE: Tables/arrays are not deeply inspected
45 json.decode (callable module referencing json.decode.decode)
46 --decode (data : string, strict : optional boolean)
47 Takes in a string of JSON data and converts it into a Lua object
48 If 'strict' is set, then the strict JSON rule-set is used
51 --printValue (tab : ANY, name : string)
52 recursively prints out all object values - if duplicates found, reference printed
54 Reference value to represent 'null' in a well-defined way to
55 allow for null values to be inserted into an array/table
58 parsing test suite from JSON_checker project of http://www.json.org/
59 No listed license for these files in their package.