diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-28 20:53:04 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-29 04:20:44 +0000 |
commit | b66928265dba695b7a1c83518a91832f93e9face (patch) | |
tree | eca26b314bcf89c7323b764fe7f2e914676c2b23 | |
parent | 847f424b8ece82ace9e01d455e0ca14627dd3553 (diff) | |
download | luarocks-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.lua | 19 |
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 | ||
8 | David Kolf's JSON module for Lua 5.1 - 5.4 | 8 | David Kolf's JSON module for Lua 5.1 - 5.4 |
9 | 9 | ||
10 | Version 2.6 | 10 | Version 2.7 |
11 | 11 | ||
12 | 12 | ||
13 | For the documentation see the corresponding readme.txt or visit | 13 | For 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 | |||
17 | domain 'dkolf.de'. | 17 | domain 'dkolf.de'. |
18 | 18 | ||
19 | 19 | ||
20 | Copyright (C) 2010-2021 David Heiko Kolf | 20 | Copyright (C) 2010-2024 David Heiko Kolf |
21 | 21 | ||
22 | Permission is hereby granted, free of charge, to any person obtaining | 22 | Permission is hereby granted, free of charge, to any person obtaining |
23 | a copy of this software and associated documentation files (the | 23 | a copy of this software and associated documentation files (the |
@@ -42,8 +42,8 @@ SOFTWARE. | |||
42 | --]==] | 42 | --]==] |
43 | 43 | ||
44 | -- global dependencies: | 44 | -- global dependencies: |
45 | local pairs, type, tostring, tonumber, getmetatable, setmetatable = | 45 | local pairs, type, tostring, tonumber, getmetatable, setmetatable, rawset = |
46 | pairs, type, tostring, tonumber, getmetatable, setmetatable | 46 | pairs, type, tostring, tonumber, getmetatable, setmetatable, rawset |
47 | local error, require, pcall, select = error, require, pcall, select | 47 | local error, require, pcall, select = error, require, pcall, select |
48 | local floor, huge = math.floor, math.huge | 48 | local floor, huge = math.floor, math.huge |
49 | local strrep, gsub, strsub, strbyte, strchar, strfind, strlen, strformat = | 49 | local strrep, gsub, strsub, strbyte, strchar, strfind, strlen, strformat = |
@@ -52,7 +52,7 @@ local strrep, gsub, strsub, strbyte, strchar, strfind, strlen, strformat = | |||
52 | local strmatch = string.match | 52 | local strmatch = string.match |
53 | local concat = table.concat | 53 | local concat = table.concat |
54 | 54 | ||
55 | local json = { version = "dkjson 2.6" } | 55 | local json = { version = "dkjson 2.7" } |
56 | 56 | ||
57 | local jsonlpeg = {} | 57 | local 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 |
65 | end | 65 | end |
66 | -- blocking globals in Lua 5.2 and later | 66 | |
67 | local _ENV = nil -- luacheck: ignore 211 | 67 | local _ENV = nil -- blocking globals in Lua 5.2 and later |
68 | 68 | ||
69 | pcall (function() | 69 | pcall (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 | |||
510 | local scanvalue -- forward declaration | 511 | local scanvalue -- forward declaration |
511 | 512 | ||
512 | local function scantable (what, closechar, str, startpos, nullval, objectmeta, arraymeta) | 513 | local 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 | |||
606 | function json.use_lpeg () | 607 | function 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 | ||