HLSL: allow trailing commas in initializer lists & scalar initialization
This commit is contained in:
parent
b38f071605
commit
fe5a3ff2f3
5 changed files with 199 additions and 5 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue