summaryrefslogtreecommitdiff
path: root/script/vm/field.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/vm/field.lua')
-rw-r--r--script/vm/field.lua22
1 files changed, 3 insertions, 19 deletions
diff --git a/script/vm/field.lua b/script/vm/field.lua
index c30e112d..52c56e7f 100644
--- a/script/vm/field.lua
+++ b/script/vm/field.lua
@@ -7,26 +7,10 @@ local localID = require 'vm.local-id'
local globalMgr = require 'vm.global-manager'
local nodeMgr = require 'vm.node'
-local searchNodeSwitch = util.switch()
- : case 'table'
- : call(function (node, pushResult)
- for _, field in ipairs(node) do
- if field.type == 'tablefield'
- or field.type == 'tableindex' then
- pushResult(field)
- end
- end
- end)
-
local function searchByNode(source, pushResult)
- local node = compiler.compileNode(source)
- if not node then
- return
- end
-
- for n in nodeMgr.eachNode(node) do
- searchNodeSwitch(n.type, n, pushResult)
- end
+ compiler.compileByParentNode(source, nil, function (field)
+ pushResult(field)
+ end)
end
---@param source parser.object