HLSL: allow trailing commas in initializer lists & scalar initialization

This commit is contained in:
steve-lunarg
2016-07-30 10:36:09 -06:00
parent b38f071605
commit fe5a3ff2f3
5 changed files with 199 additions and 5 deletions

View File

@@ -1549,8 +1549,11 @@ bool HlslGrammar::acceptInitializer(TIntermTyped*& node)
node = intermediate.growAggregate(node, expr, loc);
// COMMA
if (acceptTokenClass(EHTokComma))
if (acceptTokenClass(EHTokComma)) {
if (acceptTokenClass(EHTokRightBrace)) // allow trailing comma
return true;
continue;
}
// RIGHT_BRACE
if (acceptTokenClass(EHTokRightBrace))