Compare commits

...

2 Commits

Author SHA1 Message Date
2ed51d670c EmmyLua -> LuaLS 2026-06-17 21:53:43 +03:00
00382fbe88 Fix lower function 2026-05-14 22:31:43 +03:00
5 changed files with 10 additions and 33 deletions

View File

@@ -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": []
}
}

View File

@@ -1,9 +1,10 @@
BSD 3-Clause License
Copyright (c) 2006-2007, Kyle Smith
Copyright (c) 2025-2026, Van (varttist), Apancore.Studio
Contributors:
Alimov Stepan, Van (Apancore.Studio)
Alimov Stepan, Van (varttist)
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View File

@@ -1,3 +1,5 @@
[![Maintained By: Apancore.Studio](https://img.shields.io/badge/Maintained%20By-Apancore.Studio-543c93?style=for-the-badge)](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
Mod for luanti to support Unicode strings.

View File

@@ -188,7 +188,7 @@ local shift_18 = 262144 -- 2^18
---@param str string The input string containing UTF-8 encoded characters.
---@param ibs integer The starting 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)
ensureArgType(str, "string", 1, "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.
---@overload fun(str: string)
---@overload fun(str: string, i: number)
---@return integer...
---@return integer?, integer?
function string_utf8.byte(str, i, j)
ensureArgType(str, "string", 1, "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.
---@param str string The input UTF-8 encoded string.
---@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)
sub_len = sub_len or 1
@@ -312,6 +312,7 @@ function string_utf8.gensub(str, sub_len)
---@param skip_ptr table
---@param bs integer
---@return integer?, string?, integer?
return function(skip_ptr, bs)
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.
---@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)
ensureArgType(str, "string", 1, "string_utf8.codes")

View File

@@ -933,7 +933,7 @@ string_utf8.lc_uc = {
}
string_utf8.utf8_uc_lc = {
string_utf8.uc_lc = {
["A"] = "a",
["B"] = "b",
["C"] = "c",