- Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathutil.lua
More file actions
Latest commit
64 lines (55 loc) · 1.21 KB
/
Copy pathutil.lua
File metadata and controls
64 lines (55 loc) · 1.21 KB
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
returnfunction(utf8)
functionutf8.util.copy(obj, deep)
iftype(obj) =='table' then
localresult= {}
ifdeepthen
fork,vinpairs(obj) do
result[k] =utf8.util.copy(v, true)
end
else
fork,vinpairs(obj) do
result[k] =v
end
end
returnresult
else
returnobj
end
end
localfunctiondump(val, tab)
tab=tabor''
iftype(val) =='table' then
utf8.config.logger('{\n')
fork,vinpairs(val) do
utf8.config.logger(tab..tostring(k) .." = ")
dump(v, tab..'\t')
utf8.config.logger("\n")
end
utf8.config.logger(tab..'}\n')
else
utf8.config.logger(tostring(val))
end
end
functionutf8.util.debug(...)
localt= {...}
for_, vinipairs(t) do
iftype(v) =="table" andnot (getmetatable(v) or {}).__tostringthen
dump(v, '\t')
else
utf8.config.logger(tostring(v), "")
end
end
utf8.config.logger('\n')
end
functionutf8.debug(...)
ifutf8.config.debugthen
utf8.config.debug(...)
end
end
functionutf8.util.next(str, bs)
localnbs1=utf8.next(str, bs)
localnbs2=utf8.next(str, nbs1)
returnutf8.raw.sub(str, nbs1, nbs2-1), nbs1
end
returnutf8.util
end