diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-06 09:38:27 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-06 09:38:27 +0800 |
commit | 5cb59c2cd6824c4d6c3483a8314f133c9a737191 (patch) | |
tree | e186949ca9bd5793e2db360bb360c3ff55da8a4c | |
parent | fb5ce900c0f09f5de2e3d8251da6bde09d4a1c71 (diff) | |
download | lua-language-server-5cb59c2cd6824c4d6c3483a8314f133c9a737191.zip |
更新 parser
-rw-r--r-- | server-beta/src/parser/compile.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/server-beta/src/parser/compile.lua b/server-beta/src/parser/compile.lua index 6479106f..e110d08c 100644 --- a/server-beta/src/parser/compile.lua +++ b/server-beta/src/parser/compile.lua @@ -151,6 +151,24 @@ local vmMap = { obj.type = 'setlocal' obj.loc = loc addRef(loc, obj) + if loc.attrs then + local const + for i = 1, #loc.attrs do + local attr = loc.attrs[i][1] + if attr == 'const' + or attr == 'close' then + const = true + break + end + end + if const then + pushError { + type = 'SET_CONST', + start = obj.start, + finish = obj.finish, + } + end + end else obj.type = 'setglobal' if ENVMode == '_ENV' then |