summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/noder.lua60
1 files changed, 26 insertions, 34 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua
index 80d1774c..749dcba6 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -379,7 +379,7 @@ local getKeyMap = util.switch()
end)
: case 'generic.closure'
: call(function (source)
- return 'gc:' .. source.call.finish, nil
+ return 'gc:' .. source.call.start, nil
end)
: case 'generic.value'
: call(function (source)
@@ -388,7 +388,7 @@ local getKeyMap = util.switch()
tail = URI_CHAR .. guide.getUri(source.closure.call)
end
return sformat('gv:%s|%s%s'
- , source.closure.call.finish
+ , source.closure.call.start
, getKey(source.proto)
, tail
)
@@ -1241,43 +1241,35 @@ compileNodeMap = util.switch()
local node = exps[1]
local param1 = exps[2]
local param2 = exps[3]
- local nodeID = getID(node)
- local param1ID = getID(param1)
- local param2ID = getID(param2)
if node.type == 'call' then
- if not param1ID then
- param1ID = sformat('%s%s%s'
- , nodeID
- , RETURN_INDEX
- , 2
- )
- if not param2ID then
- param2ID = sformat('%s%s%s'
- , nodeID
- , RETURN_INDEX
- , 3
- )
+ if not param1 then
+ param1 = {
+ type = 'select',
+ sindex = 2,
+ start = node.start,
+ finish = node.finish,
+ vararg = node,
+ }
+ compileCallReturn(noders, node, getID(param1), 2)
+ if not param2 then
+ param2 = {
+ type = 'select',
+ sindex = 2,
+ start = node.start,
+ finish = node.finish,
+ vararg = node,
+ }
+ compileCallReturn(noders, node, getID(param2), 3)
end
end
end
local call = {
- type = 'dummy',
- _id = 'c:' .. source.keyword[3],
- finish = source.finish,
- node = {
- type = 'dummy',
- _id = nodeID,
- },
- args = {
- [1] = {
- type = 'dummy',
- _id = param1ID,
- },
- [2] = {
- type = 'dummy',
- _id = param2ID,
- }
- }
+ type = 'call',
+ dummy = true,
+ start = source.keyword[3],
+ finish = source.keyword[6],
+ node = node,
+ args = { param1, param2 }
}
for i = 1, #keys do
compileCallReturn(noders, call, getID(keys[i]), i)