diff options
| -rw-r--r-- | .travis.yml | 2 | ||||
| -rw-r--r-- | mediawiki.lrdevplugin/JSON.lua | 21 | 
2 files changed, 12 insertions, 11 deletions
| diff --git a/.travis.yml b/.travis.yml index c730b8c..fe5fd93 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,4 +6,4 @@ install:  script:    - luac -p mediawiki.lrdevplugin/*.lua -  - luacheck mediawiki.lrdevplugin/*.lua --globals LOC import _PLUGIN -a +  - luacheck mediawiki.lrdevplugin/*.lua --globals LOC import _PLUGIN -a --ignore 512 diff --git a/mediawiki.lrdevplugin/JSON.lua b/mediawiki.lrdevplugin/JSON.lua index 5f11425..e6fb651 100644 --- a/mediawiki.lrdevplugin/JSON.lua +++ b/mediawiki.lrdevplugin/JSON.lua @@ -119,11 +119,11 @@ local OBJDEF = {  --            :  --  --          for i, photo in ipairs(photosToProcess) do ---               :              ---               :              +--               : +--               :  --               local data = JSON:decode(someJsonText, { photo = photo }) ---               :              ---               :              +--               : +--               :  --          end  --  -- @@ -234,9 +234,9 @@ local OBJDEF = {  --   An example of setting align_keys to true:  --  --     JSON:encode_pretty(data, nil, { pretty = true, indent = "  ", align_keys = true }) ---   +--  --   produces: ---    +--  --      {  --           "city": "Kyoto",  --        "climate": { @@ -260,7 +260,7 @@ local OBJDEF = {  --   when non-positive numeric keys exist), numeric keys are converted to  --   strings.  -- ---   For example,  +--   For example,  --     JSON:encode({ "one", "two", "three", SOMESTRING = "some string" }))  --   produces the JSON object  --     {"1":"one","2":"two","3":"three","SOMESTRING":"some string"} @@ -483,7 +483,7 @@ local function grok_string(self, text, start, etc)                 if lo_surrogate then                    i = i + 6 -- bypass the low surrogate we just read                    codepoint = 0x2400 + (codepoint - 0xD800) * 0x400 + tonumber(lo_surrogate, 16) -               else +               -- else                    -- not a proper low, so we'll just leave the first codepoint as is and spit it out.                 end              end @@ -537,7 +537,8 @@ local function grok_object(self, text, start, etc)        i = skip_whitespace(text, i + 1) -      local new_val, new_i = grok_one(self, text, i) +      local new_val +      new_val, new_i = grok_one(self, text, i)        VALUE[key] = new_val @@ -1021,7 +1022,7 @@ return OBJDEF:new()  --  --                 To maintain the prior throw-an-error semantics, set  --                      JSON.noKeyConversion = true ---                  +--  --   20131004.7    Release under a Creative Commons CC-BY license, which I should have done from day one, sorry.  --  --   20130120.6    Comment update: added a link to the specific page on my blog where this code can | 
