all: 5.2 compatibility
[luajson.git] / lua / json.lua
blobae701487aa1791d3f8bb3130a07b4cd6f2141c62
1 --[[
2 Licensed according to the included 'LICENSE' document
3 Author: Thomas Harning Jr <harningt@gmail.com>
4 ]]
5 local decode = require("json.decode")
6 local encode = require("json.encode")
7 local util = require("json.util")
9 local is_52 = _VERSION == "Lua 5.2"
11 local _G = _G
13 if is_52 then
14 _ENV = nil
15 end
17 local json = {
18 decode = decode,
19 encode = encode,
20 util = util
23 if not is_52 then
24 _G.json = json
25 end
26 return json