summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-10-11 21:43:36 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-10-11 21:43:36 +0800
commit88d6cc00d61298565017f5e18be2960dfcc12e11 (patch)
tree53a3ee741d8f286dc7efdfb0e12db9f769bfebf0 /make
parentdd629473b828f44a6139f6779e225c1e1f39cdca (diff)
downloadlua-language-server-88d6cc00d61298565017f5e18be2960dfcc12e11.zip
revert bootstrap for now
Diffstat (limited to 'make')
-rw-r--r--make/bootstrap.lua37
1 files changed, 11 insertions, 26 deletions
diff --git a/make/bootstrap.lua b/make/bootstrap.lua
index cf908b67..77f1a4d0 100644
--- a/make/bootstrap.lua
+++ b/make/bootstrap.lua
@@ -1,39 +1,25 @@
-local main
local i = 1
-while arg[i] do
+while true do
if arg[i] == '-E' then
elseif arg[i] == '-e' then
i = i + 1
local expr = assert(arg[i], "'-e' needs argument")
assert(load(expr, "=(command line)"))()
- -- TODO
- return
- elseif not main and arg[i]:sub(1, 1) ~= '-' then
- main = i
+ else
+ break
end
+ i = i + 1
end
-if main then
- for i = -1, -999, -1 do
- if not arg[i] then
- for j = i + 1, -1 do
- arg[j - main + 1] = arg[j]
- end
- break
- end
- end
- for j = 1, #arg do
- arg[j - main] = arg[j]
- end
- for j = #arg - main + 1, #arg do
- arg[j] = nil
- end
-else
- arg[0] = 'main.lua'
+if arg[i] == nil then
+ return
end
-for k, v in pairs(arg) do
- print(k, v)
+for j = -1, #arg do
+ arg[j - i] = arg[j]
+end
+for j = #arg - i + 1, #arg do
+ arg[j] = nil
end
local root; do
@@ -52,5 +38,4 @@ package.path = table.concat({
root .. "/script/?.lua",
root .. "/script/?/init.lua",
}, ";")
-
assert(loadfile(arg[0]))(table.unpack(arg))