Fixed a little segfault hehe :))

This commit is contained in:
apio 2022-06-07 18:57:41 +02:00
parent 7a320fb70a
commit c962c22017

View File

@ -23,7 +23,7 @@ int Lexer::advance()
prev_loc = loc; prev_loc = loc;
++index; ++index;
loc.advance(); loc.advance();
if(index == current_lexed_text.size()) return 0; if(index >= current_lexed_text.size()) return 0;
current_char = current_lexed_text[index]; current_char = current_lexed_text[index];
loc.pos_from_char(current_char); loc.pos_from_char(current_char);
if(current_char == '\n') if(current_char == '\n')