summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/core/diagnostics.lua3
-rw-r--r--server/test/diagnostics/init.lua4
2 files changed, 3 insertions, 4 deletions
diff --git a/server/src/core/diagnostics.lua b/server/src/core/diagnostics.lua
index 9f46d724..5dfdd196 100644
--- a/server/src/core/diagnostics.lua
+++ b/server/src/core/diagnostics.lua
@@ -324,7 +324,7 @@ end
function mt:searchEmptyBlock(callback)
self.vm:eachSource(function (source)
- -- 认为空repeat是合法的
+ -- 认为空repeat与空while是合法的
-- 要去vm中激活source
if source.type == 'if' then
for _, block in ipairs(source) do
@@ -337,7 +337,6 @@ function mt:searchEmptyBlock(callback)
end
if source.type == 'loop'
or source.type == 'in'
- or source.type == 'while'
then
if #source == 0 then
callback(source.start, source.finish)
diff --git a/server/test/diagnostics/init.lua b/server/test/diagnostics/init.lua
index 4b762122..82fe51bd 100644
--- a/server/test/diagnostics/init.lua
+++ b/server/test/diagnostics/init.lua
@@ -292,8 +292,8 @@ end
]]
TEST [[
-<!while true do
-end!>
+while true do
+end
]]
TEST [[