Move task macros to Tasking.hpp
Signed-off-by: Username404-59 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
d4df3aa4ea
commit
7fb9ca37a7
|
@ -4,8 +4,6 @@
|
||||||
#include "parsing/ParseComponents.hpp"
|
#include "parsing/ParseComponents.hpp"
|
||||||
#include "Tasking.hpp"
|
#include "Tasking.hpp"
|
||||||
|
|
||||||
#define make_task(T, C, F) make_task_base_R(T, C, F)
|
|
||||||
|
|
||||||
struct SemanticAnalyser final: public Tasking {
|
struct SemanticAnalyser final: public Tasking {
|
||||||
const auto& analyseTree(const ParseTree& tree) {
|
const auto& analyseTree(const ParseTree& tree) {
|
||||||
const auto& task_map = getTaskMapInstance();
|
const auto& task_map = getTaskMapInstance();
|
||||||
|
@ -24,6 +22,4 @@ private:
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#undef make_task
|
|
||||||
|
|
||||||
#endif //YERBACON_SEMANTICANALYSIS_HPP
|
#endif //YERBACON_SEMANTICANALYSIS_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(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_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 {
|
class Tasking {
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -66,9 +66,6 @@ protected:
|
||||||
}
|
}
|
||||||
} else output << openCharacters << view << closeCharacters;
|
} 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;
|
typedef pair<const char*, const char*> print_functions_pair;
|
||||||
virtual unordered_task_map getTaskMap() = 0;
|
virtual unordered_task_map getTaskMap() = 0;
|
||||||
virtual print_functions_pair printFunctions() = 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("py", PyTarget);
|
||||||
ADDTARGET("gd", GsTarget);
|
ADDTARGET("gd", GsTarget);
|
||||||
#undef ADDTARGET
|
#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."});
|
Yerbacon::fail({"\"", name.data(), "\" is not a valid target."});
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue