EOF in parser

This commit is contained in:
Mr. eXoDia 2016-06-11 22:45:13 +02:00
parent 0f4eb113a9
commit 8227ec126c
1 changed files with 7 additions and 1 deletions

View File

@ -46,7 +46,13 @@ uptr<Block> Parser::ParseBinaryTemplate()
break;
statDecls.push_back(move(statDecl));
}
return make_uptr<Block>(move(statDecls));
auto binaryTemplate = make_uptr<Block>(move(statDecls));
if (CurToken.Token != Lexer::tok_eof)
{
ReportError("last token is not EOF");
return nullptr;
}
return move(binaryTemplate);
}
uptr<StatDecl> Parser::ParseStatDecl()