diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-13 10:57:15 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-13 10:57:15 +0800 |
commit | 27034b3d99b31be96865e50d70a776fb3caac088 (patch) | |
tree | 1d4f7252bd2dd8cf2f24e7b73e4ab885a76b9eb7 /meta/template/utf8.lua | |
parent | 4e52738f7a315085505ffdbefe9ce6722ec3965f (diff) | |
download | lua-language-server-27034b3d99b31be96865e50d70a776fb3caac088.zip |
暂存
Diffstat (limited to 'meta/template/utf8.lua')
-rw-r--r-- | meta/template/utf8.lua | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/template/utf8.lua b/meta/template/utf8.lua new file mode 100644 index 00000000..cc4deca8 --- /dev/null +++ b/meta/template/utf8.lua @@ -0,0 +1,36 @@ +---@class utf8 +utf8 = {} + +---@param code integer +---@vararg integer +---@return string +function utf8.char(code, ...) end + +utf8.charpattern = '[\0-\x7F\xC2-\xF4][\x80-\xBF]*' + +---@param s string +---@param lax boolean? +---@return fun():integer, integer +function utf8.codes(s, lax) end + +---@param s string +---@param i integer? +---@param j integer? +---@param lax boolean? +---@return integer code +---@return ... +function utf8.codepoint(s, i, j, lax) end + +---@param s string +---@param i integer? +---@param j integer? +---@param lax boolean? +---@return integer? +---@return integer errpos? +function utf8.len(s, i, j, lax) end + +---@param s string +---@param n integer +---@param i integer +---@return integer p +function utf8.offset(s, n, i) end |