Fix error where lexer would loop infinitely if unknown character found

This commit is contained in:
2024-04-15 16:30:44 +06:30
parent 0f430e399c
commit 83faf86312

View File

@@ -403,6 +403,12 @@ lerr_t tokenise_buffer(string_view source, std::vector<token_t *> &tokens)
if (lerr.type != lerr_type_t::OK)
return lerr;
}
else
{
++column;
return lerr_t{lerr_type_t::UNKNOWN_CHAR, column, line};
}
if (is_token)
{
t.line = line;