diff --git a/Common/modules/IO.h b/Common/modules/IO.h index e7000ee..f6373fb 100644 --- a/Common/modules/IO.h +++ b/Common/modules/IO.h @@ -139,12 +139,30 @@ namespace LXC::Util // Prints arguments to the console with a new-line character at the end // template - requires Internal::AllLogable + requires Internal::AllLogable && (sizeof...(Args) > 1) inline void PrintLn(Args&&... args) { Internal::WriteImpl(std::cout, std::forward(args)...); } + // Prints a new line within the console // + inline void PrintLn() + { + Internal::WriteImpl(std::cout); + } + + // Prints argument to the console with a new line character at the end // + template + requires Internal::HasLogStrFunc || Internal::Logable + inline void PrintLn(T&& arg) + { + if constexpr (Internal::HasLogStrFunc) + Internal::WriteImpl(std::cout, arg.LogStr()); + + else + Internal::WriteImpl(std::cout, arg); + } + // Logs all the arguments to the file (automatically flushes) // template requires Internal::AllLogable && (sizeof...(Args) > 1) diff --git a/parser/src/Parser.cpp b/parser/src/Parser.cpp index 5d1c493..0913e7b 100644 --- a/parser/src/Parser.cpp +++ b/parser/src/Parser.cpp @@ -6,6 +6,11 @@ namespace LXC::Parser { Util::ReturnVal, ParserError> TurnTokensIntoAST(const Lexer::LexerOutput& input) { + for (const auto& token : input) + { + Util::PrintLn(token); + } + return Util::FunctionFail(); } }