feat: error handling, better prelude, double linked lists usage etc

This commit is contained in:
2026-01-02 22:06:56 +01:00
parent a453603b9b
commit 6176d549c1
10 changed files with 148 additions and 65 deletions

View File

@@ -92,11 +92,11 @@ public:
public:
bool NextToken()
{
if (m_pos >= m_code.size || m_code.data[m_pos] == '\0')
{
m_token = Token(TokenType::Eof);
return false;
}
// if (m_pos >= m_code.len())
// {
// m_token = Token(TokenType::Eof);
// return false;
// }
char c = m_code.data[m_pos++];
@@ -109,6 +109,12 @@ public:
c = m_code.data[m_pos++];
}
if (m_pos >= m_code.len())
{
m_token = Token(TokenType::Eof);
return false;
}
if (std::isalpha(c) != 0 || c == '_')
{
StringBuilder s;