Importer, Bürokraten, Moderatoren (CommentStreams), Strukturierte-Diskussionen-Bots, Oberflächenadministratoren, Push-Abonnementverwalter, Oversighter, Administratoren, Kampagnenbearbeiter (Hochladeassistent)
855
Bearbeitungen
Keine Bearbeitungszusammenfassung Markierungen: Manuelle Zurücksetzung Zurückgesetzt |
Keine Bearbeitungszusammenfassung Markierungen: Manuelle Zurücksetzung Zurückgesetzt |
||
Zeile 1: | Zeile 1: | ||
local JSONutil = { suite = "JSONutil", | local JSONutil = { suite = "JSONutil", | ||
serial = "2019- | serial = "2019-05-29", | ||
item = 63869449 } | item = 63869449 } | ||
--[=[ | --[=[ | ||
Zeile 69: | Zeile 69: | ||
local s = mw.text.trim( apply ) | local s = mw.text.trim( apply ) | ||
local sep = string.char( 10 ) | local sep = string.char( 10 ) | ||
local i, j | local i, j, r, scan, sep0, sep1, stab, start, stub, suffix | ||
local framework = function ( a ) | local framework = function ( a ) | ||
-- syntax analysis outside strings | -- syntax analysis outside strings | ||
Zeile 96: | Zeile 96: | ||
:gsub( string.char( 13 ), sep ) | :gsub( string.char( 13 ), sep ) | ||
stub = s:gsub( sep, "" ):gsub( stab, "" ) | stub = s:gsub( sep, "" ):gsub( stab, "" ) | ||
scan = string.char( 0x5B, 0x01, 0x2D, 0x1F, 0x5D ) | scan = string.char( 0x5B, 0x01, 0x2D, 0x1F, 0x5D ) | ||
j = stub:find( scan ) | j = stub:find( scan ) | ||
if j then | if j then | ||
r = "ControlChar" | r = "ControlChar" | ||
s = | s = s:sub( j + 1, j + JSONutil.more ) | ||
else | else | ||
i = true | i = true | ||
j = 1 | j = 1 | ||
sep0 = string.char( 0x5B, 0x22, 0x27, 0x5D ) -- [ " ' ] | sep0 = string.char( 0x5B, 0x22, 0x27, 0x5D ) -- [ " ' ] | ||
sep1 = string.char( 0x5B, 0x5C, 0x22, 0x5D ) -- [ \ " ] | sep1 = string.char( 0x5B, 0x5C, 0x22, 0x5D ) -- [ \ " ] | ||
Zeile 111: | Zeile 109: | ||
else | else | ||
r = "Bracket0" | r = "Bracket0" | ||
s = | s = s:sub( 1, JSONutil.more ) | ||
end | end | ||
while i do | while i do | ||
Zeile 123: | Zeile 121: | ||
if stub:find( '[^"]*,%s*[%]}]' ) then | if stub:find( '[^"]*,%s*[%]}]' ) then | ||
r = "CommaEnd" | r = "CommaEnd" | ||
s = | s = stub:sub( 1, JSONutil.more ) | ||
i = false | i = false | ||
j = false | j = false | ||
Zeile 157: | Zeile 154: | ||
else | else | ||
r = "QouteEnd" | r = "QouteEnd" | ||
s = | s = s:sub( i, i + JSONutil.more ) | ||
i = false | i = false | ||
end | end | ||
Zeile 164: | Zeile 160: | ||
else | else | ||
r = "Qoute" | r = "Qoute" | ||
s = | s = s:sub( i, i + JSONutil.more ) | ||
i = false | i = false | ||
end | end | ||
Zeile 172: | Zeile 167: | ||
if stub:find( '[^"]*,%s*[%]}]' ) then | if stub:find( '[^"]*,%s*[%]}]' ) then | ||
r = "CommaEnd" | r = "CommaEnd" | ||
s = | s = stub:sub( 1, JSONutil.more ) | ||
else | else | ||
framework( stub ) | framework( stub ) | ||
Zeile 201: | Zeile 195: | ||
if j > 1 then | if j > 1 then | ||
s = string.format( "%d %s", j, s ) | s = string.format( "%d %s", j, s ) | ||
end | end | ||
end | end |