Improved lexer debugging

This commit is contained in:
Pasha Bibko committed 2025-04-21 14:23:47 +01:00
1 parent a560c53c58
commit 49e4bba510
15 files changed
+405 -98

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
#include <Console.h>
#include <Windows.h>
#include <iostream>
namespace LX
{
void PrintStringAsColor(const std::string& str, Color c)
{
// Gets a handle to the console //
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
// Sets the color of the console to the desired color //
SetConsoleTextAttribute(hConsole, (WORD)c);
// Outputs the text //
std::cout << str;
// Resets the color //
SetConsoleTextAttribute(hConsole, (WORD)Color::LIGHT_GRAY);
}
}