/home/nightmare/Документы/lua-stock/Модули/Строка.moon:168: internal LDoc error
/usr/share/lua/5.4/ldoc/doc.lua:411: argument 1 expected a 'string', got a 'nil'
stack traceback:
[C]: in function 'error'
/usr/share/lua/5.4/pl/utils.lua:291: in function 'pl.utils.assert_arg'
(...tail calls...)
/usr/share/lua/5.4/pl/utils.lua:703: in function 'pl.utils.split'
/usr/share/lua/5.4/ldoc/doc.lua:411: in method 'finish'
/usr/share/lua/5.4/ldoc/parse.lua:470: in function </usr/share/lua/5.4/ldoc/parse.lua:470>
[C]: in function 'xpcall'
/usr/share/lua/5.4/ldoc/parse.lua:470: in function 'ldoc.parse.file'
/usr/lib/luarocks/rocks-5.4/ldoc/1.5.0-1/bin/ldoc:470: in upvalue 'process_file'
/usr/lib/luarocks/rocks-5.4/ldoc/1.5.0-1/bin/ldoc:526: in local 'process_all_files'
/usr/lib/luarocks/rocks-5.4/ldoc/1.5.0-1/bin/ldoc:533: in main chunk
[C]: in ?
~/Документы/lua-stock master !7 ?1
--- Строка
--@module string
import package from _G
import require from _G
import concat from table
import cuti from table
import dofile from _G["lua-stock"]
import tostring from _G
import submodule from dofile "Функции/ФункцияСвязыванияМодулей.moon"
module "string"
--- Функции
--@section Функции
--- Функция разбиения строки на составляющие элементы.
--@tparam string what
--@tparam string delimeter
--@function explode
export explode = dofile("Функции/ФункцияВозвращенияНаиболееБыстройФункцииСОдинаковымиПараметрами.moon") {
dofile("Функции/Строка/ФункцияРазбиенияСтроки.lua"),
dofile "Функции/Строка/ФункцияРазбиенияСтрокиР2.moon"
}, "hello/world/this/interesting/idea/to/hardtest/this/functions/toi/make/more/faster/result", "/"
--- Функции путей.
--@section Функции путей.
--- Подфункции работы с путями.
--@table path
export path = {}
--- Разделитель пути в системе.
--@string path.dirsep
path.dirsep = dofile("Функции/ФункцияПолученияДелителяПутиВОперационнойСистеме.moon")!
--- Функция присоединения путей.
--@tparam varargs строки для слияния в путь.
--@function path.join
path.join = (...) -> path.norm concat({...}, path.dirsep)\gsub "[#{path.dirsep}]+", path.dirsep
--- Функция нормализации пути, приведеление любых слешей в слеши системы.
--@tparam string path
--@function path.norm
path.norm = (_path) -> _path\gsub '[/|\\]', path.dirsep
--- Функция разбиения пути на составляющие сегменты.
--@tparam string _path Путь.
--@treturn table сегменты.
--@function path.split
path.split = (_path, r = {}) -> [s for s in path.norm(_path)\gmatch "([^#{path.dirsep}]+)"]
--- Вырезать сегменты пути.
--@tparam string _path Путь.
--@tparam number s Начало
--@tparam[opt] number e Конец, -1.
--@function path.cuti
path.cuti = (_path, s = 1, e = -1) -> concat cuti(path.split(_path), s, e), path.dirsep
--- Получить название файла из пути.
--@tparam string path
--@treturn string filename
--@function path.filename
path.filename = (path) -> path\match ".*[/|\\](.*)"
--- Получить расширение файла из строки пути.
--@tparam string path Путь.
--@treturn string расширение.
--@function path.extension
path.extension = (path) -> path\match ".*(%..*)"
--- Проверить есть ли относительности в пути.
--@tparam string _path Путь
--@treturn boolean flag
--@function path.has_relatives
path.has_relatives = (_path) -> _path\find("#{path.dirsep}%.%.") and true
--- Функция свертки пути.
--@tparam string _path Путь.
--@treturn string результат.
--@function path.fold
--@usage
-- print(string.path.fold("hello/../world.test")) -- выведет 'world.test'
path.fold = (_path) ->
return _path if not path.has_relatives _path
while true
_path, u = _path\gsub "[^#{path.dirsep}]+#{path.dirsep}%.%.#{path.dirsep}?", ""
return _path if u == 0
--- Функции
--@section Функции
--- Функция преобразования строки в таблицу.
--@tparam table t
--@treturn string t
--@function totable
export totable = dofile "Функции/Строка/ФункцияПреобразованияСтрокиВТаблицу.moon"
--- Функция преобразования числа в читабельный вид с поразрядностью.
--@tparam number n
--@treturn string r
--@function readable
export readable = dofile "Функции/Строка/ФункцияПреобразованияЧислаВЧитаемыйВидБайты.moon"
--- Escape string for some purposes.
--@function escape
export escape = (str) -> str\gsub '"', '\"'
--- string to base64 encode.
-- Decode works through non standart @{base64} module.
--@tparam string str Operand
--@tparam[opt] boolean decode Set to true to decode base64 string.
--@treturn string encoded or decoded base64 string.
--@function base64
export base64 = dofile "Функции/Строка/ФункцияКодированияBase64.moon"
--- Функция получения уникальной ASCII строки произвольной длинны.
--@tparam number len default 16
--@tparam[opt] string accum
--@treturn string str
--@function unique
export unique = dofile "Функции/Строка/ФункцияГенерированияASCIIСтроки.moon"
--- Функция возвращения crc32 строки.
--@tparam string whyat
--@treturn number
--@function crc
export crc = dofile "Функции/Строка/ФункцияПодсчетаХэшаCRC32.moon"
--- Check is data is compressed.
--@tparam string str Compressed data.
--@treturn boolen compressed or not.
--@function is_compressed
export is_compressed = (str) -> str\sub(1, 1) == ']'
do
t = dofile "Функции/Строка/ФункцияКомпрессииДекомпрессииСтроки.moon"
--- Сжатие строки.
--@tparam string input
--@treturn string output
--@function compress
--- Расжатие строки.
--@tparam string input
--@treturn string output
--@function decompress
export compress, decompress = t.compress, t.decompress
--- Единожды разделить строку.
--@tparam string str Строка с разделителем.
--@tparam[opt] string del Разделитель
--@function split
export split = (str, del = '.') ->
p = str\find del
str\sub(1, p - 1), str\sub p + 1, -1