From 8227ec126ca4fa497a76dd62318f5f0726326662 Mon Sep 17 00:00:00 2001 From: "Mr. eXoDia" Date: Sat, 11 Jun 2016 22:45:13 +0200 Subject: [PATCH] EOF in parser --- btparser/parser.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/btparser/parser.cpp b/btparser/parser.cpp index 9c39115..6b1ef2a 100644 --- a/btparser/parser.cpp +++ b/btparser/parser.cpp @@ -46,7 +46,13 @@ uptr Parser::ParseBinaryTemplate() break; statDecls.push_back(move(statDecl)); } - return make_uptr(move(statDecls)); + auto binaryTemplate = make_uptr(move(statDecls)); + if (CurToken.Token != Lexer::tok_eof) + { + ReportError("last token is not EOF"); + return nullptr; + } + return move(binaryTemplate); } uptr Parser::ParseStatDecl()