summaryrefslogtreecommitdiff
path: root/script/parser/ast.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-02-18 20:51:23 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-02-18 20:51:23 +0800
commitf255f926c36b22b43dd7f3f49c57c491bfbb3f94 (patch)
treeb69def1799c95bb4dc2fa48f9dbe538806e65774 /script/parser/ast.lua
parentba3521309f78ba90857a2dcf105372cdcfa1883e (diff)
downloadlua-language-server-f255f926c36b22b43dd7f3f49c57c491bfbb3f94.zip
missed syntax error `f() = 1`
Diffstat (limited to 'script/parser/ast.lua')
-rw-r--r--script/parser/ast.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/script/parser/ast.lua b/script/parser/ast.lua
index 605555df..5757091e 100644
--- a/script/parser/ast.lua
+++ b/script/parser/ast.lua
@@ -1179,7 +1179,7 @@ local Defs = {
end
return args
end,
- Set = function (start, keys, values, finish)
+ Set = function (start, keys, eqFinish, values, finish)
for i = 1, #keys do
local key = keys[i]
if key.type == 'getname' then
@@ -1191,6 +1191,15 @@ local Defs = {
elseif key.type == 'getindex' then
key.type = 'setindex'
key.value = getValue(values, i)
+ else
+ PushError {
+ type = 'UNEXPECT_SYMBOL',
+ start = eqFinish - 1,
+ finish = eqFinish - 1,
+ info = {
+ symbol = '=',
+ }
+ }
end
if key.value then
key.range = key.value.finish