diff --git a/src/Lexer.cpp b/src/Lexer.cpp index 122878a..d1f30e3 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -23,7 +23,7 @@ int Lexer::advance() prev_loc = loc; ++index; loc.advance(); - if(index == current_lexed_text.size()) return 0; + if(index >= current_lexed_text.size()) return 0; current_char = current_lexed_text[index]; loc.pos_from_char(current_char); if(current_char == '\n')