summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-07-07 11:43:08 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-07-07 11:43:08 +0800
commita2bb5a377517286b9c517af4be2b53a82c61f646 (patch)
tree6fe63aa38d562ed46692f2309a2d4f75731147e4
parentdc15ea90474e63c5203e9504f44aeea0b08db99e (diff)
downloadlua-language-server-a2bb5a377517286b9c517af4be2b53a82c61f646.zip
make type-check happy
-rw-r--r--script/file-uri.lua2
-rw-r--r--script/parser/compile.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/script/file-uri.lua b/script/file-uri.lua
index 8e9dd938..07791ca0 100644
--- a/script/file-uri.lua
+++ b/script/file-uri.lua
@@ -49,7 +49,7 @@ function m.encode(path)
--lower-case windows drive letters in /C:/fff or C:/fff
local start, finish, drive = path:find '/(%u):'
- if drive then
+ if drive and finish then
path = path:sub(1, start) .. drive:lower() .. path:sub(finish, -1)
end
diff --git a/script/parser/compile.lua b/script/parser/compile.lua
index 6542efbd..5321d9b8 100644
--- a/script/parser/compile.lua
+++ b/script/parser/compile.lua
@@ -470,7 +470,7 @@ end
local function parseLongString()
local start, finish, mark = sfind(Lua, '^(%[%=*%[)', Tokens[Index])
- if not mark then
+ if not start then
return nil
end
fastForwardToken(finish + 1)