Started implementing Lexer errors
This commit is contained in:
@@ -9,8 +9,10 @@ int main(int argc, char** argv)
|
||||
// Creates the debug log //
|
||||
Util::CreateLog("LXC.log");
|
||||
|
||||
std::filesystem::path src = "example/example.lx";
|
||||
|
||||
// Reads the given file to a string //
|
||||
Util::ReturnVal fileContents = Util::ReadFile("example/example.lx");
|
||||
Util::ReturnVal fileContents = Util::ReadFile(src);
|
||||
if (fileContents.Failed()) _UNLIKELY
|
||||
{
|
||||
// Stores the error for easier access //
|
||||
@@ -34,6 +36,11 @@ int main(int argc, char** argv)
|
||||
// Stores the error for easier access //
|
||||
Lexer::LexerError& err = tokens.Error();
|
||||
|
||||
// Prints the error to the console //
|
||||
Util::PrintAs<Util::WHITE>("[LXC] ");
|
||||
Util::Print(src.filename().string());
|
||||
Util::PrintAs<Util::LIGHT_RED>(" Error: ");
|
||||
|
||||
Util::Stop();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user