summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server-beta/src/parser/compile.lua5
-rw-r--r--server-beta/test.lua2
2 files changed, 5 insertions, 2 deletions
diff --git a/server-beta/src/parser/compile.lua b/server-beta/src/parser/compile.lua
index 2fdab43d..48cebcad 100644
--- a/server-beta/src/parser/compile.lua
+++ b/server-beta/src/parser/compile.lua
@@ -453,7 +453,10 @@ local function compileGoTo(obj)
}
return
end
- label.ref = obj
+ if not label.ref then
+ label.ref = {}
+ end
+ label.ref[#label.ref+1] = obj
-- 如果有局部变量在 goto 与 label 之间声明,
-- 并在 label 之后使用,则算作语法错误
diff --git a/server-beta/test.lua b/server-beta/test.lua
index ad282687..ffe9402d 100644
--- a/server-beta/test.lua
+++ b/server-beta/test.lua
@@ -36,9 +36,9 @@ local function main()
print(('测试[%s]用时[%.3f]'):format(name, os.clock() - clock))
end
+ test 'references'
test 'definition'
test 'diagnostics'
- test 'references'
--test 'highlight'
--test 'rename'
--test 'type_inference'