feat(furc): introduce while loop statement

Refs: #2
This commit is contained in:
2026-06-12 23:10:26 +02:00
parent 97c01bc96c
commit 767970c69b
11 changed files with 151 additions and 24 deletions
+4 -1
View File
@@ -1,5 +1,7 @@
#include "furc/front/lexer.hpp"
#include "furc/front/token.hpp"
#include <cctype>
#include <limits>
#include <map>
@@ -97,6 +99,7 @@ token_r lexer::next_token() {
{ "return", keyword_token::Return },
{ "if", keyword_token::If },
{ "else", keyword_token::Else },
{ "while", keyword_token::While },
};
if (auto it = s_keywords.find(value); it != s_keywords.end()) return { location, it->second };
@@ -185,4 +188,4 @@ location lexer::current_location() {
return { m_filename, m_row, m_cursor - m_lineStart };
}
} // namespace furc::front
} // namespace furc::front