summaryrefslogtreecommitdiff
path: root/test/definition/function.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-11-19 21:14:44 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-11-19 21:14:44 +0800
commit15f76378dbe93a3cbff155c8e98f9bed59af75b0 (patch)
tree37d18868909bd3c9cbd96378af6343ee82ce92b3 /test/definition/function.lua
parent2712ffefa8275ad9039b6355846378e5f2019d38 (diff)
downloadlua-language-server-15f76378dbe93a3cbff155c8e98f9bed59af75b0.zip
全局变量在第一次赋值时定义
Diffstat (limited to 'test/definition/function.lua')
-rw-r--r--test/definition/function.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/definition/function.lua b/test/definition/function.lua
new file mode 100644
index 00000000..1ef6a463
--- /dev/null
+++ b/test/definition/function.lua
@@ -0,0 +1,24 @@
+
+TEST [[
+function <!x!> () end
+<?x?> = 1
+]]
+
+TEST [[
+local function <!x!> () end
+<?x?> = 1
+]]
+
+TEST [[
+local x
+local function <!x!> ()
+ <?x?> = 1
+end
+]]
+
+TEST [[
+local <!x!>
+function x()
+end
+<?x?> = 1
+]]