summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-04-06 15:48:15 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-04-06 15:48:15 +0800
commiteaeea1b4d1da5d8596d07ecb76026e40c4cfd01e (patch)
tree541716fbaf5362e1ef8ae3987b93ac4e6bc3d5ca
parent80112a1e17c48fdb4b536d548ae6b826d9a8d611 (diff)
downloadlua-language-server-eaeea1b4d1da5d8596d07ecb76026e40c4cfd01e.zip
一些遗漏
-rw-r--r--server/libs/lua/coroutine.lni12
-rw-r--r--server/locale/en-US/libs/lua/coroutine.lni4
-rw-r--r--server/locale/zh-CN/libs/lua/coroutine.lni3
-rw-r--r--server/src/parser/ast.lua8
4 files changed, 27 insertions, 0 deletions
diff --git a/server/libs/lua/coroutine.lni b/server/libs/lua/coroutine.lni
index 51b717b9..be604cb8 100644
--- a/server/libs/lua/coroutine.lni
+++ b/server/libs/lua/coroutine.lni
@@ -31,6 +31,18 @@ type = 'thread'
[[.returns]]
type = 'boolean'
+[kill]
+version = 'Lua 5.4'
+[[.args]]
+name = 'co'
+type = 'thread'
+[[.returns]]
+name = 'noerror'
+type = 'boolean'
+`````````
+name = 'errorobject'
+type = 'any'
+
[resume]
[[.args]]
name = 'co'
diff --git a/server/locale/en-US/libs/lua/coroutine.lni b/server/locale/en-US/libs/lua/coroutine.lni
index 463288bc..ec06f21d 100644
--- a/server/locale/en-US/libs/lua/coroutine.lni
+++ b/server/locale/en-US/libs/lua/coroutine.lni
@@ -4,6 +4,10 @@ description = 'Creates a new coroutine.'
[isyieldable]
description = 'Returns true when the running coroutine can yield.'
+[kill]
+description = 'Kills coroutine `co` ,
+closing all its pending to-be-closed variables and putting the coroutine in a dead state.'
+
[resume]
description = 'Starts or continues the execution of coroutine `co`.'
diff --git a/server/locale/zh-CN/libs/lua/coroutine.lni b/server/locale/zh-CN/libs/lua/coroutine.lni
index e41b5e22..f2912c70 100644
--- a/server/locale/zh-CN/libs/lua/coroutine.lni
+++ b/server/locale/zh-CN/libs/lua/coroutine.lni
@@ -4,6 +4,9 @@ description = '创建一个主体函数为 `f` 的新协程。'
[isyieldable]
description = '如果正在运行的协程可以让出,则返回真。'
+[kill]
+description = '杀死协程 `co`,关闭它所有等待 *to-be-closed* 的变量,并将协程状态设为 `dead` 。'
+
[resume]
description = '开始或继续协程 `co` 的运行。'
diff --git a/server/src/parser/ast.lua b/server/src/parser/ast.lua
index a82e8d6e..6d401e44 100644
--- a/server/src/parser/ast.lua
+++ b/server/src/parser/ast.lua
@@ -295,6 +295,14 @@ local Defs = {
return string_char(tonumber(char, 16))
end,
CharUtf8 = function (pos, char)
+ if State.Version ~= 'Lua 5.3' and State.Version ~= 'Lua 5.4' then
+ pushError {
+ type = 'ERR_ESC',
+ start = pos-3,
+ finish = pos-2,
+ }
+ return char
+ end
if #char == 0 then
pushError {
type = 'UTF8_SMALL',