summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2013-09-02 02:01:49 +0200
committerKahrl <kahrl@gmx.net>2013-09-02 02:20:08 +0200
commit1ecf51a13f434f5cbc0f6ccc1b9a2ac6402a895f (patch)
treee8ac8ced0ed73bd9a4a803dc703a213e3a9b91ec /doc
parent71a6ffa76203a13b6cb0ec88b7ee57e04f809148 (diff)
downloadminetest-1ecf51a13f434f5cbc0f6ccc1b9a2ac6402a895f.tar.gz
minetest-1ecf51a13f434f5cbc0f6ccc1b9a2ac6402a895f.tar.bz2
minetest-1ecf51a13f434f5cbc0f6ccc1b9a2ac6402a895f.zip
Add minetest.parse_json, engine.parse_json
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt6
-rw-r--r--doc/menu_lua_api.txt2
2 files changed, 8 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index bd465bbed..21cbcb822 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -1458,6 +1458,12 @@ minetest.get_content_id(name) -> integer
^ Gets the internal content ID of name
minetest.get_name_from_content_id(content_id) -> string
^ Gets the name of the content with that content ID
+minetest.parse_json(string[, nullvalue]) -> something
+^ Convert a string containing JSON data into the Lua equivalent
+^ nullvalue: returned in place of the JSON null; defaults to nil
+^ On success returns a table, a string, a number, a boolean or nullvalue
+^ On failure outputs an error message and returns nil
+^ Example: parse_json("[10, {\"a\":false}]") -> {[1] = 10, [2] = {a = false}}
minetest.serialize(table) -> string
^ Convert a table containing tables, strings, numbers, booleans and nils
into string form readable by minetest.deserialize
diff --git a/doc/menu_lua_api.txt b/doc/menu_lua_api.txt
index 014e689dc..d4bc093b0 100644
--- a/doc/menu_lua_api.txt
+++ b/doc/menu_lua_api.txt
@@ -174,6 +174,8 @@ engine.gettext(string) -> string
fgettext(string, ...) -> string
^ call engine.gettext(string), replace "$1"..."$9" with the given
^ extra arguments, call engine.formspec_escape and return the result
+engine.parse_json(string[, nullvalue]) -> something
+^ see minetest.parse_json (lua_api.txt)
dump(obj, dumped={})
^ Return object serialized as a string
string:split(separator)