Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package lua-dkjson for openSUSE:Factory 
checked in at 2021-12-28 12:26:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lua-dkjson (Old)
 and      /work/SRC/openSUSE:Factory/.lua-dkjson.new.2520 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "lua-dkjson"

Tue Dec 28 12:26:17 2021 rev:4 rq:942812 version:2.5.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/lua-dkjson/lua-dkjson.changes    2021-02-18 
20:54:34.611561391 +0100
+++ /work/SRC/openSUSE:Factory/.lua-dkjson.new.2520/lua-dkjson.changes  
2021-12-28 12:26:50.068493807 +0100
@@ -1,0 +2,6 @@
+Mon Dec 27 08:42:20 UTC 2021 - Matej Cepl <[email protected]>
+
+- What was I thinking? Description and Summary had nothing to di
+  with this package.
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ lua-dkjson.spec ++++++
--- /var/tmp/diff_new_pack.01Ledm/_old  2021-12-28 12:26:50.484494123 +0100
+++ /var/tmp/diff_new_pack.01Ledm/_new  2021-12-28 12:26:50.488494126 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package lua-dkjson
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -21,15 +21,15 @@
 %define uptag    release_2_5
 Version:        2.5.2
 Release:        0
-Summary:        A feature-rich command-line argument parser
+Summary:        David Kolf's JSON module for Lua
 License:        MIT
 Group:          Development/Libraries/Other
 URL:            http://dkjson.org/
 Source:         
http://dkolf.de/src/dkjson-lua.fsl/tarball/%{uptag}/dkjson.tar.gz
 BuildRequires:  %{flavor}-devel
-BuildArch:      noarch
 Requires:       %{flavor}
 Requires:       %{flavor}-lpeg
+BuildArch:      noarch
 %lua_provides
 %if "%{flavor}" == ""
 Name:           lua-dkjson
@@ -39,9 +39,14 @@
 %endif
 
 %description
-Argparse supports positional arguments, options, flags, optional
-arguments, subcommands and more. Argparse automatically generates usage,
-help, and error messages, and can generate shell completion scripts.
+dkjson is a module for encoding and decoding JSON data. It
+supports UTF-8.
+
+JSON (JavaScript Object Notation) is a format for serializing
+data based on the syntax for JavaScript data structures.
+
+dkjson is written in Lua without any dependencies, but
+when LPeg is available dkjson can use it to speed up decoding.
 
 %prep
 %setup -q -n %{uptag}/%{mod_name}

++++++ dkjson.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/release_2_5/dkjson/dkjson-2.5-2.rockspec 
new/release_2_5/dkjson/dkjson-2.5-2.rockspec
--- old/release_2_5/dkjson/dkjson-2.5-2.rockspec        2016-12-19 
21:13:05.000000000 +0100
+++ new/release_2_5/dkjson/dkjson-2.5-2.rockspec        1970-01-01 
01:00:00.000000000 +0100
@@ -1,30 +0,0 @@
-package = "dkjson"
-version = "2.5-2"
-source = {
-  url = 
"http://dkolf.de/src/dkjson-lua.fsl/tarball/dkjson-2.5.tar.gz?uuid=release_2_5";,
-  file = "dkjson-2.5.tar.gz"
-}
-description = {
-  summary = "David Kolf's JSON module for Lua",
-  detailed = [[
-dkjson is a module for encoding and decoding JSON data. It supports UTF-8.
-
-JSON (JavaScript Object Notation) is a format for serializing data based
-on the syntax for JavaScript data structures.
-
-dkjson is written in Lua without any dependencies, but
-when LPeg is available dkjson uses it to speed up decoding.
-]],
-  homepage = "http://dkolf.de/src/dkjson-lua.fsl/";,
-  license = "MIT/X11"
-}
-dependencies = {
-  "lua >= 5.1, < 5.4"
-}
-build = {
-  type = "builtin",
-  modules = {
-    dkjson = "dkjson.lua"
-  }
-}
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/release_2_5/dkjson/dkjson-2.6-1.rockspec 
new/release_2_5/dkjson/dkjson-2.6-1.rockspec
--- old/release_2_5/dkjson/dkjson-2.6-1.rockspec        1970-01-01 
01:00:00.000000000 +0100
+++ new/release_2_5/dkjson/dkjson-2.6-1.rockspec        2021-12-19 
13:07:14.000000000 +0100
@@ -0,0 +1,30 @@
+package = "dkjson"
+version = "2.6-1"
+source = {
+  url = 
"http://dkolf.de/src/dkjson-lua.fsl/tarball/dkjson-2.6.tar.gz?uuid=release_2_6";,
+  file = "dkjson-2.6.tar.gz"
+}
+description = {
+  summary = "David Kolf's JSON module for Lua",
+  detailed = [[
+dkjson is a module for encoding and decoding JSON data. It supports UTF-8.
+
+JSON (JavaScript Object Notation) is a format for serializing data based
+on the syntax for JavaScript data structures.
+
+dkjson is written in Lua without any dependencies, but
+when LPeg is available dkjson can use it to speed up decoding.
+]],
+  homepage = "http://dkolf.de/src/dkjson-lua.fsl/";,
+  license = "MIT/X11"
+}
+dependencies = {
+  "lua >= 5.1, < 5.5"
+}
+build = {
+  type = "builtin",
+  modules = {
+    dkjson = "dkjson.lua"
+  }
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/release_2_5/dkjson/dkjson.lua 
new/release_2_5/dkjson/dkjson.lua
--- old/release_2_5/dkjson/dkjson.lua   2016-12-19 21:13:05.000000000 +0100
+++ new/release_2_5/dkjson/dkjson.lua   2021-12-19 13:07:14.000000000 +0100
@@ -1,13 +1,13 @@
 -- Module options:
-local always_try_using_lpeg = true
+local always_use_lpeg = false
 local register_global_module_table = false
 local global_module_name = 'json'
 
 --[==[
 
-David Kolf's JSON module for Lua 5.1/5.2
+David Kolf's JSON module for Lua 5.1 - 5.4
 
-Version 2.5
+Version 2.6
 
 
 For the documentation see the corresponding readme.txt or visit
@@ -17,7 +17,7 @@
 domain 'dkolf.de'.
 
 
-Copyright (C) 2010-2014 David Heiko Kolf
+Copyright (C) 2010-2021 David Heiko Kolf
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
@@ -52,13 +52,19 @@
 local strmatch = string.match
 local concat = table.concat
 
-local json = { version = "dkjson 2.5" }
+local json = { version = "dkjson 2.6" }
+
+local jsonlpeg = {}
 
 if register_global_module_table then
-  _G[global_module_name] = json
+  if always_use_lpeg then
+    _G[global_module_name] = jsonlpeg
+  else
+    _G[global_module_name] = json
+  end
 end
 
-local _ENV = nil -- blocking globals in Lua 5.2
+local _ENV = nil -- blocking globals in Lua 5.2 and later
 
 pcall (function()
   -- Enable access to blocked metatables.
@@ -619,10 +625,18 @@
     return g.Cmt (g.Cc (msg) * g.Carg (2), ErrorCall)
   end
 
+  local function ErrorUnterminatedCall (str, pos, what, state)
+    return ErrorCall (str, pos - 1, "unterminated " .. what, state)
+  end
+
   local SingleLineComment = P"//" * (1 - S"\n\r")^0
   local MultiLineComment = P"/*" * (1 - P"*/")^0 * P"*/"
   local Space = (S" \n\r\t" + P"\239\187\191" + SingleLineComment + 
MultiLineComment)^0
 
+  local function ErrUnterminated (what)
+    return g.Cmt (g.Cc (what) * g.Carg (2), ErrorUnterminatedCall)
+  end
+
   local PlainChar = 1 - S"\"\\\n\r"
   local EscapeSequence = (P"\\" * g.C (S"\"\\/bfnrt" + Err "unsupported escape 
sequence")) / escapechars
   local HexDigit = R("09", "af", "AF")
@@ -640,7 +654,7 @@
   local U16Sequence = (P"\\u" * g.C (HexDigit * HexDigit * HexDigit * 
HexDigit))
   local UnicodeEscape = g.Cmt (U16Sequence * U16Sequence, UTF16Surrogate) + 
U16Sequence/UTF16BMP
   local Char = UnicodeEscape + EscapeSequence + PlainChar
-  local String = P"\"" * g.Cs (Char ^ 0) * (P"\"" + Err "unterminated string")
+  local String = P"\"" * (g.Cs (Char ^ 0) * P"\"" + ErrUnterminated "string")
   local Integer = P"-"^(-1) * (P"0" + (R"19" * R"09"^0))
   local Fractal = P"." * R"09"^0
   local Exponent = (S"eE") * (S"+-")^(-1) * R"09"^1
@@ -653,41 +667,62 @@
   -- at a time and store them directly to avoid hitting the LPeg limits.
   local function parsearray (str, pos, nullval, state)
     local obj, cont
+    local start = pos
     local npos
     local t, nt = {}, 0
     repeat
       obj, cont, npos = pegmatch (ArrayContent, str, pos, nullval, state)
-      if not npos then break end
+      if cont == 'end' then
+        return ErrorUnterminatedCall (str, start, "array", state)
+      end
       pos = npos
-      nt = nt + 1
-      t[nt] = obj
-    until cont == 'last'
+      if cont == 'cont' or cont == 'last' then
+        nt = nt + 1
+        t[nt] = obj
+      end
+    until cont ~= 'cont'
     return pos, setmetatable (t, state.arraymeta)
   end
 
   local function parseobject (str, pos, nullval, state)
     local obj, key, cont
+    local start = pos
     local npos
     local t = {}
     repeat
       key, obj, cont, npos = pegmatch (ObjectContent, str, pos, nullval, state)
-      if not npos then break end
+      if cont == 'end' then
+        return ErrorUnterminatedCall (str, start, "object", state)
+      end
       pos = npos
-      t[key] = obj
-    until cont == 'last'
+      if cont == 'cont' or cont == 'last' then
+        t[key] = obj
+      end
+    until cont ~= 'cont'
     return pos, setmetatable (t, state.objectmeta)
   end
 
-  local Array = P"[" * g.Cmt (g.Carg(1) * g.Carg(2), parsearray) * Space * 
(P"]" + Err "']' expected")
-  local Object = P"{" * g.Cmt (g.Carg(1) * g.Carg(2), parseobject) * Space * 
(P"}" + Err "'}' expected")
+  local Array = P"[" * g.Cmt (g.Carg(1) * g.Carg(2), parsearray)
+  local Object = P"{" * g.Cmt (g.Carg(1) * g.Carg(2), parseobject)
   local Value = Space * (Array + Object + SimpleValue)
   local ExpectedValue = Value + Space * Err "value expected"
-  ArrayContent = Value * Space * (P"," * g.Cc'cont' + g.Cc'last') * g.Cp()
-  local Pair = g.Cg (Space * String * Space * (P":" + Err "colon expected") * 
ExpectedValue)
-  ObjectContent = Pair * Space * (P"," * g.Cc'cont' + g.Cc'last') * g.Cp()
+  local ExpectedKey = String + Err "key expected"
+  local End = P(-1) * g.Cc'end'
+  local ErrInvalid = Err "invalid JSON"
+  ArrayContent = (Value * Space * (P"," * g.Cc'cont' + P"]" * g.Cc'last'+ End 
+ ErrInvalid)  + g.Cc(nil) * (P"]" * g.Cc'empty' + End  + ErrInvalid)) * g.Cp()
+  local Pair = g.Cg (Space * ExpectedKey * Space * (P":" + Err "colon 
expected") * ExpectedValue)
+  ObjectContent = (g.Cc(nil) * g.Cc(nil) * P"}" * g.Cc'empty' + End + (Pair * 
Space * (P"," * g.Cc'cont' + P"}" * g.Cc'last' + End + ErrInvalid) + 
ErrInvalid)) * g.Cp()
   local DecodeValue = ExpectedValue * g.Cp ()
 
-  function json.decode (str, pos, nullval, ...)
+  jsonlpeg.version = json.version
+  jsonlpeg.encode = json.encode
+  jsonlpeg.null = json.null
+  jsonlpeg.quotestring = json.quotestring
+  jsonlpeg.addnewline = json.addnewline
+  jsonlpeg.encodeexception = json.encodeexception
+  jsonlpeg.using_lpeg = true
+
+  function jsonlpeg.decode (str, pos, nullval, ...)
     local state = {}
     state.objectmeta, state.arraymeta = optionalmetatables(...)
     local obj, retpos = pegmatch (DecodeValue, str, pos, nullval, state)
@@ -698,16 +733,15 @@
     end
   end
 
-  -- use this function only once:
-  json.use_lpeg = function () return json end
-
-  json.using_lpeg = true
+  -- cache result of this function:
+  json.use_lpeg = function () return jsonlpeg end
+  jsonlpeg.use_lpeg = json.use_lpeg
 
-  return json -- so you can get the module using json = require 
"dkjson".use_lpeg()
+  return jsonlpeg
 end
 
-if always_try_using_lpeg then
-  pcall (json.use_lpeg)
+if always_use_lpeg then
+  return json.use_lpeg()
 end
 
 return json
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/release_2_5/dkjson/jsontest.lua 
new/release_2_5/dkjson/jsontest.lua
--- old/release_2_5/dkjson/jsontest.lua 2016-12-19 21:13:05.000000000 +0100
+++ new/release_2_5/dkjson/jsontest.lua 2021-12-19 13:07:14.000000000 +0100
@@ -32,25 +32,6 @@
   os.setlocale(oldloc, 'numeric')
 end
 
-if test_module == 'dkjson-nopeg' then
-  test_module = 'dkjson'
-  package.preload["lpeg"] = function () error "lpeg disabled" end
-  package.loaded["lpeg"] = nil
-  lpeg = nil
-end
-
-if test_module == 'dkjson-lulpeg' then
-  test_module = 'dkjson'
-  package.loaded["lpeg"] = require "lulpeg"
-end
-
-do
-  -- http://chiselapp.com/user/dhkolf/repository/dkjson/
-  local dkjson = require "dkjson"
-  dkencode = dkjson.encode
-  dkdecode = dkjson.decode
-end
-
 if test_module == 'cmj-json' then
   -- https://github.com/craigmj/json4lua/
   -- http://json.luaforge.net/
@@ -59,8 +40,20 @@
   decode = json.decode
 elseif test_module == 'dkjson' then
   -- http://chiselapp.com/user/dhkolf/repository/dkjson/
-  encode = dkencode
-  decode = dkdecode
+  local json = require "dkjson"
+  encode = json.encode
+  decode = json.decode
+elseif test_module == 'dkjson-lpeg' then
+  test_module = 'dkjson'
+  local json = require "dkjson".use_lpeg()
+  encode = json.encode
+  decode = json.decode
+elseif test_module == 'dkjson-lulpeg' then
+  test_module = 'dkjson'
+  package.loaded["lpeg"] = require "lulpeg"
+  local json = require "dkjson".use_lpeg()
+  encode = json.encode
+  decode = json.decode
 elseif test_module == 'fleece' then
   -- http://www.eonblast.com/fleece/
   local fleece = require "fleece"
@@ -101,6 +94,13 @@
   return
 end
 
+do
+  -- http://chiselapp.com/user/dhkolf/repository/dkjson/
+  local dkjson = require "dkjson"
+  dkencode = dkjson.encode
+  dkdecode = dkjson.decode
+end
+
 if not encode then
   print ("No encode method")
 else
@@ -340,6 +340,36 @@
 else
   local x, r
 
+  x = decode [=[
+{
+  "String": "Content",
+  "Integer": 26,
+  "Object": {
+    "String2": "Content2",
+    "Boolean": true,
+    "Object2": {},
+    "Array": [ "Aa", "Bb", "Cc" ],
+    "Integer": 42,
+    "Nil": null
+  }
+}
+]=]
+  r = type(x) == 'table'
+  r = r and x.String == "Content"
+  r = r and x.Integer == 26
+  r = r and type(x.Object) == 'table'
+  r = r and x.Object.String2 == "Content2"
+  r = r and x.Object.Boolean == true
+  r = r and type(x.Object.Object2) == 'table'
+  r = r and type(x.Object.Array) == 'table'
+  r = r and x.Object.Array[3] == "Cc"
+  r = r and x.Object.Integer == 42
+  r = r and x.Object.Nil == nil
+  if not r then
+    print ("Did not decode example data correctly")
+  end
+
+
   x = decode[=[ ["\u0000"] ]=]
   if x[1] ~= "\000" then
     print ("\\u0000 isn't decoded correctly")
@@ -397,11 +427,29 @@
   r, x = pcall(decode, "{}")
   if not r then
     print ("decoding an empty object raises an error:", x)
+  elseif type(x) ~= 'table' then
+    print ("decoding an empty object did not return a table")
+  end
+
+  r, x = pcall(decode, "{\"a\":1}")
+  if not r then
+    print ("decoding an object with one element raises an error:", x)
+  elseif type(x) ~= 'table' or x.a ~= 1 then
+    print ("decoding an object with one element did not return the expected 
table")
+  end
+
+  r, x = pcall(decode, "{\"a\":1,\"b\":2}")
+  if not r then
+    print ("decoding an object with two elements raises an error:", x)
+  elseif type(x) ~= 'table' or x.a ~= 1 or x.b ~= 2 then
+    print ("decoding an object with two elements did not return the expected 
table")
   end
 
   r, x = pcall(decode, "[]")
   if not r then
     print ("decoding an empty array raises an error:", x)
+  elseif type(x) ~= 'table' then
+    print ("decoding an empty array did not return a table")
   end
 
   r, x = pcall(decode, "[1e+2]")
@@ -411,6 +459,13 @@
     print ("1e+2 decoded incorrectly:", r[1])
   end
 
+  r, x = pcall(decode, "[1,2]")
+  if not r then
+    print ("decoding an array with two elements raises an error:", x)
+  elseif type(x) ~= 'table' or x[1] ~= 1 or x[2] ~= 2 then
+    print ("decoding an array with two elements did not return the expected 
table")
+  end
+
   inlocale(function ()
     local r, x = pcall(decode, "[0.5]")
     if not r then
@@ -424,7 +479,7 @@
 
   -- special tests for dkjson:
   if test_module == 'dkjson' then
-    x = dkdecode[=[ [{"x":0}] ]=]
+    x = decode[=[ [{"x":0}] ]=]
     local m = getmetatable(x)
     if not m or m.__jsontype ~= 'array' then
       print ("<metatable>.__jsontype ~= array")
@@ -434,17 +489,49 @@
       print ("<metatable>.__jsontype ~= object")
     end
     
-    local x,p,m = dkdecode" invalid "
+    local x,p,m = decode" invalid "
     if p ~= 2 or type(m) ~= 'string' or not m:find("at line 1, column 2$") then
-      print (("Invalid location: position=%d, message=%q"):format(p,m))
+      print (("Invalid location [1]: position=%d, message=%q"):format(p,m))
     end
-    local x,p,m = dkdecode" \n invalid "
+    local x,p,m = decode" \n invalid "
     if p ~= 4 or type(m) ~= 'string' or not m:find("at line 2, column 2$") then
-      print (("Invalid location: position=%d, message=%q"):format(p,m))
+      print (("Invalid location [2]: position=%d, message=%q"):format(p,m))
+    end
+    -- report the position of the unmatched opening character instead of the
+    -- position of the end of the string.
+    local x,p,m = decode"[   {\"a\":\"........\""
+    if type(m) ~= 'string' or not m:find("at line 1, column 5$") then
+      print (("Invalid location [3]: position=%d, message=%q"):format(p,m))
+    end
+    local x,p,m = decode"[   [\"a\",\"........\","
+    if type(m) ~= 'string' or not m:find("at line 1, column 5$") then
+      print (("Invalid location [4]: position=%d, message=%q"):format(p,m))
+    end
+    -- report the position of the last opened object
+    local x,p,m = decode"{\"x\":  {\"a\":\"........\""
+    if type(m) ~= 'string' or not m:find("at line 1, column 8$") then
+      print (("Invalid location [5]: position=%d, message=%q"):format(p,m))
+    end
+    -- report missing string for key
+    local x,p,m = decode"{  {\"a\":\"........\""
+    if type(m) ~= 'string' or not m:find("at line 1, column 4$") then
+      print (("Invalid location [6]: position=%d, message=%q"):format(p,m))
+    end
+    local x,p,m = decode"[-]"
+    if type(m) ~= 'string' or not m:find("at line 1, column 2$") then
+      print (("Invalid location for invalid char in array: position=%d, 
message=%q"):format(p,m))
+    end
+    local x,p,m = decode"{-}"
+    if type(m) ~= 'string' or not m:find("at line 1, column 2$") then
+      print (("Invalid location for invalid char in object: position=%d, 
message=%q"):format(p,m))
+    end
+    local x,p,m = decode"  \"...."
+    if type(m) ~= 'string' or not m:find("at line 1, column 3$") then
+      print (("Invalid location for unterminated string: position=%d, 
message=%q"):format(p,m))
     end
 
     do -- single line comments
-      local x, p, m  = dkdecode [[
+      local x, p, m  = decode [[
 {"test://" // comment // --?
    : [  // continues
    0]   //
@@ -456,7 +543,7 @@
     end
 
     do -- multi line comments
-      local x, p, m  = dkdecode [[
+      local x, p, m  = decode [[
 {"test:/*"/**//*
    hi! this is a comment
 */   : [/** / **/  0]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/release_2_5/dkjson/readme.txt 
new/release_2_5/dkjson/readme.txt
--- old/release_2_5/dkjson/readme.txt   2016-12-19 21:13:05.000000000 +0100
+++ new/release_2_5/dkjson/readme.txt   2021-12-19 13:07:14.000000000 +0100
@@ -1,7 +1,7 @@
-David Kolf's JSON module for Lua 5.1/5.2
-========================================
+David Kolf's JSON module for Lua 5.1 - 5.4
+==========================================
 
-*Version 2.5*
+*Version 2.6*
 
 In the default configuration this module writes no global values, not even
 the module table. Import it using
@@ -119,7 +119,7 @@
 `json.version`
 --------------
 
-Set to `"dkjson 2.5"`.
+Set to `"dkjson 2.6"`.
 
 `json.quotestring (string)`
 ---------------------------
@@ -146,36 +146,30 @@
 LPeg support
 ------------
 
-When the local configuration variable `always_try_using_lpeg` is set,
+When the local configuration variable `always_use_lpeg` is set,
 this module tries to load LPeg to replace the `decode` function. The
 speed increase is significant. You can get the LPeg module at
   <http://www.inf.puc-rio.br/~roberto/lpeg/>.
-When LPeg couldn't be loaded, the pure Lua functions stay active.
 
-In case you don't want this module to require LPeg on its own,
-disable the option `always_try_using_lpeg` in the options section at
-the top of the module.
-
-In this case you can later load LPeg support using
+Without changing the module configuration you can get LPeg support by
+calling the function `use_lpeg`:
 
 ### `json.use_lpeg ()`
 
-Require the LPeg module and replace the functions `quotestring` and
-and `decode` with functions that use LPeg patterns.
-This function returns the module table, so you can load the module
-using:
+Require the LPeg module and return a copy of the module table where the
+`decode` function was replaced by a version that uses LPeg:
 
     json = require "dkjson".use_lpeg()
 
-Alternatively you can use `pcall` so the JSON module still works when
-LPeg isn't found.
+Without the configuration to always use LPEG the original module table is
+unchanged and still available by calls to
 
     json = require "dkjson"
-    pcall (json.use_lpeg)
 
 ### `json.using_lpeg`
 
-This variable is set to `true` when LPeg was loaded successfully.
+This variable is set to `true` in the copy of the module table that uses
+LPeg support.
 
 ---------------------------------------------------------------------
 
@@ -187,7 +181,7 @@
 
 ---------------------------------------------------------------------
 
-*Copyright (C) 2010-2014 David Heiko Kolf*
+*Copyright (C) 2010-2021 David Heiko Kolf*
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/release_2_5/dkjson/speedtest.lua 
new/release_2_5/dkjson/speedtest.lua
--- old/release_2_5/dkjson/speedtest.lua        2016-12-19 21:13:05.000000000 
+0100
+++ new/release_2_5/dkjson/speedtest.lua        2021-12-19 13:07:14.000000000 
+0100
@@ -20,16 +20,16 @@
   decode = json.decode
 elseif test_module == 'dkjson' then
   -- http://chiselapp.com/user/dhkolf/repository/dkjson/
-  local dkjson = require "dkjson"
-  encode = dkjson.encode
-  decode = dkjson.decode
-elseif test_module == 'dkjson-nopeg' then
   package.preload["lpeg"] = function () error "lpeg disabled" end
   package.loaded["lpeg"] = nil
   lpeg = nil
   local dkjson = require "dkjson"
   encode = dkjson.encode
   decode = dkjson.decode
+elseif test_module == 'dkjson-lpeg' then
+  local dkjson = require "dkjson".use_lpeg()
+  encode = dkjson.encode
+  decode = dkjson.decode
 elseif test_module == 'fleece' then
   -- http://www.eonblast.com/fleece/
   local fleece = require "fleece"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/release_2_5/dkjson/versions.txt 
new/release_2_5/dkjson/versions.txt
--- old/release_2_5/dkjson/versions.txt 2016-12-19 21:13:05.000000000 +0100
+++ new/release_2_5/dkjson/versions.txt 2021-12-19 13:07:14.000000000 +0100
@@ -1,3 +1,21 @@
+Version 2.6 (2021-12-19)
+===========
+
+Changes since version 2.5:
+
+  *  The decode function is no longer automatically replaced by the version
+     implemented using LPeg, but an LPeg-enabled copy of the module has to
+     be requested explicitly with the function use_lpeg.
+     This was changed to improve the predictability of the code and make
+     audits more reliable.
+  *  The LPeg-version of the decode function now reports unterminated
+     strings, arrays and objects with the position where they started
+     rather than where parsing failed which was usually at the end of the
+     input string.  This was already the behavior of the
+     pure-Lua-implementation.
+  *  Fixed a bug where entries in a dictionary were not put in the desired
+     order when their value was the boolean false.
+
 Version 2.5 (2014-04-28)
 ===========
 

Reply via email to