feat: error handling, better prelude, double linked lists usage etc
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user