Move task macros to Tasking.hpp

Signed-off-by: Username404-59 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404-59 2024-08-07 14:28:14 +02:00
parent d4df3aa4ea
commit 7fb9ca37a7
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
3 changed files with 3 additions and 12 deletions

View File

@ -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

View File

@ -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<T&>(*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:

View File

@ -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<const char*, const char*> print_functions_pair;
virtual unordered_task_map getTaskMap() = 0;
virtual print_functions_pair printFunctions() = 0;
@ -163,11 +160,6 @@ unique_ptr<Target> 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;
}