From 3e2f123f66759bbd81dc8e34832d007fc1b5c427 Mon Sep 17 00:00:00 2001 From: Reece Date: Wed, 19 Jan 2022 20:09:53 +0000 Subject: [PATCH] [*] Transplanting new logic --- Core/Legacy/jsonProcessor.lua | 60 ++++------------------------------- 1 file changed, 6 insertions(+), 54 deletions(-) diff --git a/Core/Legacy/jsonProcessor.lua b/Core/Legacy/jsonProcessor.lua index 21e32ea..e37ca18 100644 --- a/Core/Legacy/jsonProcessor.lua +++ b/Core/Legacy/jsonProcessor.lua @@ -110,56 +110,12 @@ function JsonProcessor(info) end end - local processJsonBlockForLinks = function(object, this) - auForEach(object.links, links) - auForEach(object.depends, handleDependsShort, this, false) - --auForEach(object["soft-depends"], handleDependsShort, this, true) - end - - function handleEvalForLinks(object, this) - if (auIsArray(object)) then - auForEach(object, handleEvalForLinks, this) - return - end - - if (type(object) == "string") then - return - end - - processJsonBlockForLinks(object, this) - end - - local handleActionCommon = function(action, cb, ...) - local _if = action["if"] - local _then = action["then"] - - _G["info"] = info - - if (_if) then - local val = auEval("return " .. _if) - if (not val) then - return - end - - if (_then) then - cb(_then, ...) - end - else - if (action.eval) then - cb(action.eval, ...) - end - end - - _G["info"] = nil - end - - local handleActionsForLinks = function(action, this) - handleActionCommon(action, handleEvalForLinks, this) - end - local processSubLinks = function(this) - processJsonBlockForLinks(result, this) - auForEach(result.actions, handleActionsForLinks, this) + + auRequire("Core/JSON/JSON").projectHandlers.runProjectLink(this, result, function(dep, soft) + print("LINK-> ", dep, soft) + handleDependsShort(dep, this, soft) + end) end local handleSourcesRel = function(source, path) @@ -350,7 +306,7 @@ function JsonProcessor(info) processor:handleLink() end else - defines(macro .. "=0") + --defines(macro .. "=0") if (not soft) then fatal("missing project: ", dep) end @@ -393,10 +349,6 @@ function JsonProcessor(info) processJsonBlock(object) end - local handleAction = function(action) - handleActionCommon(action, handleEval) - end - if (not isUtility) then processJsonBlock(result)