diff options
Diffstat (limited to 'script-beta/vm')
-rw-r--r-- | script-beta/vm/eachDef.lua | 7 | ||||
-rw-r--r-- | script-beta/vm/eachField.lua | 10 | ||||
-rw-r--r-- | script-beta/vm/eachRef.lua | 7 | ||||
-rw-r--r-- | script-beta/vm/getClass.lua | 7 | ||||
-rw-r--r-- | script-beta/vm/getMeta.lua | 8 |
5 files changed, 9 insertions, 30 deletions
diff --git a/script-beta/vm/eachDef.lua b/script-beta/vm/eachDef.lua index 37ba4ec5..ab71e7c4 100644 --- a/script-beta/vm/eachDef.lua +++ b/script-beta/vm/eachDef.lua @@ -43,10 +43,3 @@ function vm.getDefs(source, deep) return cache end end - -function vm.eachDef(source, callback) - local results = vm.getDefs(source) - for i = 1, #results do - callback(results[i]) - end -end diff --git a/script-beta/vm/eachField.lua b/script-beta/vm/eachField.lua index ac104267..12d1d908 100644 --- a/script-beta/vm/eachField.lua +++ b/script-beta/vm/eachField.lua @@ -64,13 +64,3 @@ function vm.getFields(source, deep) return cache end end - -function vm.eachField(source, callback) - local results = vm.getFields(source) - if not results then - return - end - for i = 1, #results do - callback(results[i]) - end -end diff --git a/script-beta/vm/eachRef.lua b/script-beta/vm/eachRef.lua index 95b91343..7d1f2c77 100644 --- a/script-beta/vm/eachRef.lua +++ b/script-beta/vm/eachRef.lua @@ -42,10 +42,3 @@ function vm.getRefs(source, deep) return cache end end - -function vm.eachRef(source, callback) - local results = vm.getRefs(source) - for i = 1, #results do - callback(results[i]) - end -end diff --git a/script-beta/vm/getClass.lua b/script-beta/vm/getClass.lua index 2a507b12..1948922d 100644 --- a/script-beta/vm/getClass.lua +++ b/script-beta/vm/getClass.lua @@ -35,10 +35,10 @@ local function getClass(source, classes, depth, deep) classes[#classes+1] = value[1] end else - vm.eachField(value, function (src) + for _, src in ipairs(vm.getFields(value)) do local key = vm.getKeyName(src) if not key then - return + goto CONTINUE end local lkey = key:lower() if lkey == 's|type' @@ -50,7 +50,8 @@ local function getClass(source, classes, depth, deep) classes[#classes+1] = value[1] end end - end) + ::CONTINUE:: + end end if #classes ~= 0 then return diff --git a/script-beta/vm/getMeta.lua b/script-beta/vm/getMeta.lua index 73d01aef..aebef1a7 100644 --- a/script-beta/vm/getMeta.lua +++ b/script-beta/vm/getMeta.lua @@ -34,13 +34,15 @@ end function vm.eachMetaValue(source, callback) vm.eachMeta(source, function (mt) - vm.eachField(mt, function (src) + for _, src in ipairs(vm.getFields(mt)) do if vm.getKeyName(src) == 's|__index' then if src.value then - vm.eachField(src.value, callback) + for _, valueSrc in ipairs(vm.getFields(src.value)) do + callback(valueSrc) + end end end - end) + end end) end |