summaryrefslogtreecommitdiff
path: root/meta/template/utf8.lua
blob: 43ce9961361ca89033ec7e81fd7c66c337a32d73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---#if VERSION <= 5.2 then DISABLE() end
---@meta

---@version >5.3
---#DES 'utf8'
---@class utf8lib
---#DES 'utf8.charpattern'
---@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
---@param lax? boolean
---@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
---@param lax? boolean
---@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
---@return integer p
function utf8.offset(s, n, i) end

return utf8