|
My primitive JSON decoder, which operates by lexically translating
a JSON code to a Lua table literal, now does three things:
1. Unicode codepoints translated, e.g. from \u00e9 to \u{00e9}.
2. List delimiters translated from […] to {…}.
3. Keys translated e.g. from "item": to ["item"]=.
local function json_decode (s)
s = s:gsub("\\u(%d%d%d%d)","\\u{%1}")