aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2024-02-28 20:53:04 -0300
committerHisham Muhammad <hisham@gobolinux.org>2024-02-29 04:20:44 +0000
commitb66928265dba695b7a1c83518a91832f93e9face (patch)
treeeca26b314bcf89c7323b764fe7f2e914676c2b23
parent847f424b8ece82ace9e01d455e0ca14627dd3553 (diff)
downloadluarocks-b66928265dba695b7a1c83518a91832f93e9face.tar.gz
luarocks-b66928265dba695b7a1c83518a91832f93e9face.tar.bz2
luarocks-b66928265dba695b7a1c83518a91832f93e9face.zip
deps: bump vendored dkjson to version 2.7
-rw-r--r--src/luarocks/vendor/dkjson.lua19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/luarocks/vendor/dkjson.lua b/src/luarocks/vendor/dkjson.lua
index 95e4d884..7a867241 100644
--- a/src/luarocks/vendor/dkjson.lua
+++ b/src/luarocks/vendor/dkjson.lua
@@ -7,7 +7,7 @@ local global_module_name = 'json'
7 7
8David Kolf's JSON module for Lua 5.1 - 5.4 8David Kolf's JSON module for Lua 5.1 - 5.4
9 9
10Version 2.6 10Version 2.7
11 11
12 12
13For the documentation see the corresponding readme.txt or visit 13For the documentation see the corresponding readme.txt or visit
@@ -17,7 +17,7 @@ You can contact the author by sending an e-mail to 'david' at the
17domain 'dkolf.de'. 17domain 'dkolf.de'.
18 18
19 19
20Copyright (C) 2010-2021 David Heiko Kolf 20Copyright (C) 2010-2024 David Heiko Kolf
21 21
22Permission is hereby granted, free of charge, to any person obtaining 22Permission is hereby granted, free of charge, to any person obtaining
23a copy of this software and associated documentation files (the 23a copy of this software and associated documentation files (the
@@ -42,8 +42,8 @@ SOFTWARE.
42--]==] 42--]==]
43 43
44-- global dependencies: 44-- global dependencies:
45local pairs, type, tostring, tonumber, getmetatable, setmetatable = 45local pairs, type, tostring, tonumber, getmetatable, setmetatable, rawset =
46 pairs, type, tostring, tonumber, getmetatable, setmetatable 46 pairs, type, tostring, tonumber, getmetatable, setmetatable, rawset
47local error, require, pcall, select = error, require, pcall, select 47local error, require, pcall, select = error, require, pcall, select
48local floor, huge = math.floor, math.huge 48local floor, huge = math.floor, math.huge
49local strrep, gsub, strsub, strbyte, strchar, strfind, strlen, strformat = 49local strrep, gsub, strsub, strbyte, strchar, strfind, strlen, strformat =
@@ -52,7 +52,7 @@ local strrep, gsub, strsub, strbyte, strchar, strfind, strlen, strformat =
52local strmatch = string.match 52local strmatch = string.match
53local concat = table.concat 53local concat = table.concat
54 54
55local json = { version = "dkjson 2.6" } 55local json = { version = "dkjson 2.7" }
56 56
57local jsonlpeg = {} 57local jsonlpeg = {}
58 58
@@ -63,8 +63,8 @@ if register_global_module_table then
63 _G[global_module_name] = json 63 _G[global_module_name] = json
64 end 64 end
65end 65end
66-- blocking globals in Lua 5.2 and later 66
67local _ENV = nil -- luacheck: ignore 211 67local _ENV = nil -- blocking globals in Lua 5.2 and later
68 68
69pcall (function() 69pcall (function()
70 -- Enable access to blocked metatables. 70 -- Enable access to blocked metatables.
@@ -328,6 +328,7 @@ encode2 = function (value, indent, level, buffer, buflen, tables, globalorder, s
328 if v ~= nil then 328 if v ~= nil then
329 used[k] = true 329 used[k] = true
330 buflen, msg = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state) 330 buflen, msg = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state)
331 if not buflen then return nil, msg end
331 prev = true -- add a seperator before the next element 332 prev = true -- add a seperator before the next element
332 end 333 end
333 end 334 end
@@ -510,7 +511,7 @@ end
510local scanvalue -- forward declaration 511local scanvalue -- forward declaration
511 512
512local function scantable (what, closechar, str, startpos, nullval, objectmeta, arraymeta) 513local function scantable (what, closechar, str, startpos, nullval, objectmeta, arraymeta)
513 514 local len = strlen (str)
514 local tbl, n = {}, 0 515 local tbl, n = {}, 0
515 local pos = startpos + 1 516 local pos = startpos + 1
516 if what == 'object' then 517 if what == 'object' then
@@ -606,7 +607,7 @@ end
606function json.use_lpeg () 607function json.use_lpeg ()
607 local g = require ("lpeg") 608 local g = require ("lpeg")
608 609
609 if g.version() == "0.11" then 610 if type(g.version) == 'function' and g.version() == "0.11" then
610 error "due to a bug in LPeg 0.11, it cannot be used for JSON matching" 611 error "due to a bug in LPeg 0.11, it cannot be used for JSON matching"
611 end 612 end
612 613