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