EmmyLua -> LuaLS
This commit is contained in:
27
.emmyrc.json
27
.emmyrc.json
@@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"completion": {
|
|
||||||
"enable": true,
|
|
||||||
"autoRequire": false,
|
|
||||||
"callSnippet": false,
|
|
||||||
"postfix": "@"
|
|
||||||
},
|
|
||||||
"diagnostics": {
|
|
||||||
"globals": [
|
|
||||||
"core",
|
|
||||||
"table",
|
|
||||||
"Ensure",
|
|
||||||
"string",
|
|
||||||
"string_utf8"
|
|
||||||
],
|
|
||||||
"disable": [
|
|
||||||
"param-type-not-match"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"version": "Lua5.1",
|
|
||||||
"requireLikeFunction": [],
|
|
||||||
"frameworkVersions": [],
|
|
||||||
"extensions": [],
|
|
||||||
"requirePattern": []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
BSD 3-Clause License
|
BSD 3-Clause License
|
||||||
|
|
||||||
Copyright (c) 2006-2007, Kyle Smith
|
Copyright (c) 2006-2007, Kyle Smith
|
||||||
|
Copyright (c) 2025-2026, Van (varttist), Apancore.Studio
|
||||||
|
|
||||||
Contributors:
|
Contributors:
|
||||||
Alimov Stepan, Van (Apancore.Studio)
|
Alimov Stepan, Van (varttist)
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
[](https://github.com/lord-server/lord?tab=readme-ov-file#contributors--%D1%83%D1%87%D0%B0%D1%81%D1%82%D0%BD%D0%B8%D0%BA%D0%B8)
|
||||||
|
|
||||||
# UTF8 API
|
# UTF8 API
|
||||||
|
|
||||||
Mod for luanti to support Unicode strings.
|
Mod for luanti to support Unicode strings.
|
||||||
|
|||||||
9
init.lua
9
init.lua
@@ -188,7 +188,7 @@ local shift_18 = 262144 -- 2^18
|
|||||||
---@param str string The input string containing UTF-8 encoded characters.
|
---@param str string The input string containing UTF-8 encoded characters.
|
||||||
---@param ibs integer The starting byte position in the string (inclusive).
|
---@param ibs integer The starting byte position in the string (inclusive).
|
||||||
---@param jbs integer The ending byte position in the string (inclusive).
|
---@param jbs integer The ending byte position in the string (inclusive).
|
||||||
---@return integer...
|
---@return integer?, integer?
|
||||||
function string_utf8.unicode(str, ibs, jbs)
|
function string_utf8.unicode(str, ibs, jbs)
|
||||||
ensureArgType(str, "string", 1, "string_utf8.unicode")
|
ensureArgType(str, "string", 1, "string_utf8.unicode")
|
||||||
ensureArgType(ibs, "number", 2, "string_utf8.unicode")
|
ensureArgType(ibs, "number", 2, "string_utf8.unicode")
|
||||||
@@ -253,7 +253,7 @@ end
|
|||||||
---@param j integer The ending character index (default: i). Negative values count from the end.
|
---@param j integer The ending character index (default: i). Negative values count from the end.
|
||||||
---@overload fun(str: string)
|
---@overload fun(str: string)
|
||||||
---@overload fun(str: string, i: number)
|
---@overload fun(str: string, i: number)
|
||||||
---@return integer...
|
---@return integer?, integer?
|
||||||
function string_utf8.byte(str, i, j)
|
function string_utf8.byte(str, i, j)
|
||||||
ensureArgType(str, "string", 1, "string_utf8.byte")
|
ensureArgType(str, "string", 1, "string_utf8.byte")
|
||||||
ensureArgType(i, "number", 2, "string_utf8.byte")
|
ensureArgType(i, "number", 2, "string_utf8.byte")
|
||||||
@@ -299,7 +299,7 @@ end
|
|||||||
---Creates an iterator to generate UTF-8 substrings of a specified length.
|
---Creates an iterator to generate UTF-8 substrings of a specified length.
|
||||||
---@param str string The input UTF-8 encoded string.
|
---@param str string The input UTF-8 encoded string.
|
||||||
---@param sub_len integer? The length of each substring in characters (default: 1).
|
---@param sub_len integer? The length of each substring in characters (default: 1).
|
||||||
---@return fun(skip_ptr: table | nil, bs: integer | nil)
|
---@return fun(skip_ptr: table | nil, bs: integer | nil):(integer?, string?, integer?)
|
||||||
function string_utf8.gensub(str, sub_len)
|
function string_utf8.gensub(str, sub_len)
|
||||||
sub_len = sub_len or 1
|
sub_len = sub_len or 1
|
||||||
|
|
||||||
@@ -312,6 +312,7 @@ function string_utf8.gensub(str, sub_len)
|
|||||||
|
|
||||||
---@param skip_ptr table
|
---@param skip_ptr table
|
||||||
---@param bs integer
|
---@param bs integer
|
||||||
|
---@return integer?, string?, integer?
|
||||||
return function(skip_ptr, bs)
|
return function(skip_ptr, bs)
|
||||||
bs = (bs and bs or 1) + (skip_ptr and (skip_ptr[1] or 0) or 0)
|
bs = (bs and bs or 1) + (skip_ptr and (skip_ptr[1] or 0) or 0)
|
||||||
|
|
||||||
@@ -457,7 +458,7 @@ end
|
|||||||
|
|
||||||
---Creates an iterator to traverse UTF-8 encoded characters in a string.
|
---Creates an iterator to traverse UTF-8 encoded characters in a string.
|
||||||
---@param str string The input UTF-8 encoded string.
|
---@param str string The input UTF-8 encoded string.
|
||||||
---@return fun(skip_ptr: table|nil)
|
---@return fun(skip_ptr: table|nil):integer?, integer?, integer?
|
||||||
function string_utf8.codes(str)
|
function string_utf8.codes(str)
|
||||||
|
|
||||||
ensureArgType(str, "string", 1, "string_utf8.codes")
|
ensureArgType(str, "string", 1, "string_utf8.codes")
|
||||||
|
|||||||
Reference in New Issue
Block a user