diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-03-29 14:04:32 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-03-29 14:04:32 +0800 |
commit | 90c4b35ef7486f460aaf0c32072f6c142ca74bb0 (patch) | |
tree | b56371c99226908018a0d8f1db5a30642580e3ce /script/parser | |
parent | f7905e759ec7be0188b7f237eeb531bc111695af (diff) | |
download | lua-language-server-90c4b35ef7486f460aaf0c32072f6c142ca74bb0.zip |
stash
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/ast.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/script/parser/ast.lua b/script/parser/ast.lua index 45801cf6..9acdb06b 100644 --- a/script/parser/ast.lua +++ b/script/parser/ast.lua @@ -6,6 +6,7 @@ local mathType = math.type local tableRemove = table.remove local pairs = pairs local tableSort = table.sort +local tableInsert = table.insert _ENV = nil @@ -701,6 +702,14 @@ local Defs = { finish = call.finish, } end + if call.type == 'call' + and call.node + and call.node.type == 'getmethod' then + if not call.args then + call.args = {} + end + tableInsert(call.args, 1, call.node) + end return call end, BinaryOp = function (start, op) @@ -1017,6 +1026,11 @@ local Defs = { elseif name.type == 'getmethod' then name.type = 'setmethod' name.value = actions + if not args then + args = {} + actions.args = args + end + tableInsert(args, 1, name.node) elseif name.type == 'getindex' then name.type = 'setfield' name.value = actions |