summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/util-jsn.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/util-jsn.lua')
-rw-r--r--tex/context/base/mkiv/util-jsn.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/tex/context/base/mkiv/util-jsn.lua b/tex/context/base/mkiv/util-jsn.lua
index e835c07d6..e5f83e06c 100644
--- a/tex/context/base/mkiv/util-jsn.lua
+++ b/tex/context/base/mkiv/util-jsn.lua
@@ -21,7 +21,7 @@ local format = string.format
local utfchar = utf.char
local concat = table.concat
-local tonumber, tostring, rawset, type = tonumber, tostring, rawset, type
+local tonumber, tostring, rawset, type, next = tonumber, tostring, rawset, type, next
local json = utilities.json or { }
utilities.json = json
@@ -158,4 +158,11 @@ end
-- inspect(json.tostring(true))
+function json.load(filename)
+ local data = io.loaddata(filename)
+ if data then
+ return lpegmatch(jsonconverter,data)
+ end
+end
+
return json