summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-09-22 17:41:25 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-09-22 17:41:25 +0800
commitc951f3472628bdccdbf13a6bd95bc36cc93523fd (patch)
tree1b54015d40483b573e981678f06859e3e709c929 /script/parser
parent32aa2dac835a0c74b82b19d83d9fd06be7a947ce (diff)
downloadlua-language-server-c951f3472628bdccdbf13a6bd95bc36cc93523fd.zip
update
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/newparser.lua16
1 files changed, 12 insertions, 4 deletions
diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua
index 9547a830..ba91cd10 100644
--- a/script/parser/newparser.lua
+++ b/script/parser/newparser.lua
@@ -2573,6 +2573,7 @@ local function parseMultiVars(n1, parser, isLocal)
skipSpace()
local v1, v2, vrest
local isSet
+ local max = 1
if expectAssign() then
v1, v2, vrest = parseSetValues()
isSet = true
@@ -2583,6 +2584,7 @@ local function parseMultiVars(n1, parser, isLocal)
bindValue(n1, v1, 1, nil, isLocal, isSet)
local lastValue = v1
if n2 then
+ max = 2
bindValue(n2, v2, 2, lastValue, isLocal, isSet)
lastValue = v2 or lastValue
pushActionIntoCurrentChunk(n2)
@@ -2591,21 +2593,28 @@ local function parseMultiVars(n1, parser, isLocal)
for i = 1, #nrest do
local n = nrest[i]
local v = vrest and vrest[i]
- bindValue(n, v, i + 2, lastValue, isLocal, isSet)
+ max = i + 2
+ bindValue(n, v, max, lastValue, isLocal, isSet)
lastValue = v or lastValue
pushActionIntoCurrentChunk(n)
end
end
if v2 and not n2 then
- v2.redundant = true
+ v2.redundant = {
+ max = max,
+ passed = 2,
+ }
pushActionIntoCurrentChunk(v2)
end
if vrest then
for i = 1, #vrest do
local v = vrest[i]
if not nrest or not nrest[i] then
- v.redundant = true
+ v.redundant = {
+ max = max,
+ passed = v + 2,
+ }
pushActionIntoCurrentChunk(v)
end
end
@@ -3530,7 +3539,6 @@ local function initState(lua, version, options)
lua = lua,
ast = {},
errs = {},
- diags = {},
comms = {},
lines = {
[0] = 1,