From b89161a1bbe5371c7371d0eee9eb3e4db0c633ba Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Thu, 20 Jul 2023 10:37:58 -0700 Subject: [PATCH] removed deprecated function and key_instance ref --- .../utils/parse/axes_parser.lua | 69 ------------------- 1 file changed, 69 deletions(-) diff --git a/worldeditadditions_core/utils/parse/axes_parser.lua b/worldeditadditions_core/utils/parse/axes_parser.lua index 331c958..abdde5b 100644 --- a/worldeditadditions_core/utils/parse/axes_parser.lua +++ b/worldeditadditions_core/utils/parse/axes_parser.lua @@ -16,13 +16,10 @@ end local wea_c = worldeditadditions_core or nil local Vector3 -local key_instance if worldeditadditions_core then - key_instance = dofile(wea_c.modpath.."/utils/parse/key_instance.lua") Vector3 = dofile(wea_c.modpath.."/utils/vector3.lua") else Vector3 = require("worldeditadditions_core.utils.vector3") - key_instance = require("worldeditadditions_core.utils.parse.key_instance") end @@ -143,72 +140,6 @@ end -- @param: sum: Bool | String | nil: Return a single vector by summing the 2 output vectors together -- @returns: Vector3, [Vector3]: returns min, max Vector3s or sum Vector3 (if @param: sum ~= nil) -- if error: @returns: false, String: error message -function parse.keytable_old(tbl, facing, sum) - local min, max = Vector3.new(), Vector3.new() - local expected = 1 - local tmp = {axes = {}, num = 0, sign = 1, mirror = false} - - function tmp:reset() - self.axis, self.sign = "", 1 - end - - for i, v in ipairs(tbl) do - if v:sub(1, 1) == "+" then - v = v:sub(2) - end - - tmp.num = parse.num(v) - - if expected == 1 then - if tmp.num then - if tmp.num * tmp.sign >= 0 then - max = max:add(parse.vectorize({"x","y","z"}, tmp.num, tmp.sign)) - else - min = min:add(parse.vectorize({"x","y","z"}, tmp.num, tmp.sign)) - end - else - local key_type, key_entry, key_sign = parse.keyword(v) - - if key_type == "axis" then - tmp.axes = key_entry - tmp.sign = key_sign - elseif key_type == "dir" then - tmp.axes = {facing[key_entry].axis} - tmp.sign = facing[key_entry].sign * key_sign - elseif key_type == "rev" then - tmp.mirror = true - else - return false, key_entry - end - - expected = 2 - end - else - if tmp.num then - if tmp.num * tmp.sign >= 0 then - max = max:add(parse.vectorize(tmp.axes, tmp.num, tmp.sign)) - else - min = min:add(parse.vectorize(tmp.axes, tmp.num, tmp.sign)) - end - expected = 1 - else - return false, "Error: Expected number after \""..tostring(tbl[i-1]).."\". Got \""..tostring(v).."\"." - end - end - end - - if tmp.mirror and not sum then - max = max:max(min:abs()) - min = max:multiply(-1) - end - - if sum then - return min:add(max) - else - return min, max - end -end - function parse.keytable(tbl, facing, sum) local min, max = Vector3.new(), Vector3.new() local expected = 1