HLSL: allow semicolons between global scope declarations.
This commit is contained in:
parent
f6640761c4
commit
cb88de5e5e
4 changed files with 121 additions and 0 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue