summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-11-19 17:43:20 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-11-19 17:43:20 +0800
commitcf12604b1558fc56e2a0ef454cd754b8be265b68 (patch)
treea12eb4d09693879a98d918bd4c76a1dfe67c8e27
parent6630090bc5e7e6988bdc9c3640f035114c0dfc60 (diff)
downloadlua-language-server-cf12604b1558fc56e2a0ef454cd754b8be265b68.zip
check `SET_CONST` of function
-rw-r--r--script/parser/newparser.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua
index 0132350b..8eb97b17 100644
--- a/script/parser/newparser.lua
+++ b/script/parser/newparser.lua
@@ -3561,6 +3561,16 @@ function parseAction()
name.vstart = exp.start
name.range = exp.finish
exp.parent = name
+ if name.type == 'setlocal' then
+ local loc = name.node
+ if loc.attrs then
+ pushError {
+ type = 'SET_CONST',
+ start = name.start,
+ finish = name.finish,
+ }
+ end
+ end
pushActionIntoCurrentChunk(name)
return name
else