Added lexer from previous project

This commit is contained in:
Pasha Bibko
2025-04-16 19:32:26 +01:00
parent 753c72c653
commit 4ac5061f03
14 changed files with 506 additions and 23 deletions

View File

@@ -1,8 +1,18 @@
#pragma once
#include <fstream>
namespace LX
{
template<typename T, typename... Args>
inline void ThrowIf(const bool condition, Args... args)
{ if (condition) [[unlikely]] { throw T(args...); }}
template<typename... Args>
inline void SafeLog(std::ofstream* log, Args... args)
{
if (log != nullptr) { (*log << ... << args); *log << "\n"; }
}
constexpr const char* LOG_BREAK = "\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n";
}