HLSL: allow semicolons between global scope declarations.

This commit is contained in:
steve-lunarg
2016-08-03 07:04:18 -06:00
parent f6640761c4
commit cb88de5e5e
4 changed files with 121 additions and 0 deletions

View File

@@ -89,12 +89,17 @@ bool HlslGrammar::acceptIdentifier(HlslToken& idToken)
// compilationUnit
// : list of externalDeclaration
// | SEMICOLONS
//
bool HlslGrammar::acceptCompilationUnit()
{
TIntermNode* unitNode = nullptr;
while (! peekTokenClass(EHTokNone)) {
// HLSL allows semicolons between global declarations, e.g, between functions.
if (acceptTokenClass(EHTokSemicolon))
continue;
// externalDeclaration
TIntermNode* declarationNode;
if (! acceptDeclaration(declarationNode))