summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md3
-rw-r--r--script/parser/newparser.lua8
2 files changed, 7 insertions, 4 deletions
diff --git a/changelog.md b/changelog.md
index 9a729ca9..015c70e5 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,8 @@
# changelog
+## 2.5.4
+* `FIX` [#848](https://github.com/sumneko/lua-language-server/issues/848)
+
## 2.5.3
`2021-12-6`
* `FIX` [#842](https://github.com/sumneko/lua-language-server/issues/844)
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