feat: basic parsing of example.rx is ready

This commit is contained in:
2025-11-28 18:32:30 +01:00
parent 7febbb80d4
commit 13fbdad563
5 changed files with 354 additions and 47 deletions

View File

@ -8,9 +8,9 @@ void dump_tokens(const char* filename, Lexer* lexer)
{
while (lexer->NextToken()) {
std::print("{}:{}:{}: ", filename, lexer->token().line_number, lexer->token().offset_start);
if (lexer->token().token == Id)
if (lexer->token().token == TokenType::Id)
std::println("id = {}", lexer->token().string);
else if (lexer->token().token == IntLiteral)
else if (lexer->token().token == TokenType::IntLiteral)
std::println("int = {}", lexer->token().int_number);
else
std::println("token = {}", (char)lexer->token().token);
@ -48,8 +48,7 @@ int main(int argc, char** argv)
AstParser parser(&lexer);
auto node = parser.ParseStatement();
ExternNode* extrn = reinterpret_cast<ExternNode*>(node);
auto program = parser.Parse();
return 0;
}