Compare commits
2 Commits
a9c1cf9dda
...
a8f5717b56
Author | SHA1 | Date | |
---|---|---|---|
a8f5717b56 | |||
5ed6f192b1 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,5 @@
|
||||
/*
|
||||
!/addon/
|
||||
!/luals/
|
||||
!/build/
|
||||
!/core/
|
||||
!/mod/
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/LuaLS/LLS-Addons/main/schemas/addon_config.schema.json",
|
||||
"name": "TAL",
|
||||
"words": ["array%s*%{"],
|
||||
"settings": {
|
||||
"Lua.runtime.version" : "LuaJIT",
|
6
luals/TAL/info.json
Normal file
6
luals/TAL/info.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/LuaLS/LLS-Addons/main/schemas/addon_info.schema.json",
|
||||
"name": "TAL",
|
||||
"description": "Definitions for TAL 1312321313123213",
|
||||
"hasPlugin": false
|
||||
}
|
@ -3,7 +3,6 @@
|
||||
-- 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;
|
||||
|
@ -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
|
||||
|
@ -16,8 +16,12 @@ function exports.pwd()
|
||||
return os.getenv "PWD" or "./";
|
||||
end
|
||||
|
||||
--- @param path string
|
||||
function exports.ls(path)
|
||||
return os.execute("ls ")
|
||||
local f = assert(io.popen("ls " .. path:quotesh()));
|
||||
local res = f:read "*a";
|
||||
f:close();
|
||||
return res;
|
||||
end
|
||||
|
||||
return exports;
|
||||
|
@ -213,7 +213,7 @@ function exports.main(...)
|
||||
elseif mod and type(mod.main) == "function" then
|
||||
return mod.main(...);
|
||||
end
|
||||
end, ...);
|
||||
end, unpack(args));
|
||||
else
|
||||
return exports.repl();
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user