Skip to content

Commit e868888

Browse files
committed
cleanup
1 parent 951fb08 commit e868888

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

.luarc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
32
"diagnostics": {
43
"disable": [
54
"close-non-object"

script/core/semantic-tokens.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ local Care = util.switch()
9292
}
9393
end)
9494
: case 'local'
95+
: case 'self'
9596
: case 'getlocal'
9697
: case 'setlocal'
9798
: call(function (source, options, results)

script/parser/newparser.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,7 +1752,6 @@ local function addDummySelf(node, call)
17521752
local self = createLocal {
17531753
start = node.colon.start,
17541754
finish = node.colon.finish,
1755-
method = node,
17561755
parent = call.args,
17571756
[1] = 'self',
17581757
}
@@ -2301,7 +2300,6 @@ local function parseFunction(isLocal, isAction)
23012300
params[1] = createLocal {
23022301
start = funcRight,
23032302
finish = funcRight,
2304-
method = func.name,
23052303
parent = params,
23062304
[1] = 'self',
23072305
}

script/vm/compiler.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,13 @@ local function compileLocalBase(source)
731731
local hasMarkParam
732732
if source.type == 'self' and not hasMarkDoc then
733733
hasMarkParam = true
734-
vm.setNode(source, vm.compileNode(source.method.node))
734+
if source.parent.parent.type == 'call' then
735+
-- obj:func(...)
736+
vm.setNode(source, vm.compileNode(source.parent.parent.node.node))
737+
else
738+
-- function obj:func(...)
739+
vm.setNode(source, vm.compileNode(source.parent.parent.parent.node))
740+
end
735741
end
736742
local hasMarkValue
737743
if source.value then

0 commit comments

Comments
 (0)