summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-12-07 14:45:53 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-12-07 14:45:53 +0800
commit6f5aa8ca04f97fe3e1d3059b9d7868552fda0158 (patch)
tree50c88f0aa685515c6070afe9bb070f88d6d9614b /script/parser
parentdc5ee0b01a9610389e275ed8ff0746ba78cdd367 (diff)
downloadlua-language-server-6f5aa8ca04f97fe3e1d3059b9d7868552fda0158.zip
fix #848
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/newparser.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua
index 187de9b3..048e1f69 100644
--- a/script/parser/newparser.lua
+++ b/script/parser/newparser.lua
@@ -1649,11 +1649,13 @@ local function parseTable()
wantSep = true
local tindex = parseIndex()
skipSpace()
+ tindex.type = 'tableindex'
+ tindex.parent = tbl
+ index = index + 1
+ tbl[index] = tindex
if expectAssign() then
skipSpace()
local ivalue = parseExp()
- tindex.type = 'tableindex'
- tindex.parent = tbl
if ivalue then
ivalue.parent = tindex
tindex.finish = ivalue.finish
@@ -1661,8 +1663,6 @@ local function parseTable()
else
missExp()
end
- index = index + 1
- tbl[index] = tindex
else
missSymbol '='
end