diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-14 22:23:32 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-14 22:23:32 +0800 |
commit | 75509a89ecc69c683c015a97c9844746c81e6057 (patch) | |
tree | 9d2b0784a10fbda18784c3e939b6b65987569ff3 /script/parser/newparser.lua | |
parent | 7df9f807faf27e3faea33842ed599963e00cdb0b (diff) | |
download | lua-language-server-75509a89ecc69c683c015a97c9844746c81e6057.zip |
cheanup
Diffstat (limited to 'script/parser/newparser.lua')
-rw-r--r-- | script/parser/newparser.lua | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua index 5245b94d..ea4ad2c7 100644 --- a/script/parser/newparser.lua +++ b/script/parser/newparser.lua @@ -1749,15 +1749,15 @@ local function addDummySelf(node, call) parent = call, } end - local newNode = {} - for k, v in next, call.node.node do - newNode[k] = v - end - newNode.mirror = call.node.node - newNode.dummy = true - newNode.parent = call.args - call.node.node.mirror = newNode - tinsert(call.args, 1, newNode) + local self = createLocal { + start = node.colon.start, + finish = node.colon.finish, + method = node, + parent = call.args, + [1] = 'self', + } + self.type = 'self' + tinsert(call.args, 1, self) end local function parseSimple(node, funcName) @@ -2303,10 +2303,9 @@ local function parseFunction(isLocal, isAction) finish = funcRight, method = func.name, parent = params, - tag = 'self', - dummy = true, [1] = 'self', } + params[1].type = 'self' end end if hasLeftParen then |