diff options
author | Robin Krahl <me@robin-krahl.de> | 2015-06-27 23:16:16 +0200 |
---|---|---|
committer | Robin Krahl <me@robin-krahl.de> | 2015-06-27 23:16:16 +0200 |
commit | a673ab08731494f4541f2c9a70ccd3695b747624 (patch) | |
tree | 12ceabccfefa376d197d11b9c1200914cb04c573 | |
parent | 24875af9d53e3f1a90fa5e6bd4aaef36bb0c3591 (diff) | |
download | LrMediaWiki-a673ab08731494f4541f2c9a70ccd3695b747624.tar.gz LrMediaWiki-a673ab08731494f4541f2c9a70ccd3695b747624.tar.bz2 |
Fix code style issues.
-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 |