Compare commits

..

No commits in common. "a8f5717b566376a08d48f0b348a2008d0a2c32a0" and "a9c1cf9dda7238f197cdf61f95624b7b9a304061" have entirely different histories.

16 changed files with 20 additions and 30 deletions

2
.gitignore vendored
View File

@ -1,5 +1,5 @@
/*
!/luals/
!/addon/
!/build/
!/core/
!/mod/

View File

@ -1,6 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/LuaLS/LLS-Addons/main/schemas/addon_config.schema.json",
"name": "TAL",
"words": ["array%s*%{"],
"settings": {
"Lua.runtime.version" : "LuaJIT",

View File

@ -1,6 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/LuaLS/LLS-Addons/main/schemas/addon_info.schema.json",
"name": "TAL",
"description": "Definitions for TAL 1312321313123213",
"hasPlugin": false
}

View File

@ -3,6 +3,7 @@
-- Written by Cosmin Apreutesei. Public Domain.
-- Reworked from the (in)famous coro lib
---@diagnostic disable: duplicate-set-field
local old_create = coroutine.create;
local old_close = coroutine.close;

View File

@ -50,21 +50,21 @@ return function (glob)
--- @param self string
function glob.string:quotesh()
return "'" .. self
:gsub("%*", "\\*")
:gsub("%?", "\\?")
:gsub("%~", "\\~")
:gsub("%$", "\\$")
:gsub("%&", "\\&")
:gsub("%|", "\\|")
:gsub("%;", "\\;")
:gsub("%<", "\\<")
:gsub("%>", "\\>")
:gsub("%(", "\\)")
:gsub("%[", "\\]")
:gsub("%{", "\\}")
:gsub("%%\\", "\\\\")
:gsub("%\'", "\\\'")
:gsub("%\"", "\\\"")
:gsub("%`", "\\`") .. "'";
:gsub("*", "\\*")
:gsub("?", "\\?")
:gsub("~", "\\~")
:gsub("$", "\\$")
:gsub("&", "\\&")
:gsub("|", "\\|")
:gsub(";", "\\;")
:gsub("<", "\\<")
:gsub(">", "\\>")
:gsub("(", "\\)")
:gsub("[", "\\]")
:gsub("{", "\\}")
:gsub("%\\", "\\\\")
:gsub("\'", "\\\'")
:gsub("\"", "\\\"")
:gsub("`", "\\`") .. "'";
end
end

View File

@ -16,12 +16,8 @@ function exports.pwd()
return os.getenv "PWD" or "./";
end
--- @param path string
function exports.ls(path)
local f = assert(io.popen("ls " .. path:quotesh()));
local res = f:read "*a";
f:close();
return res;
return os.execute("ls ")
end
return exports;

View File

@ -213,7 +213,7 @@ function exports.main(...)
elseif mod and type(mod.main) == "function" then
return mod.main(...);
end
end, unpack(args));
end, ...);
else
return exports.repl();
end