summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-20 15:19:41 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-20 15:19:41 +0800
commit3d812e5a70d5f538175e9e7fc5be88acfa8a09bf (patch)
tree91673700d88fe78a45f737802e2c901033832815 /meta
parent5f2a425c2b46550276694db6dcbb28106c6541df (diff)
downloadlua-language-server-3d812e5a70d5f538175e9e7fc5be88acfa8a09bf.zip
finish meta locale in zh-CN
Diffstat (limited to 'meta')
-rw-r--r--meta/template/os.lua3
-rw-r--r--meta/template/package.lua19
-rw-r--r--meta/template/string.lua35
-rw-r--r--meta/template/table.lua13
-rw-r--r--meta/template/utf8.lua31
5 files changed, 97 insertions, 4 deletions
diff --git a/meta/template/os.lua b/meta/template/os.lua
index 1410d69f..2c12e1f6 100644
--- a/meta/template/os.lua
+++ b/meta/template/os.lua
@@ -20,13 +20,12 @@ function os.date(format, time) end
---@return integer
function os.difftime(t2, t1) end
+---#DES 'os.execute'
---#if VERSION <= 5.1 then
----#DES 'os.execute<5.1'
---@param command string
---@return integer code
function os.execute(command) end
---#else
----#DES 'os.execute>5.2'
---@param command string
---@return boolean? suc
---@return exitcode? exitcode
diff --git a/meta/template/package.lua b/meta/template/package.lua
index efe286af..d7c1d262 100644
--- a/meta/template/package.lua
+++ b/meta/template/package.lua
@@ -3,24 +3,37 @@
---#DES 'require'
---@param modname string
---@return any
+---#if VERSION >=5.4 then
---@return any loaderdata
+---#end
function require(modname) end
+---#DES 'package'
---@class package*
---@field conifg string
---@field cpath string
---@field loaded table
----@field loaders table
---@field path string
---@field preload table
----@field searchers table
+---#end
package = {}
+---@version <5.1
+---#DES 'package.loaders'
+package.loaders = {}
+
+---#DES 'package.loadlib'
---@param libname string
---@param funcname string
---@return any
function package.loadlib(libname, funcname) end
+---#DES 'package.searchers'
+---@version >5.2
+package.searchers = {}
+
+---#DES 'package.searchpath'
+---@version >5.2,JIT
---@param name string
---@param path string
---@param sep? string
@@ -29,6 +42,8 @@ function package.loadlib(libname, funcname) end
---@return string? errmsg
function package.searchpath(name, path, sep, rep) end
+---#DES 'package.seeall'
+---@version <5.1
---@param module table
function package.seeall(module) end
diff --git a/meta/template/string.lua b/meta/template/string.lua
index 0016c2c1..2a8021e3 100644
--- a/meta/template/string.lua
+++ b/meta/template/string.lua
@@ -1,8 +1,10 @@
---@meta
+---#DES 'string'
---@class string*
string = {}
+---#DES 'string.byte'
---@param s string
---@param i? integer
---@param j? integer
@@ -10,17 +12,20 @@ string = {}
---@return ...
function string.byte(s, i, j) end
+---#DES 'string.char'
---@param byte integer
---@vararg integer
---@return string
---@return ...
function string.char(byte, ...) end
+---#DES 'string.dump'
---@param f function
---@param strip? boolean
---@return string
function string.dump(f, strip) end
+---#DES 'string.find'
---@param s string
---@param pattern string
---@param init? integer
@@ -30,17 +35,27 @@ function string.dump(f, strip) end
---@return ... captured
function string.find(s, pattern, init, plain) end
+---#DES 'string.format'
---@param s string
---@vararg string
---@return string
function string.format(s, ...) end
+---#DES 'string.gmatch'
+---#if VERSION <= 5.3 then
+---@param s string
+---@param pattern string
+---@return fun():string, ...
+function string.gmatch(s, pattern) end
+---#else
---@param s string
---@param pattern string
---@param init? integer
---@return fun():string, ...
function string.gmatch(s, pattern, init) end
+---#end
+---#DES 'string.gsub'
---@param s string
---@param pattern string
---@param repl string|table|function
@@ -49,20 +64,25 @@ function string.gmatch(s, pattern, init) end
---@return integer count
function string.gsub(s, pattern, repl, n) end
+---#DES 'string.len'
---@param s string
---@return integer
function string.len(s) end
+---#DES 'string.lower'
---@param s string
---@return string
function string.lower(s) end
+---#DES 'string.match'
---@param s string
---@param pattern string
---@param init? integer
---@return string captured
function string.match(s, pattern, init) end
+---@version >5.3
+---#DES 'string.pack'
---@param fmt string
---@param v1 string
---@param v2? string
@@ -70,26 +90,40 @@ function string.match(s, pattern, init) end
---@return string binary
function string.pack(fmt, v1, v2, ...) end
+---@version >5.3
+---#DES 'string.packsize'
---@param fmt string
---@return integer
function string.packsize(fmt) end
+---#DES 'string.rep'
+---#if VERSION <= 5.1 then
+---@param s string
+---@param n integer
+---@return string
+function string.rep(s, n) end
+---#else
---@param s string
---@param n integer
---@param sep? string
---@return string
function string.rep(s, n, sep) end
+---#end
+---#DES 'string.reverse'
---@param s string
---@return string
function string.reverse(s) end
+---#DES 'string.sub'
---@param s string
---@param i integer
---@param j? integer
---@return string
function string.sub(s, i, j) end
+---@version >5.3
+---#DES 'string.unpack'
---@param fmt string
---@param s string
---@param pos? integer
@@ -97,6 +131,7 @@ function string.sub(s, i, j) end
---@return integer offset
function string.unpack(fmt, s, pos) end
+---#DES 'string.upper'
---@param s string
---@return string
function string.upper(s) end
diff --git a/meta/template/table.lua b/meta/template/table.lua
index 55e8f290..af8c8711 100644
--- a/meta/template/table.lua
+++ b/meta/template/table.lua
@@ -1,8 +1,10 @@
---@meta
+---#DES 'table'
---@class table*
table = {}
+---#DES 'table.concat'
---@param list table
---@param sep? string
---@param i? integer
@@ -10,16 +12,21 @@ table = {}
---@return string
function table.concat(list, sep, i, j) end
+---#DES 'table.insert'
---@overload fun(list: table, value: any)
---@param list table
---@param pos integer
---@param value any
function table.insert(list, pos, value) end
+---@version <5.1
+---#DES 'table.maxn'
---@param table table
---@return integer
function table.maxn(table) end
+---@version >5.3
+---#DES 'table.move'
---@param a1 table
---@param f integer
---@param e integer
@@ -28,18 +35,24 @@ function table.maxn(table) end
---@return table a2
function table.move(a1, f, e, t, a2) end
+---@version >5.2
+---#DES 'table.pack'
---@return table
function table.pack(...) end
+---#DES 'table.remove'
---@param list table
---@param pos? integer
---@return any
function table.remove(list, pos) end
+---#DES 'table.sort'
---@param list table
---@param comp fun(a: any, b: any):boolean
function table.sort(list, comp) end
+---@version >5.2
+---#DES 'table.unpack'
---@param list table
---@param i? integer
---@param j? integer
diff --git a/meta/template/utf8.lua b/meta/template/utf8.lua
index 687a6b46..f3619d68 100644
--- a/meta/template/utf8.lua
+++ b/meta/template/utf8.lua
@@ -1,19 +1,38 @@
---@meta
+---@version >5.3
+---#DES 'utf8'
---@class utf8*
---@field charpattern string
utf8 = {}
+---#DES 'utf8.char'
---@param code integer
---@vararg integer
---@return string
function utf8.char(code, ...) end
+---#DES 'utf8.codes'
+---#if VERSION <= 5.3 then
+---@param s string
+---@return fun():integer, integer
+function utf8.codes(s) end
+---#else
---@param s string
---@param lax? boolean
---@return fun():integer, integer
function utf8.codes(s, lax) end
+---#end
+---#DES 'utf8.codepoint'
+---#if VERSION <= 5.3 then
+---@param s string
+---@param i? integer
+---@param j? integer
+---@return integer code
+---@return ...
+function utf8.codepoint(s, i, j) end
+---#else
---@param s string
---@param i? integer
---@param j? integer
@@ -21,7 +40,17 @@ function utf8.codes(s, lax) end
---@return integer code
---@return ...
function utf8.codepoint(s, i, j, lax) end
+---#end
+---#DES 'utf8.len'
+---#if VERSION <= 5.3 then
+---@param s string
+---@param i? integer
+---@param j? integer
+---@return integer?
+---@return integer? errpos
+function utf8.len(s, i, j) end
+---#else
---@param s string
---@param i? integer
---@param j? integer
@@ -29,7 +58,9 @@ function utf8.codepoint(s, i, j, lax) end
---@return integer?
---@return integer? errpos
function utf8.len(s, i, j, lax) end
+---#end
+---#DES 'utf8.offset'
---@param s string
---@param n integer
---@param i integer