summaryrefslogtreecommitdiff
path: root/meta/template
diff options
context:
space:
mode:
Diffstat (limited to 'meta/template')
-rw-r--r--meta/template/basic.lua26
-rw-r--r--meta/template/bit.lua30
-rw-r--r--meta/template/bit32.lua12
-rw-r--r--meta/template/coroutine.lua13
-rw-r--r--meta/template/debug.lua30
-rw-r--r--meta/template/ffi.lua10
-rw-r--r--meta/template/io.lua15
-rw-r--r--meta/template/jit.lua1
-rw-r--r--meta/template/math.lua38
-rw-r--r--meta/template/os.lua6
-rw-r--r--meta/template/package.lua1
-rw-r--r--meta/template/string.lua25
-rw-r--r--meta/template/table.lua4
-rw-r--r--meta/template/utf8.lua8
14 files changed, 182 insertions, 37 deletions
diff --git a/meta/template/basic.lua b/meta/template/basic.lua
index 5665dc59..b26d3959 100644
--- a/meta/template/basic.lua
+++ b/meta/template/basic.lua
@@ -55,13 +55,15 @@ _G = {}
---@version 5.1
---#DES 'getfenv'
----@param f? function
+---@param f? async fun()
---@return table
+---@nodiscard
function getfenv(f) end
---#DES 'getmetatable'
---@param object any
---@return table metatable
+---@nodiscard
function getmetatable(object) end
---#DES 'ipairs'
@@ -83,6 +85,7 @@ function ipairs(t) end
---@param chunkname? string
---@return function
---@return string error_message
+---@nodiscard
function load(func, chunkname) end
---#else
---#DES 'load>5.2'
@@ -92,6 +95,7 @@ function load(func, chunkname) end
---@param env? table
---@return function
---@return string error_message
+---@nodiscard
function load(chunk, chunkname, mode, env) end
---#end
@@ -100,6 +104,7 @@ function load(chunk, chunkname, mode, env) end
---@param filename? string
---@return function
---@return string error_message
+---@nodiscard
function loadfile(filename) end
---#else
---#DES 'loadfile'
@@ -108,6 +113,7 @@ function loadfile(filename) end
---@param env? table
---@return function
---@return string error_message
+---@nodiscard
function loadfile(filename, mode, env) end
---#end
@@ -117,6 +123,7 @@ function loadfile(filename, mode, env) end
---@param chunkname? string
---@return function
---@return string error_message
+---@nodiscard
function loadstring(text, chunkname) end
---@version 5.1
@@ -130,6 +137,7 @@ function module(name, ...) end
---@param index? K
---@return K
---@return V
+---@nodiscard
function next(table, index) end
---#DES 'pairs'
@@ -140,7 +148,11 @@ function next(table, index) end
function pairs(t) end
---#DES 'pcall'
+---#if VERSION == 5.1 and not JIT then
---@param f function
+---#else
+---@param f async fun()
+---#end
---@param arg1? any
---@return boolean success
---@return any result
@@ -154,17 +166,20 @@ function print(...) end
---@param v1 any
---@param v2 any
---@return boolean
+---@nodiscard
function rawequal(v1, v2) end
---#DES 'rawget'
---@param table table
---@param index any
---@return any
+---@nodiscard
function rawget(table, index) end
---#DES 'rawlen'
---@param v table|string
---@return integer len
+---@nodiscard
function rawlen(v) end
---#DES 'rawset'
@@ -177,11 +192,12 @@ function rawset(table, index, value) end
---#DES 'select'
---@param index integer|'"#"'
---@return any
+---@nodiscard
function select(index, ...) end
---@version 5.1
---#DES 'setfenv'
----@param f function|integer
+---@param f async fun()|integer
---@param table table
---@return function
function setfenv(f, table) end
@@ -196,11 +212,13 @@ function setmetatable(table, metatable) end
---@param e string|number
---@param base? integer
---@return number?
+---@nodiscard
function tonumber(e, base) end
---#DES 'tostring'
---@param v any
---@return string
+---@nodiscard
function tostring(v) end
---@alias type
@@ -216,6 +234,7 @@ function tostring(v) end
---#DES 'type'
---@param v any
---@return type type
+---@nodiscard
function type(v) end
---#DES '_VERSION'
@@ -244,7 +263,7 @@ function warn(message, ...) end
function xpcall(f, err) end
---#else
---#DES 'xpcall>5.2'
----@param f function
+---@param f async fun()
---@param msgh function
---@param arg1? any
---@return boolean success
@@ -258,4 +277,5 @@ function xpcall(f, msgh, arg1, ...) end
---@param list table
---@param i? integer
---@param j? integer
+---@nodiscard
function unpack(list, i, j) end
diff --git a/meta/template/bit.lua b/meta/template/bit.lua
index d7cfd302..369c5f9d 100644
--- a/meta/template/bit.lua
+++ b/meta/template/bit.lua
@@ -7,62 +7,74 @@ bit = {}
---@param x integer
---@return integer y
+---@nodiscard
function bit.tobit(x) end
---@param x integer
---@param n? integer
---@return integer y
+---@nodiscard
function bit.tohex(x, n) end
---@param x integer
---@return integer y
+---@nodiscard
function bit.bnot(x) end
----@param x integer
----@param x2 integer
----@vararg integer
+---@param x integer
+---@param x2 integer
+---@param ... integer
---@return integer y
+---@nodiscard
function bit.bor(x, x2, ...) end
----@param x integer
----@param x2 integer
----@vararg integer
+---@param x integer
+---@param x2 integer
+---@param ... integer
---@return integer y
+---@nodiscard
function bit.band(x, x2, ...) end
----@param x integer
----@param x2 integer
----@vararg integer
+---@param x integer
+---@param x2 integer
+---@param ... integer
---@return integer y
+---@nodiscard
function bit.bxor(x, x2, ...) end
---@param x integer
---@param n integer
---@return integer y
+---@nodiscard
function bit.lshift(x, n) end
---@param x integer
---@param n integer
---@return integer y
+---@nodiscard
function bit.rshift(x, n) end
---@param x integer
---@param n integer
---@return integer y
+---@nodiscard
function bit.arshift(x, n) end
---@param x integer
---@param n integer
---@return integer y
+---@nodiscard
function bit.rol(x, n) end
---@param x integer
---@param n integer
---@return integer y
+---@nodiscard
function bit.ror(x, n) end
---@param x integer
---@return integer y
+---@nodiscard
function bit.bswap(x) end
return bit
diff --git a/meta/template/bit32.lua b/meta/template/bit32.lua
index 85bd04f1..bcb39c66 100644
--- a/meta/template/bit32.lua
+++ b/meta/template/bit32.lua
@@ -10,27 +10,33 @@ bit32 = {}
---@param x integer
---@param disp integer
---@return integer
+---@nodiscard
function bit32.arshift(x, disp) end
---#DES 'bit32.band'
---@return integer
+---@nodiscard
function bit32.band(...) end
---#DES 'bit32.bnot'
---@param x integer
---@return integer
+---@nodiscard
function bit32.bnot(x) end
---#DES 'bit32.bor'
---@return integer
+---@nodiscard
function bit32.bor(...) end
---#DES 'bit32.btest'
---@return boolean
+---@nodiscard
function bit32.btest(...) end
---#DES 'bit32.bxor'
---@return integer
+---@nodiscard
function bit32.bxor(...) end
---#DES 'bit32.extract'
@@ -38,6 +44,7 @@ function bit32.bxor(...) end
---@param field integer
---@param width? integer
---@return integer
+---@nodiscard
function bit32.extract(n, field, width) end
---#DES 'bit32.replace'
@@ -45,30 +52,35 @@ function bit32.extract(n, field, width) end
---@param v integer
---@param field integer
---@param width? integer
+---@nodiscard
function bit32.replace(n, v, field, width) end
---#DES 'bit32.lrotate'
---@param x integer
---@param distp integer
---@return integer
+---@nodiscard
function bit32.lrotate(x, distp) end
---#DES 'bit32.lshift'
---@param x integer
---@param distp integer
---@return integer
+---@nodiscard
function bit32.lshift(x, distp) end
---#DES 'bit32.rrotate'
---@param x integer
---@param distp integer
---@return integer
+---@nodiscard
function bit32.rrotate(x, distp) end
---#DES 'bit32.rshift'
---@param x integer
---@param distp integer
---@return integer
+---@nodiscard
function bit32.rshift(x, distp) end
return bit32
diff --git a/meta/template/coroutine.lua b/meta/template/coroutine.lua
index 804c84c6..0b07bf5c 100644
--- a/meta/template/coroutine.lua
+++ b/meta/template/coroutine.lua
@@ -5,18 +5,21 @@
coroutine = {}
---#DES 'coroutine.create'
----@param f function
+---@param f async fun()
---@return thread
+---@nodiscard
function coroutine.create(f) end
---#if VERSION >= 5.4 then
---#DES 'coroutine.isyieldable>5.4'
---@param co? thread
---@return boolean
+---@nodiscard
function coroutine.isyieldable(co) end
---#else
---#DES 'coroutine.isyieldable'
---@return boolean
+---@nodiscard
function coroutine.isyieldable() end
---#end
@@ -38,6 +41,7 @@ function coroutine.resume(co, val1, ...) end
---#DES 'coroutine.running'
---@return thread running
---@return boolean ismain
+---@nodiscard
function coroutine.running() end
---#DES 'coroutine.status'
@@ -47,14 +51,17 @@ function coroutine.running() end
---| '"suspended"' # ---#DESTAIL 'costatus.suspended'
---| '"normal"' # ---#DESTAIL 'costatus.normal'
---| '"dead"' # ---#DESTAIL 'costatus.dead'
+---@nodiscard
function coroutine.status(co) end
---#DES 'coroutine.wrap'
----@param f function
----@return fun(...):...
+---@param f async fun()
+---@return fun()
+---@nodiscard
function coroutine.wrap(f) end
---#DES 'coroutine.yield'
+---@async
---@return ...
function coroutine.yield(...) end
diff --git a/meta/template/debug.lua b/meta/template/debug.lua
index 2c72263f..c8b506f5 100644
--- a/meta/template/debug.lua
+++ b/meta/template/debug.lua
@@ -33,6 +33,7 @@ function debug.debug() end
---#DES 'debug.getfenv'
---@param o any
---@return table
+---@nodiscard
function debug.getfenv(o) end
---#DES 'debug.gethook'
@@ -40,6 +41,7 @@ function debug.getfenv(o) end
---@return function hook
---@return string mask
---@return integer count
+---@nodiscard
function debug.gethook(co) end
---@alias infowhat string
@@ -61,9 +63,10 @@ function debug.gethook(co) end
---#DES 'debug.getinfo'
---@overload fun(f: integer|function, what?: infowhat):debuginfo
---@param thread thread
----@param f integer|function
+---@param f integer|async fun()
---@param what? infowhat
---@return debuginfo
+---@nodiscard
function debug.getinfo(thread, f, what) end
---#if VERSION <= 5.1 and not JIT then
@@ -74,32 +77,37 @@ function debug.getinfo(thread, f, what) end
---@param index integer
---@return string name
---@return any value
+---@nodiscard
function debug.getlocal(thread, level, index) end
---#else
---#DES 'debug.getlocal>5.2'
----@overload fun(f: integer|function, index: integer):string, any
+---@overload fun(f: integer|async fun(), index: integer):string, any
---@param thread thread
----@param f integer|function
+---@param f integer|async fun()
---@param index integer
---@return string name
---@return any value
+---@nodiscard
function debug.getlocal(thread, f, index) end
---#end
---#DES 'debug.getmetatable'
---@param object any
---@return table metatable
+---@nodiscard
function debug.getmetatable(object) end
---#DES 'debug.getregistry'
---@return table
+---@nodiscard
function debug.getregistry() end
---#DES 'debug.getupvalue'
----@param f function
+---@param f async fun()
---@param up integer
---@return string name
---@return any value
+---@nodiscard
function debug.getupvalue(f, up) end
---#if VERSION >= 5.4 then
@@ -108,11 +116,13 @@ function debug.getupvalue(f, up) end
---@param n integer
---@return any
---@return boolean
+---@nodiscard
function debug.getuservalue(u, n) end
---#elseif VERSION >= 5.2 or JIT then
---#DES 'debug.getuservalue<5.3'
---@param u userdata
---@return any
+---@nodiscard
function debug.getuservalue(u) end
---#end
@@ -138,7 +148,7 @@ function debug.setfenv(object, env) end
---#DES 'debug.sethook'
---@overload fun(hook: function, mask: hookmask, count?: integer)
---@param thread thread
----@param hook function
+---@param hook async fun()
---@param mask hookmask
---@param count? integer
function debug.sethook(thread, hook, mask, count) end
@@ -160,7 +170,7 @@ function debug.setlocal(thread, level, index, value) end
function debug.setmetatable(value, meta) end
---#DES 'debug.setupvalue'
----@param f function
+---@param f async fun()
---@param up integer
---@param value any
---@return string name
@@ -187,20 +197,22 @@ function debug.setuservalue(udata, value) end
---@param message? any
---@param level? integer
---@return string message
+---@nodiscard
function debug.traceback(thread, message, level) end
---@version >5.2, JIT
---#DES 'debug.upvalueid'
----@param f function
+---@param f async fun()
---@param n integer
---@return lightuserdata id
+---@nodiscard
function debug.upvalueid(f, n) end
---@version >5.2, JIT
---#DES 'debug.upvaluejoin'
----@param f1 function
+---@param f1 async fun()
---@param n1 integer
----@param f2 function
+---@param f2 async fun()
---@param n2 integer
function debug.upvaluejoin(f1, n1, f2, n2) end
diff --git a/meta/template/ffi.lua b/meta/template/ffi.lua
index 97dd4bc2..833232d4 100644
--- a/meta/template/ffi.lua
+++ b/meta/template/ffi.lua
@@ -26,21 +26,24 @@ function ffi.cdef(def) end
---@param name string
---@param global? boolean
---@return ffi.namespace* clib
+---@nodiscard
function ffi.load(name, global) end
---@param ct ffi.ct*
---@param nelem? integer
---@param init? any
---@return ffi.cdata* cdata
+---@nodiscard
function ffi.new(ct, nelem, init, ...) end
---@param nelem? integer
---@param init? any
---@return ffi.cdata* cdata
-function ctype(nelem, init, ...) end
+function ffi.ctype(nelem, init, ...) end
---@param ct ffi.ct*
---@return ffi.ctype* ctype
+---@nodiscard
function ffi.typeof(ct) end
---@param ct ffi.ct*
@@ -61,10 +64,12 @@ function ffi.gc(cdata, finalizer) end
---@param ct ffi.ct*
---@param nelem? integer
---@return integer|nil size
+---@nodiscard
function ffi.sizeof(ct, nelem) end
---@param ct ffi.ct*
---@return integer align
+---@nodiscard
function ffi.alignof(ct) end
---@param ct ffi.ct*
@@ -72,15 +77,18 @@ function ffi.alignof(ct) end
---@return integer ofs
---@return integer? bpos
---@return integer? bsize
+---@nodiscard
function ffi.offsetof(ct, field) end
---@param ct ffi.ct*
---@param obj any
---@return boolean status
+---@nodiscard
function ffi.istype(ct, obj) end
---@param newerr? integer
---@return integer err
+---@nodiscard
function ffi.errno(newerr) end
---@param ptr any
diff --git a/meta/template/io.lua b/meta/template/io.lua
index d31027af..b2846878 100644
--- a/meta/template/io.lua
+++ b/meta/template/io.lua
@@ -41,7 +41,7 @@ function io.input(file) end
---#DES 'io.lines'
---@param filename string?
----@vararg readmode
+---@param ... readmode
---@return fun():string|number
function io.lines(filename, ...) end
@@ -50,6 +50,7 @@ function io.lines(filename, ...) end
---@param mode openmode
---@return file*?
---@return string? errmsg
+---@nodiscard
function io.open(filename, mode) end
---#DES 'io.output'
@@ -69,13 +70,15 @@ function io.output(file) end
function io.popen(prog, mode) end
---#DES 'io.read'
----@vararg readmode
+---@param ... readmode
---@return string|number
---@return ...
+---@nodiscard
function io.read(...) end
---#DES 'io.tmpfile'
---@return file*
+---@nodiscard
function io.tmpfile() end
---@alias filetype
@@ -86,6 +89,7 @@ function io.tmpfile() end
---#DES 'io.type'
---@param file file*
---@return filetype
+---@nodiscard
function io.type(file) end
---#DES 'io.write'
@@ -124,13 +128,14 @@ function file:close() end
function file:flush() end
---#DES 'file:lines'
----@vararg readmode
+---@param ... readmode
---@return fun():string|number
function file:lines(...) end
---#DES 'file:read'
----@vararg readmode
+---@param ... readmode
---@return string|number
+---@nodiscard
function file:read(...) end
---@alias seekwhence
@@ -156,7 +161,7 @@ function file:seek(whence, offset) end
function file:setvbuf(mode, size) end
---#DES 'file:write'
----@vararg string|number
+---@param ... string|number
---@return file*?
---@return string? errmsg
function file:write(...) end
diff --git a/meta/template/jit.lua b/meta/template/jit.lua
index f5571cb7..6397505e 100644
--- a/meta/template/jit.lua
+++ b/meta/template/jit.lua
@@ -27,6 +27,7 @@ function jit.flush(func, recursive) end
---@return boolean status
---@return ...
+---@nodiscard
function jit.status() end
return jit
diff --git a/meta/template/math.lua b/meta/template/math.lua
index e415bae6..09c75cc6 100644
--- a/meta/template/math.lua
+++ b/meta/template/math.lua
@@ -17,28 +17,33 @@ math = {}
---#DES 'math.abs'
---@param x number
---@return number
+---@nodiscard
function math.abs(x) end
---#DES 'math.acos'
---@param x number
---@return number
+---@nodiscard
function math.acos(x) end
---#DES 'math.asin'
---@param x number
---@return number
+---@nodiscard
function math.asin(x) end
---#if VERSION <= 5.2 then
---#DES 'math.atan<5.2'
---@param y number
---@return number
+---@nodiscard
function math.atan(y) end
---#else
---#DES 'math.atan>5.3'
---@param y number
---@param x? number
---@return number
+---@nodiscard
function math.atan(y, x) end
---#end
@@ -47,42 +52,50 @@ function math.atan(y, x) end
---@param y number
---@param x number
---@return number
+---@nodiscard
function math.atan2(y, x) end
---#DES 'math.ceil'
---@param x number
---@return integer
+---@nodiscard
function math.ceil(x) end
---#DES 'math.cos'
---@param x number
+---@nodiscard
function math.cos(x) end
---@version <5.2
---#DES 'math.cosh'
---@param x number
---@return number
+---@nodiscard
function math.cosh(x) end
---#DES 'math.deg'
---@param x number
---@return number
+---@nodiscard
function math.deg(x) end
---#DES 'math.exp'
---@param x number
---@return number
+---@nodiscard
function math.exp(x) end
---#DES 'math.floor'
---@param x number
---@return number
+---@nodiscard
function math.floor(x) end
---#DES 'math.fmod'
---@param x number
---@param y number
---@return number
+---@nodiscard
function math.fmod(x, y) end
---@version <5.2
@@ -90,6 +103,7 @@ function math.fmod(x, y) end
---@param x number
---@return number m
---@return number e
+---@nodiscard
function math.frexp(x) end
---@version <5.2
@@ -97,18 +111,21 @@ function math.frexp(x) end
---@param m number
---@param e number
---@return number
+---@nodiscard
function math.ldexp(m, e) end
---#if VERSION <= 5.1 and not JIT then
---#DES 'math.log<5.1'
---@param x number
---@return number
+---@nodiscard
function math.log(x) end
---#else
---#DES 'math.log>5.2'
---@param x number
---@param base? integer
---@return number
+---@nodiscard
function math.log(x, base) end
---#end
@@ -116,24 +133,28 @@ function math.log(x, base) end
---#DES 'math.log10'
---@param x number
---@return number
+---@nodiscard
function math.log10(x) end
---#DES 'math.max'
---@param x number
----@vararg number
+---@param ... number
---@return number
+---@nodiscard
function math.max(x, ...) end
---#DES 'math.min'
---@param x number
----@vararg number
+---@param ... number
---@return number
+---@nodiscard
function math.min(x, ...) end
---#DES 'math.modf'
---@param x number
---@return integer
---@return number
+---@nodiscard
function math.modf(x) end
---@version <5.2
@@ -141,11 +162,13 @@ function math.modf(x) end
---@param x number
---@param y number
---@return number
+---@nodiscard
function math.pow(x, y) end
---#DES 'math.rad'
---@param x number
---@return number
+---@nodiscard
function math.rad(x) end
---#DES 'math.random'
@@ -154,50 +177,59 @@ function math.rad(x) end
---@param m integer
---@param n integer
---@return integer
+---@nodiscard
function math.random(m, n) end
---#if VERSION >= 5.4 then
---#DES 'math.randomseed>5.4'
---@param x? integer
---@param y? integer
+---@nodiscard
function math.randomseed(x, y) end
---#else
---#DES 'math.randomseed<5.3'
---@param x integer
+---@nodiscard
function math.randomseed(x) end
---#end
---#DES 'math.sin'
---@param x number
---@return number
+---@nodiscard
function math.sin(x) end
---@version <5.2
---#DES 'math.sinh'
---@param x number
---@return number
+---@nodiscard
function math.sinh(x) end
---#DES 'math.sqrt'
---@param x number
---@return number
+---@nodiscard
function math.sqrt(x) end
---#DES 'math.tan'
---@param x number
---@return number
+---@nodiscard
function math.tan(x) end
---@version <5.2
---#DES 'math.tanh'
---@param x number
---@return number
+---@nodiscard
function math.tanh(x) end
---@version >5.3
---#DES 'math.tointeger'
---@param x number
---@return integer?
+---@nodiscard
function math.tointeger(x) end
---#DES 'math.type'
@@ -206,12 +238,14 @@ function math.tointeger(x) end
---| '"integer"'
---| '"float"'
---| 'nil'
+---@nodiscard
function math.type(x) end
---#DES 'math.ult'
---@param m integer
---@param n integer
---@return boolean
+---@nodiscard
function math.ult(m, n) end
return math
diff --git a/meta/template/os.lua b/meta/template/os.lua
index 4347076c..af9b3278 100644
--- a/meta/template/os.lua
+++ b/meta/template/os.lua
@@ -6,6 +6,7 @@ os = {}
---#DES 'os.clock'
---@return number
+---@nodiscard
function os.clock() end
---@class osdate
@@ -32,12 +33,14 @@ function os.clock() end
---@param format? string
---@param time? integer
---@return string|osdate
+---@nodiscard
function os.date(format, time) end
---#DES 'os.difftime'
---@param t2 integer
---@param t1 integer
---@return integer
+---@nodiscard
function os.difftime(t2, t1) end
---#DES 'os.execute'
@@ -67,6 +70,7 @@ function os.exit(code, close) end
---#DES 'os.getenv'
---@param varname string
---@return string
+---@nodiscard
function os.getenv(varname) end
---#DES 'os.remove'
@@ -99,10 +103,12 @@ function os.setlocale(locale, category) end
---#DES 'os.time'
---@param date? osdate
---@return integer
+---@nodiscard
function os.time(date) end
---#DES 'os.tmpname'
---@return string
+---@nodiscard
function os.tmpname() end
return os
diff --git a/meta/template/package.lua b/meta/template/package.lua
index 0b2c8c1b..5c08bbef 100644
--- a/meta/template/package.lua
+++ b/meta/template/package.lua
@@ -55,6 +55,7 @@ package.searchers = {}
---@param rep? string
---@return string? filename
---@return string? errmsg
+---@nodiscard
function package.searchpath(name, path, sep, rep) end
---#DES 'package.seeall'
diff --git a/meta/template/string.lua b/meta/template/string.lua
index c06570e8..d3b4c431 100644
--- a/meta/template/string.lua
+++ b/meta/template/string.lua
@@ -10,19 +10,22 @@ string = {}
---@param j? integer
---@return integer
---@return ...
+---@nodiscard
function string.byte(s, i, j) end
---#DES 'string.char'
---@param byte integer
----@vararg integer
+---@param ... integer
---@return string
---@return ...
+---@nodiscard
function string.char(byte, ...) end
---#DES 'string.dump'
----@param f function
+---@param f async fun()
---@param strip? boolean
---@return string
+---@nodiscard
function string.dump(f, strip) end
---#DES 'string.find'
@@ -33,12 +36,14 @@ function string.dump(f, strip) end
---@return integer start
---@return integer end
---@return ... captured
+---@nodiscard
function string.find(s, pattern, init, plain) end
---#DES 'string.format'
---@param s string
----@vararg string
+---@param ... string
---@return string
+---@nodiscard
function string.format(s, ...) end
---#DES 'string.gmatch'
@@ -62,16 +67,19 @@ function string.gmatch(s, pattern, init) end
---@param n integer
---@return string
---@return integer count
+---@nodiscard
function string.gsub(s, pattern, repl, n) end
---#DES 'string.len'
---@param s string
---@return integer
+---@nodiscard
function string.len(s) end
---#DES 'string.lower'
---@param s string
---@return string
+---@nodiscard
function string.lower(s) end
---#DES 'string.match'
@@ -79,6 +87,7 @@ function string.lower(s) end
---@param pattern string
---@param init? integer
---@return string | number captured
+---@nodiscard
function string.match(s, pattern, init) end
---@version >5.3
@@ -86,14 +95,16 @@ function string.match(s, pattern, init) end
---@param fmt string
---@param v1 string
---@param v2? string
----@vararg string
+---@param ... string
---@return string binary
+---@nodiscard
function string.pack(fmt, v1, v2, ...) end
---@version >5.3
---#DES 'string.packsize'
---@param fmt string
---@return integer
+---@nodiscard
function string.packsize(fmt) end
---#if VERSION <= 5.1 and not JIT then
@@ -101,6 +112,7 @@ function string.packsize(fmt) end
---@param s string
---@param n integer
---@return string
+---@nodiscard
function string.rep(s, n) end
---#else
---#DES 'string.rep>5.2'
@@ -108,12 +120,14 @@ function string.rep(s, n) end
---@param n integer
---@param sep? string
---@return string
+---@nodiscard
function string.rep(s, n, sep) end
---#end
---#DES 'string.reverse'
---@param s string
---@return string
+---@nodiscard
function string.reverse(s) end
---#DES 'string.sub'
@@ -121,6 +135,7 @@ function string.reverse(s) end
---@param i integer
---@param j? integer
---@return string
+---@nodiscard
function string.sub(s, i, j) end
---@version >5.3
@@ -130,11 +145,13 @@ function string.sub(s, i, j) end
---@param pos? integer
---@return ...
---@return integer offset
+---@nodiscard
function string.unpack(fmt, s, pos) end
---#DES 'string.upper'
---@param s string
---@return string
+---@nodiscard
function string.upper(s) end
return string
diff --git a/meta/template/table.lua b/meta/template/table.lua
index 12d69c43..c55c3160 100644
--- a/meta/template/table.lua
+++ b/meta/template/table.lua
@@ -10,6 +10,7 @@ table = {}
---@param i? integer
---@param j? integer
---@return string
+---@nodiscard
function table.concat(list, sep, i, j) end
---#DES 'table.insert'
@@ -23,6 +24,7 @@ function table.insert(list, pos, value) end
---#DES 'table.maxn'
---@param table table
---@return integer
+---@nodiscard
function table.maxn(table) end
---@version >5.3
@@ -38,6 +40,7 @@ function table.move(a1, f, e, t, a2) end
---@version >5.2, JIT
---#DES 'table.pack'
---@return table
+---@nodiscard
function table.pack(...) end
---#DES 'table.remove'
@@ -56,6 +59,7 @@ function table.sort(list, comp) end
---@param list table
---@param i? integer
---@param j? integer
+---@nodiscard
function table.unpack(list, i, j) end
return table
diff --git a/meta/template/utf8.lua b/meta/template/utf8.lua
index 43ce9961..bd474710 100644
--- a/meta/template/utf8.lua
+++ b/meta/template/utf8.lua
@@ -10,8 +10,9 @@ utf8 = {}
---#DES 'utf8.char'
---@param code integer
----@vararg integer
+---@param ... integer
---@return string
+---@nodiscard
function utf8.char(code, ...) end
---#DES 'utf8.codes'
@@ -33,6 +34,7 @@ function utf8.codes(s, lax) end
---@param j? integer
---@return integer code
---@return ...
+---@nodiscard
function utf8.codepoint(s, i, j) end
---#else
---@param s string
@@ -41,6 +43,7 @@ function utf8.codepoint(s, i, j) end
---@param lax? boolean
---@return integer code
---@return ...
+---@nodiscard
function utf8.codepoint(s, i, j, lax) end
---#end
@@ -51,6 +54,7 @@ function utf8.codepoint(s, i, j, lax) end
---@param j? integer
---@return integer?
---@return integer? errpos
+---@nodiscard
function utf8.len(s, i, j) end
---#else
---@param s string
@@ -59,6 +63,7 @@ function utf8.len(s, i, j) end
---@param lax? boolean
---@return integer?
---@return integer? errpos
+---@nodiscard
function utf8.len(s, i, j, lax) end
---#end
@@ -67,6 +72,7 @@ function utf8.len(s, i, j, lax) end
---@param n integer
---@param i integer
---@return integer p
+---@nodiscard
function utf8.offset(s, n, i) end
return utf8