From 7fb9ca37a7fa5b0ce7bea971b66cb9f7ef22f220 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Wed, 7 Aug 2024 14:28:14 +0200 Subject: [PATCH] Move task macros to Tasking.hpp Signed-off-by: Username404-59 --- src/headers/SemanticAnalysis.hpp | 4 ---- src/headers/Tasking.hpp | 3 +++ src/headers/transpiler/Target.hpp | 8 -------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/headers/SemanticAnalysis.hpp b/src/headers/SemanticAnalysis.hpp index d86e0a5..10fcf59 100644 --- a/src/headers/SemanticAnalysis.hpp +++ b/src/headers/SemanticAnalysis.hpp @@ -4,8 +4,6 @@ #include "parsing/ParseComponents.hpp" #include "Tasking.hpp" -#define make_task(T, C, F) make_task_base_R(T, C, F) - struct SemanticAnalyser final: public Tasking { const auto& analyseTree(const ParseTree& tree) { const auto& task_map = getTaskMapInstance(); @@ -24,6 +22,4 @@ private: }; }; -#undef make_task - #endif //YERBACON_SEMANTICANALYSIS_HPP diff --git a/src/headers/Tasking.hpp b/src/headers/Tasking.hpp index a0f1320..acdabde 100644 --- a/src/headers/Tasking.hpp +++ b/src/headers/Tasking.hpp @@ -7,6 +7,9 @@ #define make_task_base(start, type, captures, function_body) make_pair(type_index(typeid(type)), [captures](const ParseTree& parsedTree, unsigned int& index) { start; function_body }) #define make_task_base_R(T, C, F) make_task_base(const T& parseComponent = reinterpret_cast(*parsedTree[index]), T, C, F) +#define make_task(T, F) make_task_base_R(T, this, F) +#define make_task_noR(T, F) make_task_base(,T, this, F) +#define make_nonlocal_task(T, F) make_task_base_R(T, , F) class Tasking { protected: diff --git a/src/headers/transpiler/Target.hpp b/src/headers/transpiler/Target.hpp index 9b89690..9bea246 100644 --- a/src/headers/transpiler/Target.hpp +++ b/src/headers/transpiler/Target.hpp @@ -66,9 +66,6 @@ protected: } } else output << openCharacters << view << closeCharacters; } - #define make_task(T, F) make_task_base_R(T, this, F) - #define make_task_noR(T, F) make_task_base(,T, this, F) - #define make_nonlocal_task(T, F) make_task_base_R(T, , F) typedef pair print_functions_pair; virtual unordered_task_map getTaskMap() = 0; virtual print_functions_pair printFunctions() = 0; @@ -163,11 +160,6 @@ unique_ptr Target::forName(string_view name, const bool newLines = true) ADDTARGET("py", PyTarget); ADDTARGET("gd", GsTarget); #undef ADDTARGET - #undef make_nonlocal_task - #undef make_task_noR - #undef make_task - #undef make_task_base_R - #undef make_task_base Yerbacon::fail({"\"", name.data(), "\" is not a valid target."}); return nullptr; }