diff options
Diffstat (limited to 'script/vm/compiler.lua')
-rw-r--r-- | script/vm/compiler.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index 543ee0d4..7faa4f47 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -1168,6 +1168,16 @@ local compilerSwitch = util.switch() vm.compileCallArg(source, call) end + if source.parent.type == 'return' then + local myIndex = util.arrayIndexOf(source.parent, source) + ---@cast myIndex -? + local parentNode = vm.selectNode(source.parent, myIndex) + if not parentNode:isEmpty() then + vm.setNode(source, parentNode) + return + end + end + if source.parent.type == 'setglobal' or source.parent.type == 'local' or source.parent.type == 'setlocal' |