diff --git a/source/lang/parser.cpp b/source/lang/parser.cpp index ca78c6f38..14912e818 100644 --- a/source/lang/parser.cpp +++ b/source/lang/parser.cpp @@ -257,7 +257,7 @@ namespace hex::lang { auto program = parseTillToken(currentToken, Token::Type::EndOfProgram); - if (program.empty()) + if (program.empty() || currentToken != tokens.end()) return { ResultParseError, { } }; return { ResultSuccess, program };