Allowed Util::PrintLn to use T.LogStr()
This commit is contained in:
@@ -139,12 +139,30 @@ namespace LXC::Util
|
||||
|
||||
// Prints arguments to the console with a new-line character at the end //
|
||||
template<typename... Args>
|
||||
requires Internal::AllLogable<Args...>
|
||||
requires Internal::AllLogable<Args...> && (sizeof...(Args) > 1)
|
||||
inline void PrintLn(Args&&... args)
|
||||
{
|
||||
Internal::WriteImpl<Util::Color::DEFAULT, true>(std::cout, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
// Prints a new line within the console //
|
||||
inline void PrintLn()
|
||||
{
|
||||
Internal::WriteImpl<Util::Color::DEFAULT, true>(std::cout);
|
||||
}
|
||||
|
||||
// Prints argument to the console with a new line character at the end //
|
||||
template<typename T>
|
||||
requires Internal::HasLogStrFunc<T> || Internal::Logable<T>
|
||||
inline void PrintLn(T&& arg)
|
||||
{
|
||||
if constexpr (Internal::HasLogStrFunc<T>)
|
||||
Internal::WriteImpl<Util::Color::DEFAULT, true>(std::cout, arg.LogStr());
|
||||
|
||||
else
|
||||
Internal::WriteImpl<Util::Color::DEFAULT, true>(std::cout, arg);
|
||||
}
|
||||
|
||||
// Logs all the arguments to the file (automatically flushes) //
|
||||
template<typename... Args>
|
||||
requires Internal::AllLogable<Args...> && (sizeof...(Args) > 1)
|
||||
|
||||
@@ -6,6 +6,11 @@ namespace LXC::Parser
|
||||
{
|
||||
Util::ReturnVal<std::vector<FunctionAST>, ParserError> TurnTokensIntoAST(const Lexer::LexerOutput& input)
|
||||
{
|
||||
for (const auto& token : input)
|
||||
{
|
||||
Util::PrintLn(token);
|
||||
}
|
||||
|
||||
return Util::FunctionFail<ParserError>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user