Add an alternative "make_task_noR" macro to avoid making unused references in Target.hpp
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
f33aec687a
commit
ca4e773fca
|
@ -65,9 +65,11 @@ protected:
|
|||
} else output << openCharacters << view << closeCharacters;
|
||||
}
|
||||
typedef function<void (const ParseTree& parsedTree, unsigned int& index)> task;
|
||||
#define make_task_base(type, captures, function_body) make_pair(type_index(typeid(type)), [captures](const ParseTree& parsedTree, unsigned int& index) { const type& parseComponent = pointerAs<type>(parsedTree[index]); function_body })
|
||||
#define make_task(T, F) make_task_base(T, this, F)
|
||||
#define make_nonlocal_task(T, F) make_task_base(T, , F)
|
||||
#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 = pointerAs<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)
|
||||
typedef unordered_map<type_index, task> unordered_task_map;
|
||||
typedef pair<const char*, const char*> print_functions_pair;
|
||||
virtual unordered_task_map getTaskMap() = 0;
|
||||
|
@ -86,11 +88,11 @@ public:
|
|||
}
|
||||
}
|
||||
),
|
||||
make_task_base(StandardComponents::Reference, &,
|
||||
make_task(StandardComponents::Reference,
|
||||
const auto print_functions = printFunctions();
|
||||
output << ((parseComponent.name == "print") ? print_functions.first : (parseComponent.name == "print_line") ? print_functions.second : parseComponent.name);
|
||||
),
|
||||
make_task(StandardComponents::Call,
|
||||
make_task_noR(StandardComponents::Call,
|
||||
output << '(';
|
||||
staticMap[typeid(ParseTree)](parsedTree, index);
|
||||
output << ')';
|
||||
|
@ -159,7 +161,9 @@ shared_ptr<Target> Target::forName(string_view name, const bool newLines = true)
|
|||
}
|
||||
#undef ADDTARGET
|
||||
#undef make_nonlocal_task
|
||||
#undef make_task_noR
|
||||
#undef make_task
|
||||
#undef make_task_base_R
|
||||
#undef make_task_base
|
||||
return target;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue