Added foundation for Lexer
This commit is contained in:
10
LXC/LXC.cpp
10
LXC/LXC.cpp
@@ -7,7 +7,7 @@ int main(int argc, char** argv)
|
||||
using namespace LXC;
|
||||
|
||||
// Reads the given file to a string //
|
||||
Util::ReturnVal fileContents = Util::ReadFile("example/example.lx");
|
||||
Util::ReturnVal fileContents = Util::ReadFile("example/example.jk.lx");
|
||||
if (fileContents.Failed())
|
||||
{
|
||||
// Stores the error for easier access //
|
||||
@@ -26,5 +26,13 @@ int main(int argc, char** argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Turns the file contents into a vector of tokens //
|
||||
Util::ReturnVal tokens = Lexer::TokenizeFile(fileContents);
|
||||
if (tokens.Failed())
|
||||
{
|
||||
// Returns with default error code //
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user